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

Function modGPIOInit

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

Source from the content-addressed store, hash-verified

85#define kUninitializedPin (255)
86
87int modGPIOInit(modGPIOConfiguration config, const char *port, uint8_t pin, uint32_t mode)
88{
89 int result;
90
91 if ((pin > 17) || port) {
92 config->pin = kUninitializedPin;
93 return -1;
94 }
95
96 config->pin = pin;
97
98 if (pin < 16)
99 PIN_FUNC_SELECT(gPixMuxAddr[pin], c_read8(&gPixMuxValue[pin]));
100
101 result = modGPIOSetMode(config, mode);
102 if (result)
103 config->pin = kUninitializedPin;
104
105 return result;
106}
107
108void modGPIOUninit(modGPIOConfiguration config)
109{

Callers 15

xs_audiooutFunction · 0.50
xs_digitalFunction · 0.50
xs_digital_static_readFunction · 0.50
xs_digital_static_writeFunction · 0.50
xs_digital_monitorFunction · 0.50
xs_digital_monitorFunction · 0.50
owb_gpio_initializeFunction · 0.50
xs_LightMy92x1Function · 0.50
xs_ILI9341Function · 0.50
xs_co5300Function · 0.50
xs_XPT2046Function · 0.50
xs_arducamFunction · 0.50

Calls 1

modGPIOSetModeFunction · 0.70

Tested by

no test coverage detected