563 #ifndef ti_drivers_PIN__include 564 #define ti_drivers_PIN__include 587 #define PIN_UNASSIGNED 0xFF 588 #define PIN_TERMINATE 0xFE 616 #define PIN_ID(x) ((x)&0xFF) 635 #define PIN_GEN (((uint32_t)1) << 31) 637 #define PIN_INPUT_EN (PIN_GEN | (0 << 29)) 638 #define PIN_INPUT_DIS (PIN_GEN | (1 << 29)) 639 #define PIN_HYSTERESIS (PIN_GEN | (1 << 30)) 640 #define PIN_NOPULL (PIN_GEN | (0 << 13)) 641 #define PIN_PULLUP (PIN_GEN | (1 << 13)) 642 #define PIN_PULLDOWN (PIN_GEN | (2 << 13)) 643 #define PIN_BM_INPUT_EN (1 << 29) 644 #define PIN_BM_HYSTERESIS (1 << 30) 645 #define PIN_BM_PULLING (0x3 << 13) 647 #define PIN_BM_INPUT_MODE (PIN_BM_INPUT_EN|PIN_BM_HYSTERESIS|PIN_BM_PULLING) 650 #define PIN_GPIO_OUTPUT_DIS (PIN_GEN | (0 << 23)) 651 #define PIN_GPIO_OUTPUT_EN (PIN_GEN | (1 << 23)) 652 #define PIN_GPIO_LOW (PIN_GEN | (0 << 22)) 653 #define PIN_GPIO_HIGH (PIN_GEN | (1 << 22)) 654 #define PIN_PUSHPULL (PIN_GEN | (0 << 25)) 655 #define PIN_OPENDRAIN (PIN_GEN | (2 << 25)) 656 #define PIN_OPENSOURCE (PIN_GEN | (3 << 25)) 657 #define PIN_SLEWCTRL (PIN_GEN | (1 << 12)) 658 #define PIN_DRVSTR_MIN (PIN_GEN | (0x0 << 8)) 659 #define PIN_DRVSTR_MED (PIN_GEN | (0x4 << 8)) 660 #define PIN_DRVSTR_MAX (PIN_GEN | (0x8 << 8)) 661 #define PIN_BM_GPIO_OUTPUT_EN (1 << 23) 662 #define PIN_BM_GPIO_OUTPUT_VAL (1 << 22) 663 #define PIN_BM_OUTPUT_BUF (0x3 << 25) 664 #define PIN_BM_SLEWCTRL (0x1 << 12) 665 #define PIN_BM_DRVSTR (0xF << 8) 667 #define PIN_BM_OUTPUT_MODE (PIN_BM_GPIO_OUTPUT_VAL | PIN_BM_GPIO_OUTPUT_EN | \ 669 PIN_BM_OUTPUT_BUF | PIN_BM_SLEWCTRL | PIN_BM_DRVSTR) 671 #define PIN_INV_INOUT (PIN_GEN | (1 << 24)) 672 #define PIN_BM_INV_INOUT (1 << 24) 674 #define PIN_IRQ_DIS (PIN_GEN | (0x0 << 16)) 675 #define PIN_IRQ_NEGEDGE (PIN_GEN | (0x5 << 16)) 676 #define PIN_IRQ_POSEDGE (PIN_GEN | (0x6 << 16)) 677 #define PIN_IRQ_BOTHEDGES (PIN_GEN | (0x7 << 16)) 678 #define PIN_BM_IRQ (0x7 << 16) 680 #define PIN_BM_ALL (PIN_BM_INPUT_MODE | PIN_BM_OUTPUT_MODE | PIN_BM_INV_INOUT | PIN_BM_IRQ) 710 typedef void (*
PIN_IntCb)(PIN_Handle handle, PIN_Id pinId);
796 extern void PIN_close(PIN_Handle handle);
806 static inline void PIN_setUserArg(PIN_Handle handle, uintptr_t arg) {
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:584
PIN_Status PIN_setInterrupt(PIN_Handle handle, PIN_Config pinCfg)
Control interrupt enable and edge for pin.
Operation not supported.
Definition: PIN.h:726
PIN_Status PIN_setOutputValue(PIN_Handle handle, PIN_Id pinId, uint32_t val)
Control output value for GPIO pin.
PIN_Status PIN_setPortOutputValue(PIN_Handle handle, uint32_t outputValueMask)
Simultaneous write output buffer values of all allocated pins in GPIO port.
PIN_Status PIN_setConfig(PIN_Handle handle, PIN_Config updateMask, PIN_Config pinCfg)
Sets complete pin configuration.
PIN_Status PIN_add(PIN_Handle handle, PIN_Config pinCfg)
Add pin to pin set for open PIN handle.
PIN_Status PIN_init(const PIN_Config aPinCfg[])
PIN module initialization.
uint32_t PIN_getInputValue(PIN_Id pinId)
Get pin input value (0/1)
uint32_t portMask
Bitmask for pins allocated in port.
Definition: PIN.h:716
void(* PIN_IntCb)(PIN_Handle handle, PIN_Id pinId)
I/O Interrupt callback function pointer type One PIN Interrupt callback can be registered by each PIN...
Definition: PIN.h:709
PIN_Handle PIN_open(PIN_State *state, const PIN_Config pinList[])
Allocate one or more pins for a driver or an application.
uintptr_t userArg
User argument for whole handle.
Definition: PIN.h:717
PIN_Config PIN_getConfig(PIN_Id pinId)
Returns pin configuration.
PIN_State * PIN_Handle
A handle that is returned from a PIN_open() call Used for further PIN client interaction with the PIN...
Definition: PIN.h:697
PIN_Status PIN_remove(PIN_Handle handle, PIN_Id pinId)
Removes pin from pin set foropen PIN handle.
uint32_t PIN_getPortInputValue(PIN_Handle handle)
Read input value of whole GPIO port.
underlying data structure for type PIN_State
Definition: PIN.h:714
PIN_Status PIN_setPortOutputEnable(PIN_Handle handle, uint32_t outputEnableMask)
Set output enable for all pins allocated to client in GPIO port.
PIN_Status PIN_setOutputEnable(PIN_Handle handle, PIN_Id pinId, bool outputEnable)
Control output enable for GPIO pin.
PIN_Status
Return value for many functions in the PIN driver interface.
Definition: PIN.h:722
Operation succeeded.
Definition: PIN.h:723
void PIN_close(PIN_Handle handle)
Deallocate all pins previously allocated with a call to PIN_open().
uint32_t PIN_getOutputValue(PIN_Id pinId)
Get value of GPIO pin output buffer.
uint32_t PIN_getPortOutputValue(PIN_Handle handle)
Returns value of whole GPIO port's output buffers.
PIN_Status PIN_clrPendInterrupt(PIN_Handle handle, PIN_Id pinId)
Clear pending interrupt for pin, if any.
PIN_Status PIN_registerIntCb(PIN_Handle handle, PIN_IntCb callbackFxn)
Register callback function for a set of pins.
Operation failed, client does not have access to pin.
Definition: PIN.h:725
Operation failed, some pin already allocated.
Definition: PIN.h:724
uint32_t PIN_getPortMask(PIN_Handle handle)
Returns bitmask indicating pins allocated to client in GPIO port.
PIN_IntCb callbackFxn
Pointer to interrupt callback function.
Definition: PIN.h:715
uint32_t PIN_Config
Pin configuration data type with embedded pin identifier.
Definition: PIN.h:604
static void PIN_setUserArg(PIN_Handle handle, uintptr_t arg)
Sets a user argument associated with the handle.
Definition: PIN.h:805
static uintptr_t PIN_getUserArg(PIN_Handle handle)
Gets a user argument associated with the handle.
Definition: PIN.h:819