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

C++ pigpio_command_ext函数代码示例

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

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



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

示例1: i2c_block_process_call

int i2c_block_process_call(
   int pi, unsigned handle, unsigned reg, char *buf, unsigned count)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=reg
   p3=count
   ## extension ##
   char buf[count]
   */

   ext[0].size = count;
   ext[0].ptr = buf;

   bytes = pigpio_command_ext
      (pi, PI_CMD_I2CPK, handle, reg, count, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(pi, buf, 32, bytes);
   }

   _pmu(pi);

   return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:29,代码来源:pigpiod_if2.c


示例2: spi_xfer

int spi_xfer(unsigned handle, char *txBuf, char *rxBuf, unsigned count)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=0
   p3=count
   ## extension ##
   char buf[count]
   */

   ext[0].size = count;
   ext[0].ptr = txBuf;

   bytes = pigpio_command_ext
      (gPigCommand, PI_CMD_SPIX, handle, 0, count, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(rxBuf, count, bytes);
   }

   pthread_mutex_unlock(&command_mutex);

   return bytes;
}
开发者ID:Bahamuttg,项目名称:pigpio,代码行数:28,代码来源:pigpiod_if.c


示例3: custom_2

int custom_2(unsigned arg1, char *argx, unsigned count,
             char *retBuf, uint32_t retMax)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=arg1
   p2=retMax
   p3=count
   ## extension ##
   char argx[count]
   */

   ext[0].size = count;
   ext[0].ptr = argx;

   bytes = pigpio_command_ext
      (gPigCommand, PI_CMD_CF2, arg1, retMax, count, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(retBuf, retMax, bytes);
   }

   pthread_mutex_unlock(&command_mutex);

   return bytes;
}
开发者ID:Bahamuttg,项目名称:pigpio,代码行数:29,代码来源:pigpiod_if.c


示例4: i2c_read_i2c_block_data

int i2c_read_i2c_block_data(
   unsigned handle, unsigned reg, char *buf, uint32_t count)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=reg
   p3=4
   ## extension ##
   uint32_t count
   */

   ext[0].size = sizeof(uint32_t);
   ext[0].ptr = &count;

   bytes = pigpio_command_ext
      (gPigCommand, PI_CMD_I2CRI, handle, reg, 4, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(buf, count, bytes);
   }

   pthread_mutex_unlock(&command_mutex);

   return bytes;
}
开发者ID:Bahamuttg,项目名称:pigpio,代码行数:29,代码来源:pigpiod_if.c


示例5: bb_i2c_zip

int bb_i2c_zip(
   unsigned SDA,
   char    *inBuf,
   unsigned inLen,
   char    *outBuf,
   unsigned outLen)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=SDA
   p2=0
   p3=inLen
   ## extension ##
   char inBuf[inLen]
   */

   ext[0].size = inLen;
   ext[0].ptr = inBuf;

   bytes = pigpio_command_ext
      (gPigCommand, PI_CMD_BI2CZ, SDA, 0, inLen, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(outBuf, outLen, bytes);
   }

   pthread_mutex_unlock(&command_mutex);

   return bytes;
}
开发者ID:Bahamuttg,项目名称:pigpio,代码行数:33,代码来源:pigpiod_if.c


示例6: i2c_block_process_call

int i2c_block_process_call(
   unsigned handle, unsigned reg, char *buf, unsigned count)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=reg
   p3=count
   ## extension ##
   char buf[count]
   */

   ext[0].size = count;
   ext[0].ptr = buf;

   bytes = pigpio_command_ext
      (gPigCommand, PI_CMD_I2CPK, handle, reg, count, 1, ext, 0);

   if (bytes > 0)
   {
      /* get the data */
      recv(gPigCommand, buf, bytes, MSG_WAITALL);
   }

   pthread_mutex_unlock(&command_mutex);

   return bytes;
}
开发者ID:EstebanCoto,项目名称:evok,代码行数:30,代码来源:pigpiod_if.c


示例7: wave_add_serial

