48 #include <adi_processor.h> 49 #include <adi_callback.h> 59 #pragma diag_suppress=Pm008,Pm011 67 #pragma diag_default=Pm008 78 #define ADI_GPIO_MEMORY_SIZE (16u) 122 #if defined(__ADUCM4x50__) 129 #define ADI_GPIO_PIN_0 ((ADI_GPIO_DATA)(0x0001)) 130 #define ADI_GPIO_PIN_1 ((ADI_GPIO_DATA)(0x0002)) 131 #define ADI_GPIO_PIN_2 ((ADI_GPIO_DATA)(0x0004)) 132 #define ADI_GPIO_PIN_3 ((ADI_GPIO_DATA)(0x0008)) 133 #define ADI_GPIO_PIN_4 ((ADI_GPIO_DATA)(0x0010)) 134 #define ADI_GPIO_PIN_5 ((ADI_GPIO_DATA)(0x0020)) 135 #define ADI_GPIO_PIN_6 ((ADI_GPIO_DATA)(0x0040)) 136 #define ADI_GPIO_PIN_7 ((ADI_GPIO_DATA)(0x0080)) 137 #define ADI_GPIO_PIN_8 ((ADI_GPIO_DATA)(0x0100)) 138 #define ADI_GPIO_PIN_9 ((ADI_GPIO_DATA)(0x0200)) 139 #define ADI_GPIO_PIN_10 ((ADI_GPIO_DATA)(0x0400)) 140 #define ADI_GPIO_PIN_11 ((ADI_GPIO_DATA)(0x0800)) 141 #define ADI_GPIO_PIN_12 ((ADI_GPIO_DATA)(0x1000)) 142 #define ADI_GPIO_PIN_13 ((ADI_GPIO_DATA)(0x2000)) 143 #define ADI_GPIO_PIN_14 ((ADI_GPIO_DATA)(0x4000)) 144 #define ADI_GPIO_PIN_15 ((ADI_GPIO_DATA)(0x8000)) 147 #define ADI_GPIO_PORT0_PIN_AVL (0xFFFFu) 148 #define ADI_GPIO_PORT1_PIN_AVL (0xFFFFu) 149 #define ADI_GPIO_PORT2_PIN_AVL (0xFFFFu) 151 #if defined(__ADUCM4x50__) 152 #define ADI_GPIO_PORT3_PIN_AVL (0x000Fu) 156 ADI_GPIO_RESULT
adi_gpio_Init (
void*
const pMemory, uint32_t
const MemorySize);
158 ADI_GPIO_RESULT
adi_gpio_RegisterCallback (
const ADI_GPIO_IRQ eIrq, ADI_CALLBACK
const pfCallback,
void *
const pCBParam );
164 ADI_GPIO_RESULT
adi_gpio_OutputEnable (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins,
const bool bFlag);
166 ADI_GPIO_RESULT
adi_gpio_InputEnable (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins,
const bool bFlag);
167 ADI_GPIO_RESULT
adi_gpio_PullUpEnable (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins,
const bool bFlag);
169 ADI_GPIO_RESULT
adi_gpio_SetHigh (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins);
170 ADI_GPIO_RESULT
adi_gpio_SetLow (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins);
171 ADI_GPIO_RESULT
adi_gpio_Toggle (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins);
172 ADI_GPIO_RESULT
adi_gpio_SetData (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins);
173 ADI_GPIO_RESULT
adi_gpio_GetData (
const ADI_GPIO_PORT Port,
const ADI_GPIO_DATA Pins, uint16_t*
const pValue);
175 #if defined (__ICCARM__) 176 #pragma diag_default=Pm011
ADI_GPIO_RESULT adi_gpio_GetOutputEnable(const ADI_GPIO_PORT Port, ADI_GPIO_DATA *const pValue)
Gets the Output Driver Status for GPIO Pin(s)
ADI_GPIO_IRQ_TRIGGER_CONDITION
ADI_GPIO_RESULT adi_gpio_GroupInterruptPolarityEnable(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins, const bool bFlag)
Determine if the interrupts are generated on the rising or falling edge of the corresponding GPIO pin...
ADI_GPIO_RESULT adi_gpio_SetData(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins)
Sets the logic level of all GPIO pins on the given port to a given logic level.
ADI_GPIO_RESULT adi_gpio_GetData(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins, uint16_t *const pValue)
Gets/Senses the input level of all GPIO Pins on the given port.
ADI_GPIO_RESULT adi_gpio_SetHigh(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins)
Sets the Given GPIO pin(s) to a Logical High Level.
ADI_GPIO_RESULT adi_gpio_SetLow(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins)
Sets the Given GPIO pin(s) to a Logical Low Level.
ADI_GPIO_RESULT adi_gpio_InputEnable(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins, const bool bFlag)
Enables/Disables the Input Drivers for GPIO Pin(s)
ADI_GPIO_RESULT adi_gpio_PullUpEnable(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins, const bool bFlag)
Enables/Disables the Pull-Up for GPIO Pin(s)
ADI_GPIO_RESULT adi_gpio_Init(void *const pMemory, uint32_t const MemorySize)
Initializes the GPIO functions.
ADI_GPIO_RESULT adi_gpio_Toggle(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins)
Toggles the Logical Level of the Given GPIO pin(s)
ADI_GPIO_RESULT adi_gpio_DriveStrengthEnable(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins, const bool bFlag)
Enables/Disables increased Drive Strength capability for GPIO Pin(s)
ADI_GPIO_RESULT adi_gpio_GetGroupInterruptPins(const ADI_GPIO_PORT Port, const ADI_GPIO_IRQ eIrq, ADI_GPIO_DATA *const pValue)
Get a port's pin interrupt Group A/B mask register.
ADI_GPIO_RESULT adi_gpio_GetOutputData(const ADI_GPIO_PORT Port, ADI_GPIO_DATA *const pValue)
Gets the Output Level of all GPIO Pins on a given port.
ADI_GPIO_RESULT adi_gpio_UnInit(void)
Un-initialize the GPIO driver.
ADI_GPIO_RESULT adi_gpio_OutputEnable(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins, const bool bFlag)
Enables/Disables the Output Drivers for GPIO Pin(s)
ADI_GPIO_RESULT adi_gpio_SetGroupInterruptPolarity(const ADI_GPIO_PORT Port, const ADI_GPIO_DATA Pins)
Set/clear the interrupt polarity for the given pins.
ADI_GPIO_RESULT adi_gpio_GetGroupInterruptPolarity(const ADI_GPIO_PORT Port, ADI_GPIO_DATA *const pValue)
Get a port's pin interrupt polarity register.
ADI_GPIO_RESULT adi_gpio_SetGroupInterruptPins(const ADI_GPIO_PORT Port, const ADI_GPIO_IRQ eIrq, const ADI_GPIO_DATA Pins)
Group the pins for the given group interrupt.
ADI_GPIO_RESULT adi_gpio_RegisterCallback(const ADI_GPIO_IRQ eIrq, ADI_CALLBACK const pfCallback, void *const pCBParam)
Register or unregister an application callback function for group (A/B) interrupts.