入门实践
我们这里采用CC2640R2F LaunchPad 作为实验对象,首先来看一下原理图:
板上的LEDS 分别被接在了DIO6 和DIO7上
按上一篇文章中的方法打开工程C:\ti\simplelink_cc2640r2_sdk_3_30_00_20\examples\rtos\CC2640R2_LAUNCHXL\drivers\empty
在empty.c中添加如下代码:
#include <unistd.h>
#include <stdint.h>
#include <stddef.h>
#include <ti/devices/cc26x0r2/driverlib/ioc.h>
#include <ti/drivers/GPIO.h>
/* Board Header file */
#include "Board.h"
/*
* ======== mainThread ========
*/
void *mainThread(void *arg0)
{
/* 1 second delay */
uint32_t time = 1;
unsigned char led_state=0;
GPIO_init();
while (1) {
led_state =!led_state;
sleep(time);
GPIO_write(Board
来源:CSDN
作者:Falairmicro_zheng
链接:https://blog.csdn.net/qq_21191273/article/details/104611908