int wave_add_serial(
   unsigned gpio, unsigned baud, unsigned offset, unsigned numChar, char *str)
{
   gpioExtent_t ext[3];

   /*
   p1=gpio
   p2=numChar
   ## extension ##
   unsigned baud
   unsigned offset
   char[] str
   */

   ext[0].size = sizeof(unsigned);
   ext[0].ptr = &baud;

   ext[1].size = sizeof(unsigned);
   ext[1].ptr = &offset;

   ext[2].size = numChar;
   ext[2].ptr = str;

   return pigpio_command_ext(gPigCommand, PI_CMD_WVAS, gpio, numChar, 3, ext);
}
开发者ID:Lukas-St,项目名称:Mobile-Rover,代码行数:25,代码来源:pigpiod_if.c


示例8: custom_2

int custom_2(int pi, unsigned arg1, char *argx, unsigned count,
             char *retBuf, uint32_t retMax)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=arg1
   p2=retMax
   p3=count
   ## extension ##
   char argx[count]
   */

   ext[0].size = count;
   ext[0].ptr = argx;

   bytes = pigpio_command_ext
      (pi, PI_CMD_CF2, arg1, retMax, count, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(pi, retBuf, retMax, bytes);
   }

   _pmu(pi);

   return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:29,代码来源:pigpiod_if2.c


示例9: spi_xfer

int spi_xfer(int pi, unsigned handle, char *txBuf, char *rxBuf, unsigned count)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=0
   p3=count
   ## extension ##
   char buf[count]
   */

   ext[0].size = count;
   ext[0].ptr = txBuf;

   bytes = pigpio_command_ext
      (pi, PI_CMD_SPIX, handle, 0, count, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(pi, rxBuf, count, bytes);
   }

   _pmu(pi);

   return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:28,代码来源:pigpiod_if2.c


示例10: bb_i2c_zip

