• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ PIN_SET函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中PIN_SET函数的典型用法代码示例。如果您正苦于以下问题:C++ PIN_SET函数的具体用法?C++ PIN_SET怎么用?C++ PIN_SET使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了PIN_SET函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: leds_tick

void leds_tick(void)
{
    leds_counter++;
    if( leds_open_state == LED_ON){
        PIN_SET(LED_OPEN_PIN);
    }else if( leds_open_state == LED_OFF ){
        PIN_CLEAR(LED_OPEN_PIN);
    }else if( leds_open_state == LED_SHORT_FLASH ){
        if( (leds_counter % 1024) < 50 ){
            PIN_SET(LED_OPEN_PIN);
        }else{
            PIN_CLEAR(LED_OPEN_PIN);
        }
    }

}
开发者ID:nictally,项目名称:luftschleuse2,代码行数:16,代码来源:leds.c


示例2: leds_init

void leds_init(void)
{
    DDR_CONFIG_OUT(LED_OPEN_PIN);
    PIN_SET(LED_OPEN_PIN);
    leds_open_state = LED_OFF;
    leds_counter = 0;
}
开发者ID:nictally,项目名称:luftschleuse2,代码行数:7,代码来源:leds.c


示例3: ISR

/*---------------------------------------------------------------------------*/
ISR(UNMI, unmi_interrupt)       /* user non-maskable interrupts */
{    
  ENERGEST_ON(ENERGEST_TYPE_CPU);
    
  PIN_SET(LED_ERROR);           /* use PIN_SET instead of LED_ON */
  switch (SYSUNIV) {
    case SYSUNIV_NMIIFG:        /* non-maskable interrupt */
      while(1);
      break;
    case SYSUNIV_OFIFG:         /* oscillator fault */
      WAIT_FOR_OSC();           /* try to clear the fault flag */
      break;
    case SYSUNIV_ACCVIFG:       /* Flash Memory Access Violation */
      /* will be accidentially triggered after flash programming when using
       * a voltage between 2.4 and 2.6V (errata SYS12) */
      while(1);
      break;
    case SYSUNIV_SYSBERRIV:
      while(1);
      break;
    default:
      while(1);
      break;
  }
  PIN_CLR(LED_ERROR);
  
  ENERGEST_OFF(ENERGEST_TYPE_CPU);
}
开发者ID:ETHZ-TEC,项目名称:LWB,代码行数:29,代码来源:clock.c


示例4: dcf77_init

void
dcf77_init(void)
{
  DCFDEBUG("init dcf77\n");
#ifdef DCF1_USE_PON_SUPPORT
  DCFDEBUG("PON\n");
  /* if module needs a peak on PON to enable dcf77 receiver
   * configure pin as output, set low */
  PIN_SET(DCF1_PON);
#endif

#if defined(DCF77_PCINT_PIN)
  DCFDEBUG("configure_pcint\n");
  /* configure */
  dcf77_configure_pcint();
#elif defined(DCF77_INT_PIN)
  DCFDEBUG("HAVE_DCF77_INT\n");
  /* Initialize "real" Interrupt */
  _EIMSK |= _BV(DCF77_INT_PIN);
  _EICRA = (_EICRA & ~DCF77_INT_ISCMASK) | DCF77_INT_ISC;
#else
  DCFDEBUG("Analog Comparator\n");
  // Analog Comparator init
  ACSR |= _BV(ACIE);
#endif

#ifdef DCF1_USE_PON_SUPPORT
  for (uint8_t i = 0; i < 100; i++)
  {
    wdt_kick();
    _delay_ms(10);
  }
  PIN_CLEAR(DCF1_PON);
#endif
}
开发者ID:1234tester,项目名称:ethersex,代码行数:35,代码来源:dcf77.c


示例5: rc5_send_zero

void rc5_send_zero(void)
{
    PIN_SET(RC5_SEND);
    _delay_loop_2(RC5_PULSE);
    PIN_CLEAR(RC5_SEND);
    _delay_loop_2(RC5_PULSE);
}
开发者ID:Leerzeichen,项目名称:ethersex,代码行数:7,代码来源:rc5.c


示例6: dht22_sun5i_write_bit

