本文整理汇总了C++中pigpio_command函数的典型用法代码示例。如果您正苦于以下问题:C++ pigpio_command函数的具体用法?C++ pigpio_command怎么用?C++ pigpio_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pigpio_command函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}