spin_lock_init(&pmap->lock); ret = gpiochip_add_data(chip, pmap);if(ret <0)returnret; ret = gpiochip_add_pin_range(chip, dev_name(pmap->dev),0,0, PINS_COUNT);if(ret <0) {gpiochip_remove(chip);returnret; }return0; } 开发者ID:ReneNyffenegger,项目名称:linux,代码行数:33,代...
*/intmain(void){/* perform the needed initialization here */boardInit();while(1) {/* add your code here *//* Read TEC1 */if( !(Chip_GPIO_ReadPortBit( LPC_GPIO_PORT, TEC1_GPIO, TEC1_PIN )) ){/* Write LED with 1 */Chip_GPIO_SetPinState( LPC_GPIO_PORT, gpioLed1.gpioNumb...
generating a signal outside of this range could lead to excessive jitter that could not be acceptable for some applications. If you need to generate a signal near to the extremes of that range and have an oscilloscope at hand, always verify if the resulting signal is good enough for what ...
示例4: add_event_detect ▲点赞 1▼ defadd_event_detect(dio_number, callback):""" Wraps around theGPIO.add_event_detect function :param dio_number: DIO pin 0...5 :param callback: The function to call when the DIO triggers an IRQ. :return: None """GPIO.add_event_detect(dio_numbe...