557 #ifndef ti_drivers_PIN__include 558 #define ti_drivers_PIN__include 580 #define PIN_UNASSIGNED 0xFF 581 #define PIN_TERMINATE 0xFE 609 #define PIN_ID(x) ((x)&0xFF) 628 #define PIN_GEN (((uint32_t)1) << 31) 630 #define PIN_INPUT_EN (PIN_GEN | (0 << 29)) 631 #define PIN_INPUT_DIS (PIN_GEN | (1 << 29)) 632 #define PIN_HYSTERESIS (PIN_GEN | (1 << 30)) 633 #define PIN_NOPULL (PIN_GEN | (0 << 13)) 634 #define PIN_PULLUP (PIN_GEN | (1 << 13)) 635 #define PIN_PULLDOWN (PIN_GEN | (2 << 13)) 636 #define PIN_BM_INPUT_EN (1 << 29) 637 #define PIN_BM_HYSTERESIS (1 << 30) 638 #define PIN_BM_PULLING (0x3 << 13) 640 #define PIN_BM_INPUT_MODE (PIN_BM_INPUT_EN|PIN_BM_HYSTERESIS|PIN_BM_PULLING) 643 #define PIN_GPIO_OUTPUT_DIS (PIN_GEN | (0 << 23)) 644 #define PIN_GPIO_OUTPUT_EN (PIN_GEN | (1 << 23)) 645 #define PIN_GPIO_LOW (PIN_GEN | (0 << 22)) 646 #define PIN_GPIO_HIGH (PIN_GEN | (1 << 22)) 647 #define PIN_PUSHPULL (PIN_GEN | (0 << 25)) 648 #define PIN_OPENDRAIN (PIN_GEN | (2 << 25)) 649 #define PIN_OPENSOURCE (PIN_GEN | (3 << 25)) 650 #define PIN_SLEWCTRL (PIN_GEN | (1 << 12)) 651 #define PIN_DRVSTR_MIN (PIN_GEN | (0x0 << 8)) 652 #define PIN_DRVSTR_MED (PIN_GEN | (0x4 << 8)) 653 #define PIN_DRVSTR_MAX (PIN_GEN | (0x8 << 8)) 654 #define PIN_BM_GPIO_OUTPUT_EN (1 << 23) 655 #define PIN_BM_GPIO_OUTPUT_VAL (1 << 22) 656 #define PIN_BM_OUTPUT_BUF (0x3 << 25) 657 #define PIN_BM_SLEWCTRL (0x1 << 12) 658 #define PIN_BM_DRVSTR (0xF << 8) 660 #define PIN_BM_OUTPUT_MODE (PIN_BM_GPIO_OUTPUT_VAL | PIN_BM_GPIO_OUTPUT_EN | \ 662 PIN_BM_OUTPUT_BUF | PIN_BM_SLEWCTRL | PIN_BM_DRVSTR) 664 #define PIN_INV_INOUT (PIN_GEN | (1 << 24)) 665 #define PIN_BM_INV_INOUT (1 << 24) 667 #define PIN_IRQ_DIS (PIN_GEN | (0x0 << 16)) 668 #define PIN_IRQ_NEGEDGE (PIN_GEN | (0x5 << 16)) 669 #define PIN_IRQ_POSEDGE (PIN_GEN | (0x6 << 16)) 670 #define PIN_IRQ_BOTHEDGES (PIN_GEN | (0x7 << 16)) 671 #define PIN_BM_IRQ (0x7 << 16) 673 #define PIN_BM_ALL (PIN_BM_INPUT_MODE | PIN_BM_OUTPUT_MODE | PIN_BM_INV_INOUT | PIN_BM_IRQ) 703 typedef void (*
PIN_IntCb)(PIN_Handle handle, PIN_Id pinId);
789 extern void PIN_close(PIN_Handle handle);
799 static inline void PIN_setUserArg(PIN_Handle handle, uintptr_t arg) {
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:577
PIN_Status PIN_setInterrupt(PIN_Handle handle, PIN_Config pinCfg)
Control interrupt enable and edge for pin.
Operation not supported.
Definition: PIN.h:719
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:709
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:702
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:710
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:690
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:707
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:715
Operation succeeded.
Definition: PIN.h:716
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:718
Operation failed, some pin already allocated.
Definition: PIN.h:717
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:708
uint32_t PIN_Config
Pin configuration data type with embedded pin identifier.
Definition: PIN.h:597
static void PIN_setUserArg(PIN_Handle handle, uintptr_t arg)
Sets a user argument associated with the handle.
Definition: PIN.h:798
static uintptr_t PIN_getUserArg(PIN_Handle handle)
Gets a user argument associated with the handle.
Definition: PIN.h:812