Lines Matching refs:fd
66 static int sys_write_int(int fd, int value) { in sys_write_int() argument
73 amount = write(fd, buffer, bytes); in sys_write_int()
77 static int write8reg8(int fd, uint8_t regaddr, uint8_t cmd) { in write8reg8() argument
82 if (write(fd, buf, 2) != 2) return -1; in write8reg8()
106 int const fd = open(path, O_RDWR); in writeLedArray() local
107 if (fd < 0) { in writeLedArray()
109 return fd; in writeLedArray()
111 if (ioctl(fd, I2C_SLAVE, i2c_dev_addr) < 0) { in writeLedArray()
113 close(fd); in writeLedArray()
117 write8reg8(fd, addr.red, ((color >> 16) & 0xFF)); in writeLedArray()
118 write8reg8(fd, addr.green, ((color >> 8) & 0xFF)); in writeLedArray()
119 write8reg8(fd, addr.blue, (color)&0xFF); in writeLedArray()
121 write8reg8(fd, LA_P0_ENABLE, 0x00); in writeLedArray()
122 write8reg8(fd, LA_P1_ENABLE, 0x00); in writeLedArray()
124 close(fd); in writeLedArray()
129 int fd = open(path, O_WRONLY); in writeLed() local
130 if (fd < 0) { in writeLed()
135 sys_write_int(fd, color); in writeLed()
136 close(fd); in writeLed()