久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3912|回復: 2
打印 上一主題 下一主題
收起左側

FreeRTOS+lwip for GD32450單片機源碼下載

[復制鏈接]
跳轉到指定樓層
樓主
FreeRTOS+lwip for GD32450
  This demo is based on the GD32450I-EVAL board. On the board,the Tamper key
connected to PC13 and the LED1 connected to PE2. It provides a description to
use the key to control the LED by the polling mode. The user can toggle the output
state of LED1 by pressing the Tamper key.


單片機源程序如下:
  1. /*!
  2.     \file  main.c
  3.     \brief GPIO keyboard polling demo
  4. */

  5. /*
  6.     Copyright (C) 2016 GigaDevice

  7.     2016-10-19, V1.0.0, demo for GD32F4xx
  8. */

  9. #include "gd32f4xx.h"
  10. #include "gd32f450i_eval.h"
  11. #include "systick.h"
  12. #include "stdio.h"
  13. #include "gd25qxx.h"
  14. #include "ff.h"
  15. #include "mylog.h"
  16. #include "stdlib.h"

  17. uint32_t flash_id = 0;
  18. #define SFLASH_ID                0xC84013 //0xC84015
  19. #define FLASH_WRITE_ADDRESS      0x000000
  20. #define FLASH_READ_ADDRESS       FLASH_WRITE_ADDRESS

  21. char *gpBuff = NULL;
  22. int main(void)
  23. {
  24.         int32_t i, j, is_successful;
  25.         char szItem[256];
  26.         
  27.         //gpBuff = (char *)malloc(1000);
  28.         
  29.     //gd_eval_key_init(KEY_TAMPER,KEY_MODE_GPIO);
  30.         gd_eval_key_init(KEY_TAMPER, KEY_MODE_EXTI);
  31.     systick_config();
  32.     gd_eval_gpio_init(LED1);
  33.         //gd_eval_gpio_init(BUZZER1);
  34.         //gd_eval_gpio_init(RELAY1);
  35.         gd_eval_gpio_init(WTN6170);
  36.         
  37.         gd_eval_gpio_on(LED1);
  38.         //gd_eval_gpio_off(BUZZER1);
  39.         //gd_eval_gpio_off(RELAY1);
  40.         delay_1ms(300);
  41.         //gd_eval_gpio_on(BUZZER1);
  42.         //gd_eval_gpio_on(RELAY1);
  43.         
  44.     /* USART interrupt configuration */
  45.     //nvic_irq_enable(USART0_IRQn, 0, 0);        
  46.         nvic_irq_enable(UART3_IRQn, 0, 0);        
  47.     /* configure EVAL_COM1 */
  48.         //gd_eval_com_init(EVAL_COM0);
  49.     gd_eval_com_init2(com3);
  50.     /* enable USART0 receive interrupt */
  51.     usart_interrupt_enable(EVAL_COM3, USART_INTEN_RBNEIE);
  52.     /* enable USART0 transmit interrupt */
  53.     //usart_interrupt_enable(EVAL_COM3, USART_INTEN_TBEIE);
  54.         
  55.         get_chip_serial_num();
  56.         /* output a message on hyperterminal using printf function */
  57.     LogInfo("\r\n Application start! chipID:%X%X%X SHORT:%d, INT:%d, LONG:%d, QWORD:%d\r\n", _gChipID[2], _gChipID[1], _gChipID[0],
  58.                 sizeof(short), sizeof(int), sizeof(long), sizeof(long long));
  59.         sprintf(szItem, "chipID:%X-%X-%X\r\n", _gChipID[2], _gChipID[1], _gChipID[0]);
  60.         LogInfo("%s", szItem);
  61.         
  62.     //configure SPI4 GPIO and parameter
  63.     spi_flash_init();
  64. //    /* get flash id */
  65. //    flash_id = spi_flash_read_id();
  66. //    LogInfo("\r\nThe Flash_ID:0x%X,%d\r\n\r\n", flash_id, sizeof(FATFS));

  67. //    //flash id is correct
  68. //    if(SFLASH_ID == flash_id) {
  69. //        LogInfo("\r\nWrite to tx_buffer:\r\n\r\n");

  70. //        /* printf tx_buffer value */
  71. //        for(i = 0; i < BUFFER_SIZE; i++){
  72. //            tx_buffer[i] = i;
  73. //            LogInfo("0x%02X ",tx_buffer[i]);

  74. //            if(15 == i%16)
  75. //                LogInfo("\r\n");
  76. //        }

  77. //        LogInfo("\r\nrRead from rx_buffer:\r\n\r\n");
  78. //        /* erase the specified flash sector */
  79. //        spi_flash_sector_erase(FLASH_WRITE_ADDRESS);

  80. //        /* write tx_buffer data to the flash */
  81. //        //qspi_flash_buffer_write(tx_buffer,FLASH_WRITE_ADDRESS,256);
  82. //                spi_flash_buffer_write(tx_buffer,FLASH_WRITE_ADDRESS,256);               
  83. //        delay_1ms(10);
  84. //               
  85. //        /* read a block of data from the flash to rx_buffer */
  86. //        //qspi_flash_buffer_read(rx_buffer,FLASH_READ_ADDRESS,256);
  87. //                spi_flash_buffer_read(rx_buffer,FLASH_READ_ADDRESS,256);

  88. //        /* printf rx_buffer value */
  89. //        for(i = 0; i < BUFFER_SIZE; i ++){
  90. //            LogInfo("0x%02X ", rx_buffer[i]);
  91. //            if(15 == i%16)
  92. //                LogInfo("\r\n");
  93. //        }

  94. //        if(ERROR == memory_compare(tx_buffer,rx_buffer,256)){
  95. //            LogInfo("\r\nErr:Data Read and Write aren't Matching.\r\n");
  96. //            is_successful = 1;
  97. //        }
  98. //    }else{
  99. //        /* spi flash read id fail */
  100. //        LogInfo("\r\nSPI Flash: Read ID Fail!\r\n");
  101. //    }
  102.         
  103.         //spi_flash_bulk_erase();
  104.         delay_1ms(100);
  105.         testFatfs_ram();
  106.         testFatfs_flash();
  107.         
  108.     while(1){
  109.                 gd_eval_gpio_off(UART3_CTRL);
  110. //        if(RESET == gd_eval_key_state_get(KEY_TAMPER)){
  111. //            /* delay 100ms for software removing jitter */
  112. //            delay_1ms(100);
  113. //            if(RESET == gd_eval_key_state_get(KEY_TAMPER)){
  114. //                gpio_bit_write(LED1_GPIO_PORT, LED1_PIN, (bit_status)((1 - gpio_output_bit_get(LED1_GPIO_PORT, LED1_PIN))));
  115. //            }
  116. //        }
  117.     }
  118. }

  119. /* retarget the C library printf function to the USART */
  120. int fputc(int ch, FILE *f)
  121. {
  122.         gd_eval_gpio_on(UART3_CTRL);
  123.     usart_data_transmit(EVAL_COM3, (uint8_t)ch);
  124.     while(RESET == usart_flag_get(EVAL_COM3, USART_FLAG_TBE));
  125.         //gd_eval_gpio_off(UART3_CTRL);
  126.         
  127.     return ch;
  128. }
