- /*---------------------------------------------------------------------------------------------------------*/
- /* */
- /* Copyright(c) 2019 Nuvoton Technology Corp. All rights reserved. */
- /* */
- /*---------------------------------------------------------------------------------------------------------*/
- //***********************************************************************************************************
- // Website: http://www.nuvoton.com
- // E-Mail : MicroC-8bit@nuvoton.com
- //***********************************************************************************************************
- //***********************************************************************************************************
- // File Function: ML51 simple GPIO toggle out demo code
- //***********************************************************************************************************
- #include "ML51.h"
- /**
- * [url=home.php?mod=space&uid=247401]@brief[/url] GPIO intput mode internal pull high or pull low enable
- * @param None
- * [url=home.php?mod=space&uid=266161]@return[/url] None
- * [url=home.php?mod=space&uid=1543424]@Details[/url] None.
- */
-
- void main (void)
- {
- /* Setting Multi function pin setting for GPIO toggle
- * include gipo.c in Common for GPIO mode setting
- */
- MFP_P10_GPIO;
- MFP_P15_GPIO;
- MFP_P17_GPIO;
- MFP_P23_GPIO;
- MFP_P24_GPIO;
-
- GPIO_SetMode(Port1, SET_BIT0|SET_BIT5|SET_BIT7, GPIO_MODE_INPUT);
- GPIO_SetMode(Port2, SET_BIT3|SET_BIT4, GPIO_MODE_INPUT);
-
- GPIO_Pull_Enable(Port1, SET_BIT0|SET_BIT5|SET_BIT7, PullUp);
- GPIO_Pull_Enable(Port2, SET_BIT3|SET_BIT4,PullDown);
- GPIO_Pull_Disable(Port1, SET_BIT0|SET_BIT5, PullUp);
-
- while(1);
- }
|