2、跑马灯测试程序(设置一定范围的gpio)

 

 

C:\Users\LiTao\Desktop\儿童智能硬件资料\nrf51822\nRF51822EK_TM配套资料\EK_TM测试程序\跑马灯测试程序

 1 int main(void)
 2 {
 3   uint8_t output_state = 0;
 4 
 5   // Configure LED-pins as outputs
 6   nrf_gpio_range_cfg_output(LED_START, LED_STOP);//[1]
 7 
 8   while(true)
 9   {
10     nrf_gpio_port_write(LED_PORT, 1 << (output_state + LED_OFFSET));
11     output_state = (output_state + 1) & BLINKY_STATE_MASK;
12     nrf_delay_ms(100);
13   }
14 }

[1] This function can be used to configure pin range as simple output with gate driving GPIO_PIN_CNF_DRIVE_S0S1 (normal cases).
链接:http://pan.baidu.com/s/1dDtZKgL

 

posted on 2015-08-10 23:46  happy_happy  阅读(575)  评论(0)    收藏  举报