復制代碼

所有資料51hei提供下載:
GD32450i-EVAL(20180913).rar (2.19 MB, 下載次數: 89)


分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:439931 發表于 2018-12-5 12:36 | 只看該作者
systick.c應該是移植一定要修改的一個文件。
回復

使用道具 舉報

板凳
ID:169559 發表于 2024-2-3 15:40 | 只看該作者
已下載,謝謝分享!!!
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

手機版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 看片一区 | 久久国产亚洲精品 | 欧美日一区 | 麻豆av网| 久久成人av电影 | 成人日韩精品 | 国产成人精品网站 | 亚洲免费在线观看视频 | 日韩一级黄色片 | 亚洲视频一区在线 | 国产免费福利 | 亚洲日韩第一页 | 中文字幕免费在线 | 久久精品视频99 | 欧洲av一区 | 97国产精品视频 | 伊人伊成久久人综合网站 | 欧美嘿咻 | 中文字幕av一区 | 成人一区二区在线 | 亚洲网在线 | 久久国产精品一区二区三区 | 日韩免费一区 | 91 在线| 欧美日韩在线一区 | 久久久久国产一区二区三区 | 在线观看特色大片免费网站 | 爱高潮www亚洲精品 中文字幕免费视频 | 好好的日在线视频 | 91青娱乐在线 | 久久久久亚洲精品国产 | 国产精品一区久久久 | 亚洲欧美另类在线 | 香蕉婷婷 | 日韩欧美国产一区二区三区 | 久久影院一区 | 午夜视频网 | 国产精品一区二区不卡 | 91精品国产一区二区三区 | 欧美成人自拍视频 | 欧美日韩一区在线 |