MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / read

Method read

libraries/AP_HAL_ChibiOS/GPIO.cpp:238–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236
237
238uint8_t GPIO::read(uint8_t pin)
239{
240 struct gpio_entry *g = gpio_by_pin_num(pin);
241 if (g) {
242 return palReadLine(g->pal_line);
243 }
244#if HAL_WITH_IO_MCU
245 if (AP_BoardConfig::io_enabled() && iomcu.valid_GPIO_pin(pin)) {
246 return iomcu.read_virtual_GPIO(pin);
247 }
248#endif
249 return 0;
250}
251
252void GPIO::write(uint8_t pin, uint8_t value)
253{

Callers 5

_readMethod · 0.45
_storage_openMethod · 0.45
_save_backupMethod · 0.45

Calls 3

valid_GPIO_pinMethod · 0.80
read_virtual_GPIOMethod · 0.80
gpio_by_pin_numFunction · 0.70

Tested by

no test coverage detected