- /*---------------------------------------------------------------------------------------------------------*/
- /* */
- /* 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 input output demo
- * @param None
- * [url=home.php?mod=space&uid=266161]@return[/url] None
- * [url=home.php?mod=space&uid=1543424]@Details[/url] GPIO toggle and UART0 TXD0 send out.
- */
-
- void main (void)
- {
- /* Enable clock out function to confirm Fsys switch result */
- MFP_P46_CLKO;
- P46_QUASI_MODE;
- ENABLE_CLOCK_OUT;
- while(1) /*check the pin setting as clock output.*/
- {
- FsysSelect(FSYS_LXT);
- Timer2_Delay(32768,1,1,1000);
- FsysSelect(FSYS_HXT);
- ClockDisable(FSYS_LXT);
- Timer2_Delay(110592,1,100,1000);
- FsysSelect(FSYS_LIRC);
- Timer2_Delay(38400,1,1,1000);
- FsysSelect(FSYS_HXT);
- Timer2_Delay(110592,1,100,1000);
- }
- }
|