exports
tidrivers_cc13xx_cc26xx
source
ti
drivers
gpio
GPIOCC26XX.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015-2021, Texas Instruments Incorporated
3
* All rights reserved.
4
*
5
* Redistribution and use in source and binary forms, with or without
6
* modification, are permitted provided that the following conditions
7
* are met:
8
*
9
* * Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
*
12
* * Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
*
16
* * Neither the name of Texas Instruments Incorporated nor the names of
17
* its contributors may be used to endorse or promote products derived
18
* from this software without specific prior written permission.
19
*
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31
*/
53
#ifndef ti_drivers_GPIOCC26XX__include
54
#define ti_drivers_GPIOCC26XX__include
55
56
#include <
ti/drivers/GPIO.h
>
57
58
#include <ti/devices/DeviceFamily.h>
59
#include DeviceFamily_constructPath(inc/hw_ioc.h)
60
61
#ifdef __cplusplus
62
extern
"C"
{
63
#endif
64
65
/* Alternative mux values are defined in hw_ioc.h */
66
#define GPIO_MUX_GPIO_INTERNAL IOC_IOCFG0_PORT_ID_GPIO
67
68
/* We don't define this value on purpose - any unsupported values will cause a
69
* compile-time error. If your compiler tells you that this macro is missing,
70
* you are trying to use an unsupported option.
71
*
72
* See below for which options are unsupported.
73
*/
74
#undef GPIOCC26XX_CFG_OPTION_NOT_SUPPORTED
75
76
/* Low and high value interrupts are not available on CC26XX hardware */
77
#define GPIO_CFG_INT_LOW_INTERNAL GPIOCC26XX_CFG_OPTION_NOT_SUPPORTED
78
#define GPIO_CFG_INT_HIGH_INTERNAL GPIOCC26XX_CFG_OPTION_NOT_SUPPORTED
79
80
/* Support for DO_NOT_CONFIG would break a major initialisation optimisation */
81
#define GPIO_CFG_DO_NOT_CONFIG_INTERNAL GPIOCC26XX_CFG_OPTION_NOT_SUPPORTED
82
83
/* See GPIO.h for details about these configuration values */
84
85
/* General options remapped directly to IOC defines */
86
#define GPIO_CFG_NO_DIR_INTERNAL (IOC_IOCFG0_IOMODE_NORMAL | GPIOCC26XX_CFG_PIN_IS_INPUT_INTERNAL)
87
#define GPIO_CFG_INPUT_INTERNAL (IOC_IOCFG0_IOMODE_NORMAL | IOC_IOCFG0_IE | GPIOCC26XX_CFG_PIN_IS_INPUT_INTERNAL)
88
#define GPIO_CFG_OUTPUT_INTERNAL (IOC_IOCFG0_IOMODE_NORMAL | IOC_IOCFG0_IE | GPIOCC26XX_CFG_PIN_IS_OUTPUT_INTERNAL)
89
#define GPIO_CFG_OUTPUT_OPEN_DRAIN_INTERNAL (IOC_IOCFG0_IOMODE_OPENDR | IOC_IOCFG0_IE | GPIOCC26XX_CFG_PIN_IS_OUTPUT_INTERNAL)
90
#define GPIO_CFG_OUT_OPEN_SOURCE_INTERNAL (IOC_IOCFG0_IOMODE_OPENSRC | IOC_IOCFG0_IE | GPIOCC26XX_CFG_PIN_IS_OUTPUT_INTERNAL)
91
92
#define GPIO_CFG_PULL_NONE_INTERNAL IOC_IOCFG0_PULL_CTL_DIS
93
#define GPIO_CFG_PULL_UP_INTERNAL IOC_IOCFG0_PULL_CTL_UP
94
#define GPIO_CFG_PULL_DOWN_INTERNAL IOC_IOCFG0_PULL_CTL_DWN
95
96
#define GPIO_CFG_INT_NONE_INTERNAL IOC_IOCFG0_EDGE_DET_NONE
97
#define GPIO_CFG_INT_FALLING_INTERNAL IOC_IOCFG0_EDGE_DET_NEG
98
#define GPIO_CFG_INT_RISING_INTERNAL IOC_IOCFG0_EDGE_DET_POS
99
#define GPIO_CFG_INT_BOTH_EDGES_INTERNAL IOC_IOCFG0_EDGE_DET_BOTH
100
101
#define GPIO_CFG_INT_ENABLE_INTERNAL IOC_IOCFG0_EDGE_IRQ_EN
102
#define GPIO_CFG_INT_DISABLE_INTERNAL 0
103
104
/* Value inversion is stored in the low bit of IOMODE */
105
#define GPIO_CFG_INVERT_OFF_INTERNAL 0
106
#define GPIO_CFG_INVERT_ON_INTERNAL IOC_IOCFG0_IOMODE_INV
107
108
#define GPIO_CFG_HYSTERESIS_OFF_INTERNAL 0
109
#define GPIO_CFG_HYSTERESIS_ON_INTERNAL IOC_IOCFG0_HYST_EN
110
111
#define GPIO_CFG_SLEW_NORMAL_INTERNAL 0
112
#define GPIO_CFG_SLEW_REDUCED_INTERNAL IOC_IOCFG0_SLEW_RED
113
114
#define GPIO_CFG_DRVSTR_LOW_INTERNAL IOC_IOCFG0_IOSTR_AUTO
115
#define GPIO_CFG_DRVSTR_MED_INTERNAL IOC_IOCFG0_IOSTR_MED
116
#define GPIO_CFG_DRVSTR_HIGH_INTERNAL IOC_IOCFG0_IOSTR_MAX
117
118
/* We can hide some settings inside the MUX byte if they are not part of the
119
* IOC config, since the mux is applied separately. On CC26XX this is the
120
* lowest 8 bits.
121
*
122
* Do not use these values when calling GPIO_setConfig. They are for
123
* internal use only, to provide support for driver functionality that does
124
* not map directly into the IO config registers.
125
*/
126
#define GPIO_CFG_OUTPUT_DEFAULT_HIGH_INTERNAL 0x1
127
#define GPIO_CFG_OUTPUT_DEFAULT_LOW_INTERNAL 0
128
129
/* Whether GPIO hardware should have the output enable bit set for this pin */
130
#define GPIOCC26XX_CFG_PIN_IS_INPUT_INTERNAL 0x2
131
#define GPIOCC26XX_CFG_PIN_IS_OUTPUT_INTERNAL 0
132
133
#ifdef __cplusplus
134
}
135
#endif
136
137
#endif
/* ti_drivers_GPIOCC26XX__include */
GPIO.h
General Purpose I/O driver interface.
© Copyright 1995-2021
, Texas Instruments Incorporated. All rights reserved.
Trademarks
|
Privacy policy
|
Terms of use
|
Terms of sale