主题中讨论的其他器件:HALCOGEN
大家好、我是一个新手。
我正在尝试使 LED 闪烁。 我使用了 Halcogen 示例、我看到它在工作。
但我想使用 Halcogen 将 hetPORT1设置为输出、而不 是 gioSetDirection (hetPORT1、0xFFFFFFFF)命令。
为了在代码中不使用 gioSetDirection 命令、我应该在 Halcogen 中采取哪些步骤?
我的代码在这里、它是 Halcogen 示例代码。
/* Include Files */
#include "sys_common.h"
#include "system.h"
/* USER CODE BEGIN (1) */
/* Include FreeRTOS scheduler files */
#include "FreeRTOS.h"
#include "os_task.h"
/* Include HET header file - types, definitions and function declarations for system driver */
#include "het.h"
#include "gio.h"
/* Define Task Handles */
xTaskHandle xTask1Handle;
/* Task1 */
void vTask1(void *pvParameters)
{
for(;;)
{
/* Taggle HET[1] with timer tick */
gioSetBit(hetPORT1, 17, gioGetBit(hetPORT1, 17) ^ 1);
vTaskDelay(100);
}
}
/* USER CODE END */
/* USER CODE BEGIN (2) */
/* USER CODE END */
void main(void)
{
/* USER CODE BEGIN (3) */
/* Set high end timer GIO port hetPort pin direction to all output */
gioSetDirection(hetPORT1, 0xFFFFFFFF); // Don't want to use this command
/* Create Task 1 */
if (xTaskCreate(vTask1,"Task1", configMINIMAL_STACK_SIZE, NULL, 1, &xTask1Handle) != pdTRUE)
{
/* Task could not be created */
while(1);
}
/* Start Scheduler */
vTaskStartScheduler();
/* Run forever */
while(1);
/* USER CODE END */
}


