mbed library sources

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Jul 17 09:15:10 2015 +0100
Revision:
592:a274ee790e56
Parent:
579:53297373a894
Synchronized with git revision e7144f83a8d75df80c4877936b6ffe552b0be9e6

Full URL: https://github.com/mbedmicro/mbed/commit/e7144f83a8d75df80c4877936b6ffe552b0be9e6/

More API implementation for SAMR21

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbed_official 579:53297373a894 1 /**
mbed_official 579:53297373a894 2 * \page asfdoc_sam0_port_basic_use_case Quick Start Guide for PORT - Basic
mbed_official 579:53297373a894 3 *
mbed_official 579:53297373a894 4 * In this use case, the PORT module is configured for:
mbed_official 579:53297373a894 5 * \li One pin in input mode, with pull-up enabled
mbed_official 579:53297373a894 6 * \li One pin in output mode
mbed_official 579:53297373a894 7 *
mbed_official 579:53297373a894 8 * This use case sets up the PORT to read the current state of a GPIO pin set as
mbed_official 579:53297373a894 9 * an input, and mirrors the opposite logical state on a pin configured as an
mbed_official 579:53297373a894 10 * output.
mbed_official 579:53297373a894 11 *
mbed_official 579:53297373a894 12 * \section asfdoc_sam0_port_basic_use_case_setup Setup
mbed_official 579:53297373a894 13 *
mbed_official 579:53297373a894 14 * \subsection asfdoc_sam0_port_basic_use_case_setup_prereq Prerequisites
mbed_official 579:53297373a894 15 * There are no special setup requirements for this use-case.
mbed_official 579:53297373a894 16 *
mbed_official 579:53297373a894 17 * \subsection asfdoc_sam0_port_basic_use_case_setup_code Code
mbed_official 579:53297373a894 18 * Copy-paste the following setup code to your user application:
mbed_official 579:53297373a894 19 * \snippet qs_port_basic.c setup
mbed_official 579:53297373a894 20 *
mbed_official 579:53297373a894 21 * Add to user application initialization (typically the start of \c main()):
mbed_official 579:53297373a894 22 * \snippet qs_port_basic.c setup_init
mbed_official 579:53297373a894 23 *
mbed_official 579:53297373a894 24 * \subsection asfdoc_sam0_port_basic_use_case_setup_flow Workflow
mbed_official 579:53297373a894 25 * -# Create a PORT module pin configuration struct, which can be filled out to
mbed_official 579:53297373a894 26 * adjust the configuration of a single port pin.
mbed_official 579:53297373a894 27 * \snippet qs_port_basic.c setup_1
mbed_official 579:53297373a894 28 * -# Initialize the pin configuration struct with the module's default values.
mbed_official 579:53297373a894 29 * \snippet qs_port_basic.c setup_2
mbed_official 579:53297373a894 30 * \note This should always be performed before using the configuration
mbed_official 579:53297373a894 31 * struct to ensure that all values are initialized to known default
mbed_official 579:53297373a894 32 * settings.
mbed_official 579:53297373a894 33 *
mbed_official 579:53297373a894 34 * -# Adjust the configuration struct to request an input pin.
mbed_official 579:53297373a894 35 * \snippet qs_port_basic.c setup_3
mbed_official 579:53297373a894 36 * -# Configure push button pin with the initialized pin configuration struct, to enable
mbed_official 579:53297373a894 37 * the input sampler on the pin.
mbed_official 579:53297373a894 38 * \snippet qs_port_basic.c setup_4
mbed_official 579:53297373a894 39 * -# Adjust the configuration struct to request an output pin.
mbed_official 579:53297373a894 40 * \snippet qs_port_basic.c setup_5
mbed_official 579:53297373a894 41 * \note The existing configuration struct may be re-used, as long as any
mbed_official 579:53297373a894 42 * values that have been altered from the default settings are taken
mbed_official 579:53297373a894 43 * into account by the user application.
mbed_official 579:53297373a894 44 *
mbed_official 579:53297373a894 45 * -# Configure LED pin with the initialized pin configuration struct, to enable
mbed_official 579:53297373a894 46 * the output driver on the pin.
mbed_official 579:53297373a894 47 * \snippet qs_port_basic.c setup_6
mbed_official 579:53297373a894 48 *
mbed_official 579:53297373a894 49 * \section asfdoc_sam0_port_basic_use_case_use_main Use Case
mbed_official 579:53297373a894 50 *
mbed_official 579:53297373a894 51 * \subsection asfdoc_sam0_port_basic_use_case_code Code
mbed_official 579:53297373a894 52 * Copy-paste the following code to your user application:
mbed_official 579:53297373a894 53 * \snippet qs_port_basic.c main
mbed_official 579:53297373a894 54 *
mbed_official 579:53297373a894 55 * \subsection asfdoc_sam0_port_basic_use_case_flow Workflow
mbed_official 579:53297373a894 56 * -# Read in the current input sampler state of push button pin, which has been
mbed_official 579:53297373a894 57 * configured as an input in the use-case setup code.
mbed_official 579:53297373a894 58 * \snippet qs_port_basic.c main_1
mbed_official 579:53297373a894 59 * -# Write the inverted pin level state to LED pin, which has been configured as
mbed_official 579:53297373a894 60 * an output in the use-case setup code.
mbed_official 579:53297373a894 61 * \snippet qs_port_basic.c main_2
mbed_official 579:53297373a894 62 */
mbed_official 579:53297373a894 63 /**
mbed_official 579:53297373a894 64 * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a>
mbed_official 579:53297373a894 65 */