开发平台:MDK
下载器:板载jlink
开发板:FPB-RA4E1
目地:使用开发板点亮OLED,并从左向右移动。
下面开始
1、连接原理图:
2、位号图
3、Fsp配置
4.相关代码:
- 显示主代码:
- fsp_err_t err;
- /* TODO: add your own code here */
- OLED_Init();
- OLED_ShowStr(0, 0,(uint8_t *) "RA4e1", 2);
- OLED_HorizontalShift(2000);
- OLED_ShowStr(0, 15,(uint8_t *) "RA4e1", 2);
- err = R_RTC_Open(&g_rtc0_ctrl, &g_rtc0_cfg);
- /* Handle any errors. This function should be defined by the user. */
- assert(FSP_SUCCESS == err);
- /* R_RTC_CalendarTimeSet must be called at least once to start the RTC */
- R_RTC_CalendarTimeSet(&g_rtc0_ctrl, &set_time);
- /* Set the periodic interrupt rate to 1 second */
- R_RTC_PeriodicIrqRateSet(&g_rtc0_ctrl, RTC_PERIODIC_IRQ_SELECT_1_SECOND);
- OLED_RefreshRAM();
- 填充:
- <span style="white-space: normal;"><span style="white-space:pre"> </span>for(uint16_t m = 0; m < displayHeight/8; m++)</span>
- <span style="white-space: normal;"><span style="white-space:pre"> </span>{</span>
- <span style="white-space: normal;"><span style="white-space:pre"> </span>for(uint16_t n = 0; n < displayWidth; n++)</span>
- <span style="white-space: normal;"><span style="white-space:pre"> </span>{</span>
- <span style="white-space: normal;"><span style="white-space:pre"> </span>WriteDat(OLED_RAM[m][n]);</span>
- <span style="white-space: normal;"><span style="white-space:pre"> </span>}</span>
- <span style="white-space: normal;"><span style="white-space:pre"> </span>}</span>
5、显示照片: