Embedded Application Programming Interface - picmg
Embedded Application Programming Interface - picmg Embedded Application Programming Interface - picmg
* | | | | | +-----------------------------------------------+ * | | | | | | EAPI_ID_GPIO_GPIO05 | * | | | | | +-----------------------------------------------+ * | | | | | * | | | | | 0 0 0 0 0 0 0 * | | | | +-----+-----+-----+-----+-----+-----+-----+-----+ * | | | | | Bit | Bit | Bit | Bit | Bit | Bit | Bit | Bit | * | | | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * | | | | +-----------------------------------------------+ * | | | | | EAPI_ID_GPIO_GPIO04 | * | | | | +-----------------------------------------------+ * | | | | * | | | | 0 0 0 0 0 0 0 * | | | +-----+-----+-----+-----+-----+-----+-----+-----+ * | | | | Bit | Bit | Bit | Bit | Bit | Bit | Bit | Bit | * | | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * | | | +-----------------------------------------------+ * | | | | EAPI_ID_GPIO_GPIO03 | * | | | +-----------------------------------------------+ * | | | * | | | 0 0 0 0 0 0 0 * | | +-----+-----+-----+-----+-----+-----+-----+-----+ * | | | Bit | Bit | Bit | Bit | Bit | Bit | Bit | Bit | * | | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * | | +-----------------------------------------------+ * | | | EAPI_ID_GPIO_GPIO02 | * | | +-----------------------------------------------+ * | | * | | 0 0 0 0 0 0 0 * | +-----+-----+-----+-----+-----+-----+-----+-----+ * | | Bit | Bit | Bit | Bit | Bit | Bit | Bit | Bit | * | | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * | +-----------------------------------------------+ * | | EAPI_ID_GPIO_GPIO01 | * | +-----------------------------------------------+ * | * | 0 0 0 0 0 0 0 * +-----+-----+-----+-----+-----+-----+-----+-----+ * | Bit | Bit | Bit | Bit | Bit | Bit | Bit | Bit | * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | * +-----------------------------------------------+ * | EAPI_ID_GPIO_GPIO00 | * +-----------------------------------------------+ */ /* IDs */ /* * Individual ID Per GPIO Mapping */ #define EAPI_GPIO_GPIO_ID(GPIO_NUM) EAPI_UINT32_C(GPIO_NUM) #define EAPI_GPIO_GPIO_BITMASK EAPI_UINT32_C(1) #define EAPI_ID_GPIO_GPIO00 EAPI_GPIO_GPIO_ID(0) /* (Optional) */ #define EAPI_ID_GPIO_GPIO01 EAPI_GPIO_GPIO_ID(1) /* (Optional) */ #define EAPI_ID_GPIO_GPIO02 EAPI_GPIO_GPIO_ID(2) /* (Optional) */ #define EAPI_ID_GPIO_GPIO03 EAPI_GPIO_GPIO_ID(3) /* (Optional) */ /* * Multiple GPIOs Per ID Mapping */ #define EAPI_GPIO_BANK_ID(GPIO_NUM) EAPI_UINT32_C(0x10000|((GPIO_NUM)>>5)) #define EAPI_GPIO_BANK_MASK(GPIO_NUM) EAPI_UINT32_C((1((GPIO_NUM)&0x1F))&1)==(TState)) #define EAPI_ID_GPIO_BANK00 EAPI_GPIO_BANK_ID( 0) /* GPIOs 0 - 31 * (optional) */ #define EAPI_ID_GPIO_BANK01 EAPI_GPIO_BANK_ID(32) /* GPIOs 32 - 63 * (optional) */ #define EAPI_ID_GPIO_BANK02 EAPI_GPIO_BANK_ID(64) /* GPIOs 64 - 95 * (optional) */ /* Bit mask Bit States */ PICMG® EAPI R1.0, August 8, 2010 page 70 of 83
#define EAPI_GPIO_BITMASK_SELECT 1 #define EAPI_GPIO_BITMASK_NOSELECT 0 /* Levels */ #define EAPI_GPIO_LOW 0 #define EAPI_GPIO_HIGH 1 /* Directions */ #define EAPI_GPIO_INPUT 1 #define EAPI_GPIO_OUTPUT 0 /* * EApiGPIOGetDirectionCaps * * Condition | Return Values * -----------------------------------+------------------------------ * Library Uninitialized | EAPI_STATUS_NOT_INITIALIZED * ((pOutputs==NULL)&&(pInputs==NULL))| EAPI_STATUS_INVALID_PARAMETER * Unsupported Id | EAPI_STATUS_UNSUPPORTED * Common Error | Common Error Code * Else | EAPI_STATUS_SUCCESS */ EApiStatus_t EAPI_CALLTYPE EApiGPIOGetDirectionCaps( __IN EApiId_t Id , /* GPIO Id */ __OUTOPT uint32_t *pInputs , /* Supported GPIO Input * Bit Mask */ __OUTOPT uint32_t *pOutputs /* Supported GPIO Output * Bit Mask */ ); /* * EApiGPIOGetDirection * * Condition | Return Values * -----------------------------------+------------------------------ * Library Uninitialized | EAPI_STATUS_NOT_INITIALIZED * Bitmask==0 | EAPI_STATUS_INVALID_PARAMETER * Unsupported Id | EAPI_STATUS_UNSUPPORTED * (Bitmask&~(pInputs|pOutputs)) | EAPI_STATUS_INVALID_BITMASK * Common Error | Common Error Code * Else | EAPI_STATUS_SUCCESS */ EApiStatus_t EAPI_CALLTYPE EApiGPIOGetDirection( __IN EApiId_t Id , /* GPIO Id */ __IN uint32_t Bitmask , /* Bit mask of Affected * Bits */ __OUT uint32_t *pDirection /* Current Direction */ ); /* * EApiGPIOSetDirection * * Condition | Return Values * -----------------------------------+------------------------------ * Library Uninitialized | EAPI_STATUS_NOT_INITIALIZED * Bitmask==0 | EAPI_STATUS_INVALID_PARAMETER * Unsupported Id | EAPI_STATUS_UNSUPPORTED * (Bitmask&~(pInputs|pOutputs)) | EAPI_STATUS_INVALID_BITMASK * (Bitmask&pDirection)&~pInputs | EAPI_STATUS_INVALID_DIRECTION * (Bitmask&~pDirection)&~pOutputs | EAPI_STATUS_INVALID_DIRECTION * Common Error | Common Error Code * Else | EAPI_STATUS_SUCCESS */ EApiStatus_t EAPI_CALLTYPE EApiGPIOSetDirection( __IN EApiId_t Id , /* GPIO Id */ __IN uint32_t Bitmask , /* Bit mask of Affected * Bits */ __IN uint32_t Direction /* Direction */ ); PICMG® EAPI R1.0, August 8, 2010 page 71 of 83
- Page 19 and 20: EAPI_STATUS_WRITE_ERROR Description
- Page 21 and 22: 4 EAPI Information Functions 4.1 EA
- Page 23 and 24: Id Description Units/Format EAPI_ID
- Page 25 and 26: 5.2.1 Description Returns current B
- Page 27 and 28: 5.5.1 Description Sets the brightne
- Page 29 and 30: 6.2.3 Return Status Codes Condition
- Page 31 and 32: 6.4.3 Return Status Codes Condition
- Page 33 and 34: 7.2 Address Format for the I2C Bus
- Page 35 and 36: Transfer Type 10: Address Format :
- Page 37 and 38: 7.6.1 Description Universal functio
- Page 39 and 40: 7.7.2 Parameters Id __IN See '7.1.1
- Page 41 and 42: 7.8.3 Return Status Codes Condition
- Page 43 and 44: 8 WATCHDOG After the watchdog timer
- Page 45 and 46: 8.2.1 Description Start the watchdo
- Page 47 and 48: 9 GPIO Functions COM Express specif
- Page 49 and 50: 9.2.1 Description Reads the capabil
- Page 51 and 52: 9.4 EApiGPIOSetDirection 9.4.1 Desc
- Page 53 and 54: 9.6 EApiGPIOSetLevel 9.6.1 Descript
- Page 55 and 56: #ifndef __OUT # define __OUT /* __O
- Page 57 and 58: * Use pInputs and pOutputs to corre
- Page 59 and 60: ) #define EAPI_CREATE_PNPID(a, b, c
- Page 61 and 62: * Condition | Return Values * -----
- Page 63 and 64: */ /* IDs */ #define EAPI_ID_I2C_EX
- Page 65 and 66: * StartAckNak Stop * * Transfer Typ
- Page 67 and 68: * Arbitration Error/Collision Error
- Page 69: * * G P I O * */ /* * * +----------
- Page 73 and 74: 10.2 EApiCOM0.h /* * *+============
- Page 75 and 76: #define EAPI_COM0_ID_GPIO_GPO3 EAPI
- Page 77 and 78: 12 Standard Data Formats 12.1 Compr
- Page 79 and 80: 13 OS Specific Requirements 13.1 Wi
- Page 81 and 82: Variable Name SVersion LVersion Man
- Page 83: 15 Revision History Revision Date N
#define EAPI_GPIO_BITMASK_SELECT 1<br />
#define EAPI_GPIO_BITMASK_NOSELECT 0<br />
/* Levels */<br />
#define EAPI_GPIO_LOW 0<br />
#define EAPI_GPIO_HIGH 1<br />
/* Directions */<br />
#define EAPI_GPIO_INPUT 1<br />
#define EAPI_GPIO_OUTPUT 0<br />
/*<br />
* EApiGPIOGetDirectionCaps<br />
*<br />
* Condition | Return Values<br />
* -----------------------------------+------------------------------<br />
* Library Uninitialized | EAPI_STATUS_NOT_INITIALIZED<br />
* ((pOutputs==NULL)&&(pInputs==NULL))| EAPI_STATUS_INVALID_PARAMETER<br />
* Unsupported Id | EAPI_STATUS_UNSUPPORTED<br />
* Common Error | Common Error Code<br />
* Else | EAPI_STATUS_SUCCESS<br />
*/<br />
EApiStatus_t<br />
EAPI_CALLTYPE<br />
EApiGPIOGetDirectionCaps(<br />
__IN EApiId_t Id , /* GPIO Id */<br />
__OUTOPT uint32_t *pInputs , /* Supported GPIO Input<br />
* Bit Mask<br />
*/<br />
__OUTOPT uint32_t *pOutputs /* Supported GPIO Output<br />
* Bit Mask<br />
*/<br />
);<br />
/*<br />
* EApiGPIOGetDirection<br />
*<br />
* Condition | Return Values<br />
* -----------------------------------+------------------------------<br />
* Library Uninitialized | EAPI_STATUS_NOT_INITIALIZED<br />
* Bitmask==0 | EAPI_STATUS_INVALID_PARAMETER<br />
* Unsupported Id | EAPI_STATUS_UNSUPPORTED<br />
* (Bitmask&~(pInputs|pOutputs)) | EAPI_STATUS_INVALID_BITMASK<br />
* Common Error | Common Error Code<br />
* Else | EAPI_STATUS_SUCCESS<br />
*/<br />
EApiStatus_t<br />
EAPI_CALLTYPE<br />
EApiGPIOGetDirection(<br />
__IN EApiId_t Id , /* GPIO Id */<br />
__IN uint32_t Bitmask<br />
, /* Bit mask of Affected<br />
* Bits<br />
*/<br />
__OUT uint32_t *pDirection /* Current Direction */<br />
);<br />
/*<br />
* EApiGPIOSetDirection<br />
*<br />
* Condition | Return Values<br />
* -----------------------------------+------------------------------<br />
* Library Uninitialized | EAPI_STATUS_NOT_INITIALIZED<br />
* Bitmask==0 | EAPI_STATUS_INVALID_PARAMETER<br />
* Unsupported Id | EAPI_STATUS_UNSUPPORTED<br />
* (Bitmask&~(pInputs|pOutputs)) | EAPI_STATUS_INVALID_BITMASK<br />
* (Bitmask&pDirection)&~pInputs | EAPI_STATUS_INVALID_DIRECTION<br />
* (Bitmask&~pDirection)&~pOutputs | EAPI_STATUS_INVALID_DIRECTION<br />
* Common Error | Common Error Code<br />
* Else | EAPI_STATUS_SUCCESS<br />
*/<br />
EApiStatus_t<br />
EAPI_CALLTYPE<br />
EApiGPIOSetDirection(<br />
__IN EApiId_t Id , /* GPIO Id */<br />
__IN uint32_t Bitmask<br />
, /* Bit mask of Affected<br />
* Bits<br />
*/<br />
__IN uint32_t Direction /* Direction */<br />
);<br />
PICMG® EAPI R1.0, August 8, 2010 page 71 of 83