本帖最后由 voidpbq 于 2022-5-9 20:58 编辑
一、开箱内容
二、资料整理
这里包含了原理图、用户手册、驱动(等ide装好了再装)
原理图:https://www.rvmcu.com/app/quickstart/skins/default/doc/cm32m433r-start-sch.pdf
PS:这是我见过的非常友好的入门教程,点赞。
几个需要安装的地址我整理如下:
三、代码获取
四、led示例
代码
- // See LICENSE for license details.
- #include "main.h"
- /**
- rief main function
- param[in] none
- param[out] none
-
- etval none
- */
- int main(void)
- {
- /* USART(Printf) init */
- log_init();
- /* LED init */
- LedInit(LED1_PORT, LED1_PIN); // LED6
- LedInit(LED2_PORT, LED2_PIN); // LED7
- LedInit(LED3_PORT, LED3_PIN); // LED8
- LedOff(LED1_PORT, LED1_PIN);
- LedOff(LED2_PORT, LED2_PIN);
- LedOff(LED3_PORT, LED3_PIN);
- /* Key init */
- KeyInputInit(KEY_INPUT_PORT1, KEY_INPUT_PIN1); // WKUP Key
- KeyInputInit(KEY_INPUT_PORT2, KEY_INPUT_PIN2); // TMP Key
- KeyInputInit(KEY_INPUT_PORT3, KEY_INPUT_PIN3); // USER Key
- printf("
- USART printf & LED & Key example
- ");
- printf("
- Press the USER button, the status of LED6 will be changed
- ");
- printf("
- Press the WKUP button, the status of LED7 will be changed
- ");
- printf("
- Press the TMP button, the status of LED8 will be changed
- ");
- while(1) {
- if(RESET == KeyReadValue(KEY_INPUT_PORT3, KEY_INPUT_PIN3)) {
- delay_ms(100);
- if(RESET == KeyReadValue(KEY_INPUT_PORT3, KEY_INPUT_PIN3))
- {
- LedBlink(LED1_PORT, LED1_PIN);
- printf("
- key3 --> led1
- ");
- }
- }
- if(RESET == KeyReadValue(KEY_INPUT_PORT1, KEY_INPUT_PIN1)) {
- delay_ms(100);
- if(RESET == KeyReadValue(KEY_INPUT_PORT1, KEY_INPUT_PIN1))
- {
- LedBlink(LED2_PORT, LED2_PIN);
- printf("
- key1 --> led2
- ");
- }
- }
- if(RESET == KeyReadValue(KEY_INPUT_PORT2, KEY_INPUT_PIN2)) {
- delay_ms(100);
- if(RESET == KeyReadValue(KEY_INPUT_PORT2, KEY_INPUT_PIN2))
- {
- LedBlink(LED3_PORT, LED3_PIN);
- printf("
- key2 --> led3
- ");
- }
- }
- }
- return 0;
- }
结果
五、小结
开发环境搭建很简单,界面也很不错,期待后续开发。