530 #ifndef ti_drivers_PIN__include
531 #define ti_drivers_PIN__include
560 #define PIN_UNASSIGNED 0xFF
561 #define PIN_TERMINATE 0xFE
589 #define PIN_ID(x) ((x)&0xFF)
608 #define PIN_GEN (((uint32_t)1)<<31)
610 #define PIN_INPUT_EN (PIN_GEN|(0<<29))
611 #define PIN_INPUT_DIS (PIN_GEN|(1<<29))
612 #define PIN_HYSTERESIS (PIN_GEN|(1<<30))
613 #define PIN_NOPULL (PIN_GEN|(0<<13))
614 #define PIN_PULLUP (PIN_GEN|(1<<13))
615 #define PIN_PULLDOWN (PIN_GEN|(2<<13))
616 #define PIN_BM_INPUT_EN (1<<29)
617 #define PIN_BM_HYSTERESIS (1<<30)
618 #define PIN_BM_PULLING (0x3<<13)
620 #define PIN_BM_INPUT_MODE (PIN_BM_INPUT_EN|PIN_BM_HYSTERESIS|PIN_BM_PULLING)
623 #define PIN_GPIO_OUTPUT_DIS (PIN_GEN|(0<<23))
624 #define PIN_GPIO_OUTPUT_EN (PIN_GEN|(1<<23))
625 #define PIN_GPIO_LOW (PIN_GEN|(0<<22))
626 #define PIN_GPIO_HIGH (PIN_GEN|(1<<22))
627 #define PIN_PUSHPULL (PIN_GEN|(0<<25))
628 #define PIN_OPENDRAIN (PIN_GEN|(2<<25))
629 #define PIN_OPENSOURCE (PIN_GEN|(3<<25))
630 #define PIN_SLEWCTRL (PIN_GEN|(1<<12))
631 #define PIN_DRVSTR_MIN (PIN_GEN|(0x0<<8))
632 #define PIN_DRVSTR_MED (PIN_GEN|(0x4<<8))
633 #define PIN_DRVSTR_MAX (PIN_GEN|(0x8<<8))
634 #define PIN_BM_GPIO_OUTPUT_EN (1<<23)
635 #define PIN_BM_GPIO_OUTPUT_VAL (1<<22)
636 #define PIN_BM_OUTPUT_BUF (0x3<<25)
637 #define PIN_BM_SLEWCTRL (0x1<<12)
638 #define PIN_BM_DRVSTR (0xF<<8)
640 #define PIN_BM_OUTPUT_MODE (PIN_BM_GPIO_OUTPUT_VAL|PIN_BM_GPIO_OUTPUT_EN| \
642 PIN_BM_OUTPUT_BUF|PIN_BM_SLEWCTRL|PIN_BM_DRVSTR)
644 #define PIN_INV_INOUT (PIN_GEN|(1<<24))
645 #define PIN_BM_INV_INOUT (1<<24)
647 #define PIN_IRQ_DIS (PIN_GEN|(0x0<<16))
648 #define PIN_IRQ_NEGEDGE (PIN_GEN|(0x5<<16))
649 #define PIN_IRQ_POSEDGE (PIN_GEN|(0x6<<16))
650 #define PIN_IRQ_BOTHEDGES (PIN_GEN|(0x7<<16))
651 #define PIN_BM_IRQ (0x7<<16)
653 #define PIN_BM_ALL (PIN_BM_INPUT_MODE|PIN_BM_OUTPUT_MODE|PIN_BM_INV_INOUT|PIN_BM_IRQ)
683 typedef void (*
PIN_IntCb)(PIN_Handle handle, PIN_Id pinId);
769 extern void PIN_close(PIN_Handle handle);
779 static inline void PIN_setUserArg(PIN_Handle handle, UArg arg) {
793 static inline UArg PIN_getUserArg(PIN_Handle handle) {
PIN_Status PIN_setPortOutputValue(PIN_Handle handle, uint_t bmOutVal)
Simultaneous write output buffer values of all allocated pins in GPIO port.
uint_t bmPort
Bitmask for pins allocated in port.
Definition: PIN.h:689
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:557
uint_t PIN_getPortOutputValue(PIN_Handle handle)
Returns value of whole GPIO port's output buffers.
PIN_Status PIN_setInterrupt(PIN_Handle handle, PIN_Config pinCfg)
Control interrupt enable and edge for pin.
Operation not supported.
Definition: PIN.h:699
uint_t PIN_getPortMask(PIN_Handle handle)
Returns bitmask indicating pins allocated to client in GPIO port.
unsigned int uint_t
Definition: PIN.h:542
PIN_Status PIN_setConfig(PIN_Handle handle, PIN_Config bmMask, PIN_Config pinCfg)
Sets complete pin configuration.
PIN_IntCb pCbFunc
Pointer to interrupt callback function.
Definition: PIN.h:688
PIN_Handle PIN_open(PIN_State *pState, const PIN_Config aPinList[])
Allocate one or more pins for a driver or an application.
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.
UArg userArg
User argument for whole handle.
Definition: PIN.h:690
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:682
int int_t
Definition: PIN.h:543
PIN_Config PIN_getConfig(PIN_Id pinId)
Returns pin configuration.
uint_t PIN_getInputValue(PIN_Id pinId)
Get pin input value (0/1)
uint_t PIN_getPortInputValue(PIN_Handle handle)
Read input value of whole GPIO port.
PIN_Status PIN_registerIntCb(PIN_Handle handle, PIN_IntCb pCb)
Register callback function for a set of pins.
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:670
PIN_Status PIN_remove(PIN_Handle handle, PIN_Id pinId)
Removes pin from pin set foropen PIN handle.
PIN_Status PIN_setPortOutputEnable(PIN_Handle handle, uint_t bmOutEn)
Set output enable for all pins allocated to client in GPIO port.
PIN_Status PIN_setOutputValue(PIN_Handle handle, PIN_Id pinId, uint_t val)
Control output value for GPIO pin.
underlying data structure for type PIN_State
Definition: PIN.h:687
PIN_Status
Return value for many functions in the PIN driver interface.
Definition: PIN.h:695
Operation succeeded.
Definition: PIN.h:696
void PIN_close(PIN_Handle handle)
Deallocate all pins previously allocated with a call to PIN_open().
uint_t PIN_getOutputValue(PIN_Id pinId)
Get value of GPIO pin output buffer.
PIN_Status PIN_setOutputEnable(PIN_Handle handle, PIN_Id pinId, bool bOutEn)
Control output enable for GPIO pin.
PIN_Status PIN_clrPendInterrupt(PIN_Handle handle, PIN_Id pinId)
Clear pending interrupt for pin, if any.
Operation failed, client does not have access to pin.
Definition: PIN.h:698
Operation failed, some pin already allocated.
Definition: PIN.h:697
uint32_t PIN_Config
Pin configuration data type with embedded pin identifier.
Definition: PIN.h:577