Lines Matching +full:pmsg +full:- +full:size
1 /*-
28 * i2c-tiny-usb, DIY USB to IIC bridge (using AVR or RP2040) from
31 * https://github.com/harbaum/I2C-Tiny-USB
33 * https://github.com/Nicolai-Electronics/rp2040-i2c-interface
103 error = usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, &req, data, 0,
107 actlen = -1;
126 error = usbd_do_request_flags(sc->sc_udev, &sc->sc_mtx, &req, data, 0,
130 actlen = -1;
143 if (uaa->usb_mode != USB_MODE_HOST)
148 device_set_desc(dev, "I2C-Tiny-USB I2C interface");
167 sc->sc_udev = uaa->device;
168 mtx_init(&sc->sc_mtx, "i2ctinyusb lock", NULL, MTX_DEF | MTX_RECURSE);
170 sc->iicbus_dev = device_add_child(dev, "iicbus", -1);
171 if (sc->iicbus_dev == NULL) {
197 mtx_destroy(&sc->sc_mtx);
209 struct iic_msg *pmsg;
214 mtx_lock(&sc->sc_mtx);
217 pmsg = &msgs[i];
220 if (i == nmsgs - 1)
224 if ((ret = usb_read(sc, cmd, pmsg->flags, pmsg->slave, pmsg->buf,
225 pmsg->len)) != pmsg->len) {
231 if ((ret = usb_write(sc, cmd, pmsg->flags, pmsg->slave, pmsg->buf,
232 pmsg->len)) != pmsg->len) {
254 mtx_unlock(&sc->sc_mtx);
266 mtx_lock(&sc->sc_mtx);
268 mtx_unlock(&sc->sc_mtx);
293 .size = sizeof(struct i2ctinyusb_softc),