initial commit
This commit is contained in:
138
project/src/main.c
Normal file
138
project/src/main.c
Normal file
@@ -0,0 +1,138 @@
|
||||
/* add user code begin Header */
|
||||
/**
|
||||
**************************************************************************
|
||||
* @file main.c
|
||||
* @brief main program
|
||||
**************************************************************************
|
||||
* Copyright notice & Disclaimer
|
||||
*
|
||||
* The software Board Support Package (BSP) that is made available to
|
||||
* download from Artery official website is the copyrighted work of Artery.
|
||||
* Artery authorizes customers to use, copy, and distribute the BSP
|
||||
* software and its related documentation for the purpose of design and
|
||||
* development in conjunction with Artery microcontrollers. Use of the
|
||||
* software is governed by this copyright notice and the following disclaimer.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED ON "AS IS" BASIS WITHOUT WARRANTIES,
|
||||
* GUARANTEES OR REPRESENTATIONS OF ANY KIND. ARTERY EXPRESSLY DISCLAIMS,
|
||||
* TO THE FULLEST EXTENT PERMITTED BY LAW, ALL EXPRESS, IMPLIED OR
|
||||
* STATUTORY OR OTHER WARRANTIES, GUARANTEES OR REPRESENTATIONS,
|
||||
* INCLUDING BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
|
||||
*
|
||||
**************************************************************************
|
||||
*/
|
||||
/* add user code end Header */
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "at32f403a_407_wk_config.h"
|
||||
#include "dwt_delay.h"
|
||||
/* private includes ----------------------------------------------------------*/
|
||||
/* add user code begin private includes */
|
||||
|
||||
/* add user code end private includes */
|
||||
|
||||
/* private typedef -----------------------------------------------------------*/
|
||||
/* add user code begin private typedef */
|
||||
|
||||
/* add user code end private typedef */
|
||||
|
||||
/* private define ------------------------------------------------------------*/
|
||||
/* add user code begin private define */
|
||||
|
||||
/* add user code end private define */
|
||||
|
||||
/* private macro -------------------------------------------------------------*/
|
||||
/* add user code begin private macro */
|
||||
|
||||
/* add user code end private macro */
|
||||
|
||||
/* private variables ---------------------------------------------------------*/
|
||||
/* add user code begin private variables */
|
||||
|
||||
/* add user code end private variables */
|
||||
|
||||
/* private function prototypes --------------------------------------------*/
|
||||
/* add user code begin function prototypes */
|
||||
|
||||
/* add user code end function prototypes */
|
||||
|
||||
/* private user code ---------------------------------------------------------*/
|
||||
/* add user code begin 0 */
|
||||
|
||||
/* add user code end 0 */
|
||||
|
||||
/**
|
||||
* @brief main function.
|
||||
* @param none
|
||||
* @retval none
|
||||
*/
|
||||
int main(void)
|
||||
{
|
||||
/* add user code begin 1 */
|
||||
|
||||
/* add user code end 1 */
|
||||
|
||||
/* system clock config. */
|
||||
wk_system_clock_config();
|
||||
|
||||
/* config periph clock. */
|
||||
wk_periph_clock_config();
|
||||
|
||||
/* init debug function. */
|
||||
wk_debug_config();
|
||||
|
||||
/* init pwc function. */
|
||||
wk_pwc_init();
|
||||
|
||||
/* nvic config. */
|
||||
wk_nvic_config();
|
||||
|
||||
/* init usart1 function. */
|
||||
wk_usart1_init();
|
||||
|
||||
/* init usart2 function. */
|
||||
wk_usart2_init();
|
||||
|
||||
/* init usart3 function. */
|
||||
wk_usart3_init();
|
||||
|
||||
/* init i2c1 function. */
|
||||
wk_i2c1_init();
|
||||
|
||||
/* init i2c2 function. */
|
||||
wk_i2c2_init();
|
||||
|
||||
/* init adc1 function. */
|
||||
wk_adc1_init();
|
||||
|
||||
/* init tmr8 function. */
|
||||
wk_tmr8_init();
|
||||
|
||||
/* init tmr11 function. */
|
||||
wk_tmr11_init();
|
||||
|
||||
/* init tmr12 function. */
|
||||
wk_tmr12_init();
|
||||
|
||||
/* init can1 function. */
|
||||
wk_can1_init();
|
||||
|
||||
/* init can2 function. */
|
||||
wk_can2_init();
|
||||
|
||||
/* init gpio function. */
|
||||
wk_gpio_config();
|
||||
|
||||
/* add user code begin 2 */
|
||||
DWT_Init();
|
||||
/* add user code end 2 */
|
||||
// i2c_start_generate(I2C1);
|
||||
// i2c_7bit_address_send(I2C1, 0x68, I2C_DIRECTION_TRANSMIT);
|
||||
|
||||
while (1) {
|
||||
/* add user code begin 3 */
|
||||
// usart_data_transmit(USART1, 0xEF);
|
||||
/* add user code end 3 */
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user