static void dht22_sun5i_write_bit(u8 bit) {
    if (dht22_sun5i_gpio_direction != PIN_DIR_OUT) {
        dht22_sun5i_gpio_direction = PIN_DIR_OUT;
        PIN_DIR(PIN_DIR_OUT);
    }
    PIN_SET(bit);
}
开发者ID:funordie,项目名称:a13-kernel-modules,代码行数:7,代码来源:dht22-sun5i.c


示例7: usb_init

void
usb_init(void)
{
#ifdef AUTOSET_USB_ENABLE_PIN_SUPPORT
  PIN_SET(USB_ENABLE);
#endif /* AUTOSET_USB_ENABLE_PIN_SUPPORT */
#ifdef USB_NET_SUPPORT
  usb_net_init();
#endif

#ifdef USB_KEYBOARD_SUPPORT
#endif

#define USB_DDR_CONFIG(pin)  DDR_CHAR( pin ## _PORT) &= ~(_BV((pin ## _PIN)) | _BV(USB_INT_PIN))
#define USB_PORT_CONFIG(pin)  PORT_CHAR( pin ## _PORT) &= ~(_BV((pin ## _PIN)) | _BV(USB_INT_PIN))
  USB_DDR_CONFIG(USB_DMINUS);
  USB_PORT_CONFIG(USB_DMINUS);
#undef USB_DDR_CONFIG
#undef USB_PORT_CONFIG

  uint8_t i;
  /* Reenummerate the device */
  usbDeviceDisconnect();
  for(i = 0; i < 20; i++){  /* 300 ms disconnect */
    _delay_ms(15);
    wdt_kick();
  }
  usbDeviceConnect();

  /* USB Initialize */
  usbInit();
}
开发者ID:1234tester,项目名称:ethersex,代码行数:32,代码来源:usb.c


示例8: rfm12_txstart_hard

static void
rfm12_txstart_hard(void)
{
  rfm12_status = RFM12_TX;

#ifdef STATUSLED_RFM12_TX_SUPPORT
  PIN_SET(STATUSLED_RFM12_TX);
#endif

  ACTIVITY_LED_RFM12_TX;

  rfm12_index = 0;

  rfm12_prologue(RFM12_MODULE_IP);
  rfm12_trans(RFM12_CMD_PWRMGT | RFM12_PWRMGT_ET | RFM12_PWRMGT_ES |
              RFM12_PWRMGT_EX);
  rfm12_epilogue();

  /* Force interrupts active no matter what.
   * 
   * If we're forwarding a packet from say Ethernet, uip_buf_unlock won't
   * unlock since there's an active RFM12 transfer, but it'd leave
   * the RFM12 interrupt disabled as well. */
  _uip_buf_lock = 8;
  rfm12_int_enable();
}
开发者ID:AnDann,项目名称:ethersex,代码行数:26,代码来源:rfm12_net.c


示例9: buttons_init

void buttons_init(void)
{
    DDR_CONFIG_IN(BUTTON_0);
    PIN_SET(BUTTON_0);

    DDR_CONFIG_IN(BUTTON_1);
    PIN_SET(BUTTON_1);

    DDR_CONFIG_IN(BUTTON_2);
    PIN_SET(BUTTON_2);

    buttons_0_counter = 0;
    buttons_1_counter = 0;
    buttons_2_counter = 0;
    buttons_latched_state = 0;
}
开发者ID:nictally,项目名称:luftschleuse2,代码行数:16,代码来源:buttons.c


示例10: leds_init

void leds_init(void)
{
    DDR_CONFIG_OUT(LED1); 
    DDR_CONFIG_OUT(LED2); 
    DDR_CONFIG_OUT(LED3); 
    PIN_SET(LED2);
}
开发者ID:argv,项目名称:moodlamp-rf,代码行数:7,代码来源:leds.c


示例11: hd44780_hw_init