int bb_i2c_zip(
   int      pi,
   unsigned SDA,
   char    *inBuf,
   unsigned inLen,
   char    *outBuf,
   unsigned outLen)
{
   int bytes;
   gpioExtent_t ext[1];

   /*
   p1=SDA
   p2=0
   p3=inLen
   ## extension ##
   char inBuf[inLen]
   */

   ext[0].size = inLen;
   ext[0].ptr = inBuf;

   bytes = pigpio_command_ext
      (pi, PI_CMD_BI2CZ, SDA, 0, inLen, 1, ext, 0);

   if (bytes > 0)
   {
      bytes = recvMax(pi, outBuf, outLen, bytes);
   }

   _pmu(pi);

   return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:34,代码来源:pigpiod_if2.c


示例11: wave_add_serial

int wave_add_serial(
   unsigned user_gpio, unsigned baud, uint32_t databits,
   uint32_t stophalfbits, uint32_t offset,  unsigned numChar, char *str)
{
   uint8_t buf[12];
   gpioExtent_t ext[2];

   /*
   p1=user_gpio
   p2=baud
   p3=len+12
   ## extension ##
   uint32_t databits
   uint32_t stophalfbits
   uint32_t offset
   char[len] str
   */

   if (!numChar) return 0;

   memcpy(buf, &databits, 4);
   memcpy(buf+4, &stophalfbits, 4);
   memcpy(buf+8, &offset, 4);

   ext[0].size = sizeof(buf);
   ext[0].ptr = buf;

   ext[1].size = numChar;
   ext[1].ptr = str;

   return pigpio_command_ext(gPigCommand, PI_CMD_WVAS,
      user_gpio, baud, numChar+sizeof(buf), 2, ext, 1);
}
开发者ID:Bahamuttg,项目名称:pigpio,代码行数:33,代码来源:pigpiod_if.c


示例12: gpio_trigger

int gpio_trigger(unsigned gpio, unsigned pulseLen, unsigned level)
{
   gpioExtent_t ext[1];
   
   /*
   p1=gpio
   p2=pulseLen
   ## extension ##
   unsigned level
   */

   ext[0].size = sizeof(level);
   ext[0].ptr = &level;

   return pigpio_command_ext(gPigCommand, PI_CMD_TRIG, gpio, pulseLen, 1, ext);
}
开发者ID:Lukas-St,项目名称:Mobile-Rover,代码行数:16,代码来源:pigpiod_if.c


示例13: wave_add_generic

int wave_add_generic(unsigned numPulses, gpioPulse_t *pulses)
{
   gpioExtent_t ext[1];
   
   /*
   p1=numPulses
   p2=0
   ## extension ##
   gpioPulse_t[] pulses
   */

   ext[0].size = numPulses * sizeof(gpioPulse_t);
   ext[0].ptr = pulses;

   return pigpio_command_ext(gPigCommand, PI_CMD_WVAG, numPulses, 0, 1, ext);
}
开发者ID:Lukas-St,项目名称:Mobile-Rover,代码行数:16,代码来源:pigpiod_if.c


示例14: run_script

int run_script(unsigned script_id, unsigned numPar, uint32_t *param)
{
   gpioExtent_t ext[1];

   /*
   p1=script id
   p2=number of parameters
   ## extension ##
   uint32_t[] parameters
   */

   ext[0].size = sizeof(uint32_t)*numPar;
   ext[0].ptr = param;

   return pigpio_command_ext
      (gPigCommand, PI_CMD_PROCR, script_id, numPar, 1, ext);
}
开发者ID:Lukas-St,项目名称:Mobile-Rover,代码行数:17,代码来源:pigpiod_if.c


示例15: i2c_write_device

int i2c_write_device(int pi, unsigned handle, char *buf, unsigned count)
{
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=0
   p3=count
   ## extension ##
   char buf[count]
   */

   ext[0].size = count;
   ext[0].ptr = buf;

   return pigpio_command_ext
      (pi, PI_CMD_I2CWD, handle, 0, count, 1, ext, 1);
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:18,代码来源:pigpiod_if2.c


示例16: set_noise_filter

int set_noise_filter(unsigned user_gpio, unsigned steady, unsigned active)
{
   gpioExtent_t ext[1];
   
   /*
   p1=user_gpio
   p2=steady
   p3=4
   ## extension ##
   unsigned active
   */

   ext[0].size = sizeof(uint32_t);
   ext[0].ptr = &active;

   return pigpio_command_ext(
      gPigCommand, PI_CMD_FN, user_gpio, steady, 4, 1, ext, 1);
}
开发者ID:Bahamuttg,项目名称:pigpio,代码行数:18,代码来源:pigpiod_if.c


示例17: i2c_write_word_data

int i2c_write_word_data(unsigned handle, unsigned reg, uint32_t val)
{
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=reg
   p3=4
   ## extension ##
   uint32_t val
   */

   ext[0].size = sizeof(uint32_t);
   ext[0].ptr = &val;

   return pigpio_command_ext
      (gPigCommand, PI_CMD_I2CWW, handle, reg, 4, 1, ext, 1);
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:18,代码来源:pigpiod_if.c


示例18: i2c_open

int i2c_open(unsigned i2c_bus, unsigned i2c_addr, uint32_t i2c_flags)
{
   gpioExtent_t ext[1];

   /*
   p1=i2c_bus
   p2=i2c_addr
   p3=4
   ## extension ##
   uint32_t i2c_flags
   */

   ext[0].size = sizeof(uint32_t);
   ext[0].ptr = &i2c_flags;

   return pigpio_command_ext
      (gPigCommand, PI_CMD_I2CO, i2c_bus, i2c_addr, 4, 1, ext, 1);
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:18,代码来源:pigpiod_if.c


示例19: i2c_process_call

int i2c_process_call(int pi, unsigned handle, unsigned reg, uint32_t val)
{
   gpioExtent_t ext[1];

   /*
   p1=handle
   p2=reg
   p3=4
   ## extension ##
   uint32_t val
   */

   ext[0].size = sizeof(uint32_t);
   ext[0].ptr = &val;

   return pigpio_command_ext
      (pi, PI_CMD_I2CPK, handle, reg, 4, 1, ext, 1);
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:18,代码来源:pigpiod_if2.c


示例20: run_script

int run_script(unsigned script_id, unsigned numPar, uint32_t *param)
{
   gpioExtent_t ext[1];

   /*
   p1=script id
   p2=0
   p3=numPar * 4
   ## extension ##
   uint32_t[numPar] pars
   */

   ext[0].size = 4 * numPar;
   ext[0].ptr = param;

   return pigpio_command_ext
      (gPigCommand, PI_CMD_PROCR, script_id, 0, numPar*4, 1, ext, 1);
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:18,代码来源:pigpiod_if.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ pil_get函数代码示例发布时间:2022-05-30
下一篇:
C++ pigpio_command函数代码示例发布时间: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