gporeset.c
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:1k
- #include "string.h"
- #include "stpio.h"
- #include "gendef.h"
- #include "errors.h"
- static STPIO_Handle_t HandlePio;
- INT32 KB_SysGPOResetInit(void)
- {
- ST_ErrorCode_t error;
- STPIO_OpenParams_t OpenParams;
- /* Reset cpu by PIO0_2 */
- memset(&OpenParams, 0, sizeof(STPIO_OpenParams_t));
- OpenParams.IntHandler = NULL;
-
- /* CPU reset is active low. So PIO output should be high default,
- ** or after open the PIO, CPU will reset immediately.
- */
- OpenParams.BitConfigure[2] = STPIO_BIT_OUTPUT_HIGH;
- OpenParams.ReservedBits = PIO_BIT_2;
- error = STPIO_Open("PIO0", &OpenParams, &HandlePio);
- STTBX_Print(("KB_SysGPOResetInit PIO0_2 = %sn", KB_ErrorGetText(error)));
- return ((error == ST_NO_ERROR) ? RETOK : RETFIAL1);
- }
- void KB_SysGPOResetCpu(void)
- {
- /* CPU reset is active low. */
- STPIO_Clear(HandlePio, PIO_BIT_2);
- }
- /* EOF */