void noinline hd44780_hw_init(void)
{
    /* init io pins */
    CTRL_OUTPUT();
#ifdef HAVE_LCDON
    PIN_SET(LCDON);
#endif

    PIN_CLEAR(HD44780_RS);
#ifndef HD44780_MULTIENSUPPORT
    PIN_CLEAR(HD44780_EN1);
#endif
#ifdef HD44780_MULTIENSUPPORT
    PIN_CLEAR(HD44780_EN1);
    PIN_CLEAR(HD44780_EN2);
#endif
#ifdef HAVE_HD44780_RW
    PIN_CLEAR(HD44780_RW);
#endif
    PIN_CLEAR(HD44780_D4);
    PIN_CLEAR(HD44780_D5);
    PIN_CLEAR(HD44780_D6);
    PIN_CLEAR(HD44780_D7);
    DATA_OUTPUT();

#ifdef HD44780_BACKLIGHT_SUPPORT
    PIN_CLEAR(HD44780_BL);
#endif
}
开发者ID:1234tester,项目名称:ethersex,代码行数:29,代码来源:hd44780.c


示例12: modbus_rxstart

uint8_t
modbus_rxstart(uint8_t *data, uint8_t len, int16_t *recv_len) {
#ifdef MODBUS_CLIENT_SUPPORT
  if (data[0] == MODBUS_ADDRESS || data[0] == MODBUS_BROADCAST) {
    modbus_client_process(data, len, recv_len);
    if (data[0] == MODBUS_ADDRESS)
      return 1;
  }
#endif
  if (modbus_data.crc_len != 0) return 0; /* There is an packet on the way */

  /* enable the transmitter */
  PIN_SET(MODBUS_TX);

  modbus_recv_len_ptr = recv_len;

  modbus_data.crc = modbus_crc_calc(data, len);
  modbus_data.crc_len = 2;

  modbus_data.data = data;
  modbus_data.len = len;

  /* Enable the tx interrupt and send the first character */
  modbus_data.sent = 1;
  usart(UCSR,B) |= _BV(usart(TXCIE));
  usart(UDR) = data[0];

  return 1;
}
开发者ID:HansBaechle,项目名称:ethersex,代码行数:29,代码来源:modbus.c


示例13: resync_led_display

void resync_led_display(void) {
  //Setzt einmal Reset
  cli();
  PIN_SET(LED_RESET); //Reset high
  gzeile = 0;
  PIN_CLEAR(LED_RESET); //Reset lo
  sei();
}
开发者ID:buttonger,项目名称:ethersex,代码行数:8,代码来源:ledmatrixint.c


示例14: init_led_display

void init_led_display(void) {
  /*Setzen der Data Direction Regiser auf Ausgang
  LED_RESET_DDR |= (1<<LED_RESET_PIN);
  LED_SELECT_DDR |= (1<<LED_SELECT_PIN);
  LED_BRIGHT_DDR |= (1<<LED_BRIGHT_PIN);
  LED_RED_DDR |= (1<<LED_RED_PIN);
  LED_GREEN_DDR |= (1<<LED_GREEN_PIN);
  LED_CLOCK_DDR |= (1<<LED_CLOCK_PIN);
  */
  TC2_COUNTER_CURRENT = 0;                    //Timer 2 Resetten
  _TIMSK_TIMER2  |= _BV(TOIE2); //Timer 2 Overflow Interrupt aktiv
  _TCCR2_PRESCALE = _BV(CS21) | _BV(CS20);  //Prescaler = 8 /32
  PIN_SET(LED_RESET);      //LED_RESET_PORT |= (1<<LED_RESET_PIN); //Reset high
  gzeile = 0;                   //beginne mit Zeile 0
  PIN_CLEAR(LED_RESET); //Reset low
  PIN_SET(LED_SELECT);     //LED_SELECT_PORT |= (1<<LED_SELECT_PIN); //Select auf high
}
开发者ID:buttonger,项目名称:ethersex,代码行数:17,代码来源:ledmatrixint.c


示例15: switch_channel_multiplex

