void led_thread_entry(void *pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
/* TODO: add your own code here */
while (1)
{
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_10_PIN_01, BSP_IO_LEVEL_LOW);
vTaskDelay(100);
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_10_PIN_01, BSP_IO_LEVEL_HIGH);
vTaskDelay(400);
}
}
#include "uart3_thread.h"
/* uart3_thread entry function */
/* pvParameters contains TaskHandle_t */
void uart3_thread_entry(void *pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
fsp_err_t err = FSP_SUCCESS;
err = R_SCI_B_UART_Open (&g_uart3_ctrl, &g_uart3_cfg);
assert(FSP_SUCCESS == err);
/* TODO: add your own code here */
while (1)
{
vTaskDelay(1000);
}
}
/* 发送完成标志 */
volatile bool uart_send_complete_flag = false;
/* 串口中断回调 */
void uart3_callback (uart_callback_args_t * p_args)
{
switch (p_args->event)
{
case UART_EVENT_RX_CHAR:
{
/* 把串口接收到的数据发送回去 */
R_SCI_B_UART_Write(&g_uart3_ctrl, (uint8_t *)&(p_args->data), 1);
break;
}
case UART_EVENT_TX_COMPLETE:
{
uart_send_complete_flag = true;
break;
}
default:
break;
}
}
int fputc(int ch, FILE *f)
{
(void)f;
R_SCI_B_UART_Write(&g_uart3_ctrl, (uint8_t *)&ch, 1);
while(uart_send_complete_flag == false);
uart_send_complete_flag = false;
return ch;
}
void uart3_thread_entry(void *pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
fsp_err_t err = FSP_SUCCESS;
/* 初始化串口3 */
err = R_SCI_B_UART_Open (&g_uart3_ctrl, &g_uart3_cfg);
assert(FSP_SUCCESS == err);
/* TODO: add your own code here */
while (1)
{
printf("CPU : RA8D1BH, 主频: %dMHz\r\n", SystemCoreClock / 1000000);
vTaskDelay(1000);
}
}
引用: 秦天qintian0303 发表于 2024-7-9 07:17 MDK能直接启动Renesas RA进行配置吗?
可以的