Last active
August 27, 2015 18:12
-
-
Save guludo/8103d71ecbd7b82334d7 to your computer and use it in GitHub Desktop.
Example of GPIO Sysfs virtual pins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is the cpp file for your board GPIO | |
*/ | |
const unsigned LinuxGPIO_Sysfs::pin_table[] = { | |
[MYBOARD_GPIO_A] = 560, | |
[MYBOARD_GPIO_B] = 569, | |
[MYBOARD_GPIO_C] = 450, | |
[MYBOARD_GPIO_D] = 327, | |
[MYBOARD_GPIO_E] = 328 | |
}; | |
static_assert(ARRAY_SIZE(LinuxGPIO_Sysfs::pin_table) == AP_HAL::GPIO::VirtualPin::MYBOARD_GPIO_MAX, | |
"LinuxGPIO_Sysfs::pin_table is inconsistent with AP_HAL::GPIO::VirtualPin"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This is the header for your board GPIO | |
*/ | |
enum AP_HAL::GPIO::VirtualPin : uint8_t { | |
MYBOARD_GPIO_A = 0, | |
MYBOARD_GPIO_B, | |
MYBOARD_GPIO_C, | |
MYBOARD_GPIO_D, | |
MYBOARD_GPIO_E, | |
MYBOARD_GPIO_MAX | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment