1 /******************************************************************************
2 *  Filename:       gpio_doc.h
3 *
4 *  Copyright (c) 2015 - 2022, Texas Instruments Incorporated
5 *  All rights reserved.
6 *
7 *  Redistribution and use in source and binary forms, with or without
8 *  modification, are permitted provided that the following conditions are met:
9 *
10 *  1) Redistributions of source code must retain the above copyright notice,
11 *     this list of conditions and the following disclaimer.
12 *
13 *  2) Redistributions in binary form must reproduce the above copyright notice,
14 *     this list of conditions and the following disclaimer in the documentation
15 *     and/or other materials provided with the distribution.
16 *
17 *  3) Neither the name of the ORGANIZATION nor the names of its contributors may
18 *     be used to endorse or promote products derived from this software without
19 *     specific prior written permission.
20 *
21 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
25 *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31 *  POSSIBILITY OF SUCH DAMAGE.
32 *
33 ******************************************************************************/
34 //! \addtogroup gpio_api
35 //! @{
36 //! \section sec_gpio Introduction
37 //!
38 //! The GPIO module allows software to control the pins of the device directly if the IOC module has
39 //! been configured to route the GPIO signal to a physical pin (called DIO). Alternatively, pins can
40 //! be hardware controlled by other peripheral modules. For more information about the IOC module,
41 //! how to configure physical pins, and how to select between software controlled and hardware controlled,
42 //! see the [IOC API](\ref ioc_api).
43 //!
44 //! The System CPU can access the GPIO module to read the value of any DIO of the device and if the IOC
45 //! module has been configured such that one or more DIOs are GPIO controlled (software controlled) the
46 //! System CPU can write these DIOs through the GPIO module.
47 //!
48 //! The IOC module can also be configured to generate events on edge detection and these events can be
49 //! read and cleared in the GPIO module by the System CPU.
50 //!
51 //! \section sec_gpio_api API
52 //!
53 //! The API functions can be grouped like this:
54 //!
55 //! Set and get direction of DIO (output enable):
56 //! - \ref GPIO_setOutputEnableDio()
57 //! - \ref GPIO_getOutputEnableDio()
58 //!
59 //! Write DIO (requires IOC to be configured for GPIO usage):
60 //! - \ref GPIO_writeDio()
61 //!
62 //! Set, clear, or toggle DIO (requires IOC to be configured for GPIO usage):
63 //! - \ref GPIO_setDio()
64 //! - \ref GPIO_clearDio()
65 //! - \ref GPIO_toggleDio()
66 //!
67 //! Read DIO (even if IOC is NOT configured for GPIO usage; however, the DIO must be configured for input enable in IOC):
68 //! - \ref GPIO_readDio()
69 //!
70 //! Read or clear events (even if IOC is NOT configured for GPIO usage; however, the DIO must be configured for input enable in IOC):
71 //! - \ref GPIO_getEventDio()
72 //! - \ref GPIO_clearEventDio()
73 //!
74 //! The [IOC API](\ref ioc_api) provides two functions for easy configuration of DIOs as GPIO enabled using
75 //! typical settings. They also serve as examples on how to configure the IOC and GPIO modules for GPIO usage:
76 //! - \ref IOCPinTypeGpioInput()
77 //! - \ref IOCPinTypeGpioOutput()
78 //!
79 //! @}
80