| 144 | } |
| 145 | |
| 146 | void xs_digital_static_read(xsMachine *the) |
| 147 | { |
| 148 | int pin = xsmcToInteger(xsArg(0)); |
| 149 | uint8_t value; |
| 150 | modGPIOConfigurationRecord config; |
| 151 | |
| 152 | if (modGPIOInit(&config, NULL, pin, kModGPIOInput)) |
| 153 | xsUnknownError("can't init pin"); |
| 154 | |
| 155 | value = modGPIORead(&config); |
| 156 | modGPIOUninit(&config); |
| 157 | |
| 158 | if (kModGPIOReadError == value) |
| 159 | xsUnknownError("can't read pin"); |
| 160 | |
| 161 | xsmcSetInteger(xsResult, value); |
| 162 | } |
| 163 | |
| 164 | void xs_digital_static_write(xsMachine *the) |
| 165 | { |
nothing calls this directly
no test coverage detected