本文整理汇总了C++中pigpio_command函数的典型用法代码示例。如果您正苦于以下问题:C++ pigpio_command函数的具体用法?C++ pigpio_command怎么用?C++ pigpio_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pigpio_command函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: serial_read
int serial_read(unsigned gpio, void *buf, size_t bufSize)
{
int bytes;
bytes = pigpio_command(gPigCommand, PI_CMD_SLR, gpio, bufSize);
if (bytes > 0)
{
/* get the data */
recv(gPigCommand, buf, bytes, MSG_WAITALL);
}
return bytes;
}
开发者ID:Lukas-St,项目名称:Mobile-Rover,代码行数:13,代码来源:pigpiod_if.c
示例2: i2c_read_block_data
int i2c_read_block_data(int pi, unsigned handle, unsigned reg, char *buf)
{
int bytes;
bytes = pigpio_command(pi, PI_CMD_I2CRK, handle, reg, 0);
if (bytes > 0)
{
bytes = recvMax(pi, buf, 32, bytes);
}
_pmu(pi);
return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:15,代码来源:pigpiod_if2.c
示例3: bb_serial_read
int bb_serial_read(unsigned user_gpio, void *buf, size_t bufSize)
{
int bytes;
bytes = pigpio_command(gPigCommand, PI_CMD_SLR, user_gpio, bufSize, 0);
if (bytes > 0)
{
bytes = recvMax(buf, bufSize, bytes);
}
pthread_mutex_unlock(&command_mutex);
return bytes;
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:15,代码来源:pigpiod_if.c
示例4: i2c_read_device
int i2c_read_device(unsigned handle, char *buf, unsigned count)
{
int bytes;
bytes = pigpio_command(gPigCommand, PI_CMD_I2CRD, handle, count, 0);
if (bytes > 0)
{
bytes = recvMax(buf, count, bytes);
}
pthread_mutex_unlock(&command_mutex);
return bytes;
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:15,代码来源:pigpiod_if.c
示例5: i2c_read_block_data
int i2c_read_block_data(unsigned handle, unsigned reg, char *buf)
{
int bytes;
bytes = pigpio_command(gPigCommand, PI_CMD_I2CRK, handle, reg, 0);
if (bytes > 0)
{
bytes = recvMax(buf, 32, bytes);
}
pthread_mutex_unlock(&command_mutex);
return bytes;
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:15,代码来源:pigpiod_if.c
示例6: i2c_read_device
int i2c_read_device(int pi, unsigned handle, char *buf, unsigned count)
{
int bytes;
bytes = pigpio_command(pi, PI_CMD_I2CRD, handle, count, 0);
if (bytes > 0)
{
bytes = recvMax(pi, buf, count, bytes);
}
_pmu(pi);
return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:15,代码来源:pigpiod_if2.c
示例7: bb_serial_read
int bb_serial_read(int pi, unsigned user_gpio, void *buf, size_t bufSize)
{
int bytes;
bytes = pigpio_command(pi, PI_CMD_SLR, user_gpio, bufSize, 0);
if (bytes > 0)
{
bytes = recvMax(pi, buf, bufSize, bytes);
}
_pmu(pi);
return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:15,代码来源:pigpiod_if2.c
示例8: serial_read
int serial_read(unsigned handle, char *buf, unsigned count)
{
int bytes;
bytes = pigpio_command
(gPigCommand, PI_CMD_SERR, handle, count, 0);
if (bytes > 0)
{
bytes = recvMax(buf, count, bytes);
}
pthread_mutex_unlock(&command_mutex);
return bytes;
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:16,代码来源:pigpiod_if.c
示例9: i2c_read_device
int i2c_read_device(unsigned handle, char *buf, unsigned count)
{
int bytes;
bytes = pigpio_command(gPigCommand, PI_CMD_I2CRD, handle, count, 0);
if (bytes > 0)
{
/* get the data */
recv(gPigCommand, buf, bytes, MSG_WAITALL);
}
pthread_mutex_unlock(&command_mutex);
return bytes;
}
开发者ID:EstebanCoto,项目名称:evok,代码行数:16,代码来源:pigpiod_if.c
示例10: bb_serial_read
int bb_serial_read(unsigned user_gpio, void *buf, size_t bufSize)
{
int bytes;
bytes = pigpio_command(gPigCommand, PI_CMD_SLR, user_gpio, bufSize, 0);
if (bytes > 0)
{
/* get the data */
recv(gPigCommand, buf, bytes, MSG_WAITALL);
}
pthread_mutex_unlock(&command_mutex);
return bytes;
}
开发者ID:EstebanCoto,项目名称:evok,代码行数:16,代码来源:pigpiod_if.c
示例11: i2c_read_block_data
int i2c_read_block_data(unsigned handle, unsigned reg, char *buf)
{
int bytes;
bytes = pigpio_command(gPigCommand, PI_CMD_I2CRK, handle, reg, 0);
if (bytes > 0)
{
/* get the data */
recv(gPigCommand, buf, bytes, MSG_WAITALL);
}
pthread_mutex_unlock(&command_mutex);
return bytes;
}
开发者ID:EstebanCoto,项目名称:evok,代码行数:16,代码来源:pigpiod_if.c
示例12: serial_read
int serial_read(int pi, unsigned handle, char *buf, unsigned count)
{
int bytes;
bytes = pigpio_command
(pi, PI_CMD_SERR, handle, count, 0);
if (bytes > 0)
{
bytes = recvMax(pi, buf, count, bytes);
}
_pmu(pi);
return bytes;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:16,代码来源:pigpiod_if2.c
示例13: script_status
int script_status(int script_id, uint32_t *param)
{
int status;
uint32_t p[MAX_SCRIPT_PARAMS];
status = pigpio_command(gPigCommand, PI_CMD_PROCP, script_id, 0);
if (status >= 0)
{
/* get the data */
recv(gPigCommand, p, sizeof(p), MSG_WAITALL);
if (param) memcpy(param, p, sizeof(p));
}
return status;
}
开发者ID:Lukas-St,项目名称:Mobile-Rover,代码行数:17,代码来源:pigpiod_if.c
示例14: script_status
int script_status(int pi, unsigned script_id, uint32_t *param)
{
int status;
uint32_t p[PI_MAX_SCRIPT_PARAMS+1]; /* space for script status */
status = pigpio_command(pi, PI_CMD_PROCP, script_id, 0, 0);
if (status > 0)
{
recvMax(pi, p, sizeof(p), status);
status = p[0];
if (param) memcpy(param, p+1, sizeof(p)-4);
}
_pmu(pi);
return status;
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:18,代码来源:pigpiod_if2.c
示例15: script_status
int script_status(unsigned script_id, uint32_t *param)
{
int status;
uint32_t p[PI_MAX_SCRIPT_PARAMS+1]; /* space for script status */
status = pigpio_command(gPigCommand, PI_CMD_PROCP, script_id, 0, 0);
if (status > 0)
{
recvMax(p, sizeof(p), status);
status = p[0];
if (param) memcpy(param, p+1, sizeof(p)-4);
}
pthread_mutex_unlock(&command_mutex);
return status;
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:18,代码来源:pigpiod_if.c
示例16: findNotifyBits
static void findNotifyBits(int pi)
{
callback_t *p;
uint32_t bits = 0;
p = gCallBackFirst;
while (p)
{
if (p->pi == pi) bits |= (1<<(p->gpio));
p = p->next;
}
if (bits != gNotifyBits[pi])
{
gNotifyBits[pi] = bits;
pigpio_command(pi, PI_CMD_NB, gPigHandle[pi], gNotifyBits[pi], 1);
}
}
开发者ID:Nicodus63,项目名称:Raspberry,代码行数:19,代码来源:pigpiod_if2.c
示例17: findNotifyBits
static void findNotifyBits(void)
{
callback_t *p;
uint32_t bits = 0;
p = gCallBackFirst;
while (p)
{
bits |= (1<<(p->gpio));
p = p->next;
}
if (bits != gNotifyBits)
{
gNotifyBits = bits;
pigpio_command(gPigCommand, PI_CMD_NB, gPigHandle, gNotifyBits, 1);
}
}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:19,代码来源:pigpiod_if.c
示例18: i2c_close
int i2c_close(unsigned handle)
{return pigpio_command(gPigCommand, PI_CMD_I2CC, handle, 0, 1);}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:2,代码来源:pigpiod_if.c
示例19: i2c_write_quick
int i2c_write_quick(unsigned handle, unsigned bit)
{return pigpio_command(gPigCommand, PI_CMD_I2CWQ, handle, bit, 1);}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:2,代码来源:pigpiod_if.c
示例20: i2c_write_byte
int i2c_write_byte(unsigned handle, unsigned val)
{return pigpio_command(gPigCommand, PI_CMD_I2CWS, handle, val, 1);}
开发者ID:flashspys,项目名称:Quadcopter.js,代码行数:2,代码来源:pigpiod_if.c
注:本文中的pigpio_command函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论