...
This is what the sample does
Obtain gpio to use from commandline.
GPIO_AllocSpace() is called to map GPIO-registers.
GPIO_Get_Pin(..) gets the current pin-state (i.e. low (0V)).
GPIO_Init_Pin(..) configured the pin to be an output and toggles the pin-state (i.e. high(3.3V)).
Wait 3 seconds.
GPIO_Set_Pin(..) sets the pin-state to its original value (i.e. low(0V)).
GPIO_FreeSpace() will release ressources allocated with GPIO_AllocSpace().
Download
Embedded Visual C++ Workspace for above example:
Application to set/get GPIO-level:
Code Block |
---|
Usage: gpio <gpio-number> Read GPIO-pin. gpio <gpio-number> <level> Set GPIO-pin. You might need to configure a pin as output with the below line first. gpio <gpio-number> <IsOutput> <level> Configure pin as input or output. |
...