kopia lustrzana https://github.com/micropython/micropython
drivers/ninaw10: Add ioctl for reading analog pins.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>pull/12417/head
rodzic
7be16e0540
commit
9ed39553f2
|
@ -684,6 +684,14 @@ int nina_ioctl(uint32_t cmd, size_t len, uint8_t *buf, uint32_t iface) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case NINA_CMD_GET_ANALOG_READ: {
|
||||||
|
if (len != 2 || nina_send_command_read_vals(NINA_CMD_GET_ANALOG_READ,
|
||||||
|
1, ARG_8BITS, NINA_ARGS(ARG_BYTE(buf[0])),
|
||||||
|
1, ARG_8BITS, NINA_VALS({(uint16_t *)&len, buf})) != 0) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue