RISC-V技术william hill官网
直播中

voidpbq

8年用户 131经验值
擅长:嵌入式技术,处理器/DSP
私信 关注
[经验]

【芯昇科技RISC-V生态开发板试用体验】1. 开箱及资料整理

本帖最后由 voidpbq 于 2022-5-9 20:58 编辑

一、开箱内容

开箱

二、资料整理
william hill官网

这里包含了原理图、用户手册、驱动(等ide装好了再装)
原理图:https://www.rvmcu.com/app/quickstart/skins/default/doc/cm32m433r-start-sch.pdf


PS:这是我见过的非常友好的入门教程,点赞。

几个需要安装的地址我整理如下:


三、代码获取


四、led示例


led.png

代码
  1. // See LICENSE for license details.

  2. #include "main.h"

  3. /**
  4.     rief      main function
  5.     param[in]  none
  6.     param[out] none
  7.    
  8. etval     none
  9. */
  10. int main(void)
  11. {
  12.     /* USART(Printf) init */
  13.     log_init();

  14.     /* LED init */
  15.     LedInit(LED1_PORT, LED1_PIN);  // LED6
  16.     LedInit(LED2_PORT, LED2_PIN);  // LED7
  17.     LedInit(LED3_PORT, LED3_PIN);  // LED8

  18.     LedOff(LED1_PORT, LED1_PIN);
  19.     LedOff(LED2_PORT, LED2_PIN);
  20.     LedOff(LED3_PORT, LED3_PIN);

  21.     /* Key init */
  22.     KeyInputInit(KEY_INPUT_PORT1, KEY_INPUT_PIN1);   // WKUP Key
  23.     KeyInputInit(KEY_INPUT_PORT2, KEY_INPUT_PIN2);   // TMP  Key
  24.     KeyInputInit(KEY_INPUT_PORT3, KEY_INPUT_PIN3);   // USER Key


  25.     printf("
  26. USART printf & LED & Key example
  27. ");
  28.     printf("
  29. Press the USER button, the status of LED6 will be changed
  30. ");
  31.     printf("
  32. Press the WKUP button, the status of LED7 will be changed
  33. ");
  34.     printf("
  35. Press the TMP  button, the status of LED8 will be changed
  36. ");

  37.     while(1) {

  38.         if(RESET == KeyReadValue(KEY_INPUT_PORT3, KEY_INPUT_PIN3)) {
  39.                 delay_ms(100);
  40.                 if(RESET == KeyReadValue(KEY_INPUT_PORT3, KEY_INPUT_PIN3))
  41.                 {
  42.                         LedBlink(LED1_PORT, LED1_PIN);
  43.                         printf("
  44. key3 --> led1
  45. ");
  46.                 }
  47.         }

  48.         if(RESET == KeyReadValue(KEY_INPUT_PORT1, KEY_INPUT_PIN1)) {
  49.                 delay_ms(100);
  50.                 if(RESET == KeyReadValue(KEY_INPUT_PORT1, KEY_INPUT_PIN1))
  51.                 {
  52.                         LedBlink(LED2_PORT, LED2_PIN);
  53.                         printf("
  54. key1 --> led2
  55. ");
  56.                 }

  57.         }

  58.         if(RESET == KeyReadValue(KEY_INPUT_PORT2, KEY_INPUT_PIN2)) {
  59.                 delay_ms(100);
  60.                 if(RESET == KeyReadValue(KEY_INPUT_PORT2, KEY_INPUT_PIN2))
  61.                 {
  62.                         LedBlink(LED3_PORT, LED3_PIN);
  63.                         printf("
  64. key2 --> led3
  65. ");

  66.                 }

  67.         }
  68.     }

  69.     return 0;
  70. }


结果

五、小结

开发环境搭建很简单,界面也很不错,期待后续开发。


更多回帖

发帖
×
20
完善资料,
赚取积分