MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / modGPIORead

Function modGPIORead

modules/pins/digital/esp/modGPIO.c:178–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

176}
177
178uint8_t modGPIORead(modGPIOConfiguration config)
179{
180 if (config->pin < 16)
181 return (GPIO_REG_READ(GPIO_IN_ADDRESS) >> config->pin) & 1;
182
183 if (16 == config->pin)
184 return READ_PERI_REG(RTC_GPIO_IN_DATA) & 1;
185
186 if (17 == config->pin)
187 return system_adc_read() >= 512;
188
189 return kModGPIOReadError;
190}
191
192void modGPIOWrite(modGPIOConfiguration config, uint8_t value)
193{

Callers 13

xs_digital_readFunction · 0.50
xs_digital_static_readFunction · 0.50
xs_digital_monitor_readFunction · 0.50
digitalMonitorISRFunction · 0.50
xs_digital_monitor_readFunction · 0.50
digitalMonitorISRFunction · 0.50
_resetFunction · 0.50
_read_bitFunction · 0.50
modXpt2046.cFile · 0.50
destm32sWaitFunction · 0.50
destm32sWait_2g1rFunction · 0.50
xs_HX711_shftinFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected