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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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; }
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); } }
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); } }
int i2c_close(unsigned handle) {return pigpio_command(gPigCommand, PI_CMD_I2CC, handle, 0, 1);}
int i2c_write_quick(unsigned handle, unsigned bit) {return pigpio_command(gPigCommand, PI_CMD_I2CWQ, handle, bit, 1);}
int i2c_write_byte(unsigned handle, unsigned val) {return pigpio_command(gPigCommand, PI_CMD_I2CWS, handle, val, 1);}
int bb_serial_read_close(unsigned user_gpio) {return pigpio_command(gPigCommand, PI_CMD_SLRC, user_gpio, 0, 1);}
int stop_script(unsigned script_id) {return pigpio_command(gPigCommand, PI_CMD_PROCS, script_id, 0, 1);}
int delete_script(unsigned script_id) {return pigpio_command(gPigCommand, PI_CMD_PROCD, script_id, 0, 1);}
int wave_tx_stop(void) {return pigpio_command(gPigCommand, PI_CMD_WVHLT, 0, 0, 1);}
int wave_get_max_cbs(void) {return pigpio_command(gPigCommand, PI_CMD_WVSC, 2, 0, 1);}
int wave_get_high_cbs(void) {return pigpio_command(gPigCommand, PI_CMD_WVSC, 1, 0, 1);}
int wave_get_max_pulses(void) {return pigpio_command(gPigCommand, PI_CMD_WVSP, 2, 0, 1);}
int wave_get_max_micros(void) {return pigpio_command(gPigCommand, PI_CMD_WVSM, 2, 0, 1);}
int i2c_read_byte(unsigned handle) {return pigpio_command(gPigCommand, PI_CMD_I2CRS, handle, 0, 1);}
int wave_tx_busy(void) {return pigpio_command(gPigCommand, PI_CMD_WVBSY, 0, 0, 1);}