530 #ifndef ti_drivers_PIN__include 531 #define ti_drivers_PIN__include 558 #define PIN_UNASSIGNED 0xFF 559 #define PIN_TERMINATE 0xFE 587 #define PIN_ID(x) ((x)&0xFF) 606 #define PIN_GEN (((uint32_t)1)<<31) 608 #define PIN_INPUT_EN (PIN_GEN|(0<<29)) 609 #define PIN_INPUT_DIS (PIN_GEN|(1<<29)) 610 #define PIN_HYSTERESIS (PIN_GEN|(1<<30)) 611 #define PIN_NOPULL (PIN_GEN|(0<<13)) 612 #define PIN_PULLUP (PIN_GEN|(1<<13)) 613 #define PIN_PULLDOWN (PIN_GEN|(2<<13)) 614 #define PIN_BM_INPUT_EN (1<<29) 615 #define PIN_BM_HYSTERESIS (1<<30) 616 #define PIN_BM_PULLING (0x3<<13) 618 #define PIN_BM_INPUT_MODE (PIN_BM_INPUT_EN|PIN_BM_HYSTERESIS|PIN_BM_PULLING) 621 #define PIN_GPIO_OUTPUT_DIS (PIN_GEN|(0<<23)) 622 #define PIN_GPIO_OUTPUT_EN (PIN_GEN|(1<<23)) 623 #define PIN_GPIO_LOW (PIN_GEN|(0<<22)) 624 #define PIN_GPIO_HIGH (PIN_GEN|(1<<22)) 625 #define PIN_PUSHPULL (PIN_GEN|(0<<25)) 626 #define PIN_OPENDRAIN (PIN_GEN|(2<<25)) 627 #define PIN_OPENSOURCE (PIN_GEN|(3<<25)) 628 #define PIN_SLEWCTRL (PIN_GEN|(1<<12)) 629 #define PIN_DRVSTR_MIN (PIN_GEN|(0x0<<8)) 630 #define PIN_DRVSTR_MED (PIN_GEN|(0x4<<8)) 631 #define PIN_DRVSTR_MAX (PIN_GEN|(0x8<<8)) 632 #define PIN_BM_GPIO_OUTPUT_EN (1<<23) 633 #define PIN_BM_GPIO_OUTPUT_VAL (1<<22) 634 #define PIN_BM_OUTPUT_BUF (0x3<<25) 635 #define PIN_BM_SLEWCTRL (0x1<<12) 636 #define PIN_BM_DRVSTR (0xF<<8) 638 #define PIN_BM_OUTPUT_MODE (PIN_BM_GPIO_OUTPUT_VAL|PIN_BM_GPIO_OUTPUT_EN| \ 640 PIN_BM_OUTPUT_BUF|PIN_BM_SLEWCTRL|PIN_BM_DRVSTR) 642 #define PIN_INV_INOUT (PIN_GEN|(1<<24)) 643 #define PIN_BM_INV_INOUT (1<<24) 645 #define PIN_IRQ_DIS (PIN_GEN|(0x0<<16)) 646 #define PIN_IRQ_NEGEDGE (PIN_GEN|(0x5<<16)) 647 #define PIN_IRQ_POSEDGE (PIN_GEN|(0x6<<16)) 648 #define PIN_IRQ_BOTHEDGES (PIN_GEN|(0x7<<16)) 649 #define PIN_BM_IRQ (0x7<<16) 651 #define PIN_BM_ALL (PIN_BM_INPUT_MODE|PIN_BM_OUTPUT_MODE|PIN_BM_INV_INOUT|PIN_BM_IRQ) 681 typedef void (*
PIN_IntCb)(PIN_Handle handle, PIN_Id pinId);
767 extern void PIN_close(PIN_Handle handle);
777 static inline void PIN_setUserArg(PIN_Handle handle, uintptr_t arg) {
791 static inline uintptr_t 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:687
uint8_t PIN_Id
Pin identifier data type.
Definition: PIN.h:555
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:697
uint_t PIN_getPortMask(PIN_Handle handle)
Returns bitmask indicating pins allocated to client in GPIO port.
unsigned int uint_t
Definition: PIN.h:540
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:686
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.
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:680
int int_t
Definition: PIN.h:541
uintptr_t userArg
User argument for whole handle.
Definition: PIN.h:688
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:668
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:685
PIN_Status
Return value for many functions in the PIN driver interface.
Definition: PIN.h:693
Operation succeeded.
Definition: PIN.h:694
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:696
Operation failed, some pin already allocated.
Definition: PIN.h:695
uint32_t PIN_Config
Pin configuration data type with embedded pin identifier.
Definition: PIN.h:575