Added basic driver example use code to the library documentation.

Made the USARTStream global public and documented in the SerialStream module, allowing for the serial USART stream to be accessed via its handle rather than via the implicit stdout and stdin streams.
This commit is contained in:
Dean Camera 2010-12-26 14:25:34 +00:00
parent 39ac72f2d1
commit 2073b96d82
18 changed files with 266 additions and 23 deletions

View file

@ -59,6 +59,30 @@
*
* For possible BOARD makefile values, see \ref Group_BoardTypes.
*
* <b>Example Usage:</b>
* \code
* // Initialise the board Joystick driver before first use
* Joystick_Init();
*
* printf("Waiting for joystick movement...\r\n");
*
* // Loop until a the joystick has been moved
* uint8_t JoystickMovement;
* while (!(JoystickMovement = Joystick_GetStatus())) {};
*
* // Display which direction the joystick was moved in
* printf("Joystick moved:\r\n");
*
* if (JoystickMovement & (JOY_UP | JOY_DOWN))
* printf("%s ", (JoystickMovement & JOY_UP) ? "Up" : "Down");
*
* if (JoystickMovement & (JOY_LEFT | JOY_RIGHT))
* printf("%s ", (JoystickMovement & JOY_LEFT) ? "Left" : "Right");
*
* if (JoystickMovement & JOY_PRESSED)
* printf("Pressed");
* \endcode
*
* @{
*/