static void switch_channel_multiplex(void)
{
#if FREQCOUNT_CHANNELS > 1
    if (freqcount_current_channel & 0x01)
        PIN_SET(FREQCOUNT_CHANNEL_MULTIPLEX_BIT1);
    else
        PIN_CLEAR(FREQCOUNT_CHANNEL_MULTIPLEX_BIT1);
#endif

#if FREQCOUNT_CHANNELS > 2
    if (freqcount_current_channel & 0x02)
        PIN_SET(FREQCOUNT_CHANNEL_MULTIPLEX_BIT2);
    else
        PIN_CLEAR(FREQCOUNT_CHANNEL_MULTIPLEX_BIT2);
#endif

#if FREQCOUNT_CHANNELS > 4
    if (freqcount_current_channel & 0x04)
        PIN_SET(FREQCOUNT_CHANNEL_MULTIPLEX_BIT3);
    else
        PIN_CLEAR(FREQCOUNT_CHANNEL_MULTIPLEX_BIT3);
#endif

#if FREQCOUNT_CHANNELS > 8
    // we have two 74xx251 multiplexers
    // they are enabled by setting the respective
    // chip select line to low
    // otherwise their output is in high-z
    if (freqcount_current_channel & 0x08)
    {
        // bit 8 set: enable multiplexer ic B
        PIN_SET(FREQCOUNT_CHANNEL_MULTIPLEX_CS_A);
        PIN_CLEAR(FREQCOUNT_CHANNEL_MULTIPLEX_CS_B);
    }
    else
    {
        // bit 8 not set: enable multiplexer ic A
        PIN_CLEAR(FREQCOUNT_CHANNEL_MULTIPLEX_CS_A);
        PIN_SET(FREQCOUNT_CHANNEL_MULTIPLEX_CS_B);
    }
#endif

#if FREQCOUNT_CHANNELS > 16
#error sorry, more than 16 frequency counter channels currently not supported
#endif
}
开发者ID:1234tester,项目名称:ethersex,代码行数:46,代码来源:freqcount_measure.c


示例16: bulbdial_clock

void
bulbdial_clock(uint8_t delay){
  struct clock_datetime_t date;
  clock_current_localtime(&date);
  clear();
  set(0x0001 << (date.sec/5));
  PIN_SET(BULBDIAL_MINUTES);
  for (uint8_t i = delay; i; i--)
    _delay_ms(1);
  PIN_CLEAR(BULBDIAL_MINUTES);
  clear();
  set(0x0001 << (date.min/5));
  PIN_SET(BULBDIAL_HOURS);
  for (uint8_t i = delay; i; i--)
    _delay_ms(1);
  PIN_CLEAR(BULBDIAL_HOURS);
}
开发者ID:EtherGraf,项目名称:ethersex,代码行数:17,代码来源:bulbdial.c


示例17: parse_cmd_matemat_cooling

int16_t parse_cmd_matemat_cooling(char *cmd, char *output, uint16_t len)
/* {{{ */ {
    if(cmd[1] == '1')
        PIN_SET(MATEMAT_COOLER);
    if(cmd[1] == '0')
        PIN_CLEAR(MATEMAT_COOLER);
    return 0;
} /* }}} */
开发者ID:muccc,项目名称:matemat,代码行数:8,代码来源:matemat.c


示例18: fs20_send_zero

void fs20_send_zero(void)
{
  PIN_SET(FS20_SEND);
  _delay_loop_2(FS20_DELAY_ZERO);
  PIN_CLEAR(FS20_SEND);
  _delay_loop_2(FS20_DELAY_ZERO);

}
开发者ID:HansBaechle,项目名称:ethersex,代码行数:8,代码来源:fs20.c


示例19: constrain

void Stepper::setSpeed(int16_t _speed){	
	speed += constrain((_speed-speed), -(int16_t)maxAccel, (int16_t)maxAccel);
    if(speed == 0)
		period = 0;
	else
		period = MAX_SPEED/abs(speed);
	(speed>0) ? PIN_CLR(dirPin) : PIN_SET(dirPin);
}
开发者ID:Microduino,项目名称:BalanceCar_Microduino,代码行数:8,代码来源:StepperDriver.cpp


示例20: hd44780_backlight

void
hd44780_backlight(uint8_t state)
{
  hd44780_backlight_state = state;

#ifdef HD44780_BACKLIGHT_INV
  if (hd44780_backlight_state)
    PIN_CLEAR(HD44780_BL);
  else
    PIN_SET(HD44780_BL);
#else
  if (hd44780_backlight_state)
    PIN_SET(HD44780_BL);
  else
    PIN_CLEAR(HD44780_BL);
#endif
}
开发者ID:AnDann,项目名称:ethersex,代码行数:17,代码来源:hd44780.c



注:本文中的PIN_SET函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ PIN_StartProgram函数代码示例发布时间:2022-05-30
下一篇:
C++ PIN_InitSymbols函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap