/*---------------------------------------------------------------------------------------------------------*/
/* */
/* 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] Clock output enable
* @param None;
* [url=home.php?mod=space&uid=266161]@return[/url] None
* [url=home.php?mod=space&uid=1543424]@Details[/url] P3.2 / P4.6 / P5.6 can be setting as clock out function.
*/
void main (void)
{
/* Setting P3.2 or P4.6 or P5.6 Multi function pin setting for GPIO clock out toggle
* include gipo.c in Common for GPIO mode setting
*/
MFP_P32_CLKO;
P32_PUSHPULL_MODE;
MFP_P46_CLKO;
P46_PUSHPULL_MODE;
MFP_P56_CLKO;
P56_PUSHPULL_MODE;
/*
Clock out enable setting
*/
ENABLE_CLOCK_OUT;
while(1) /*check the pin setting as clock output.*/
{
FsysSelect(FSYS_LXT);
Timer2_Delay(32768,1,1,1000);
FsysSelect(FSYS_HXT);
Timer2_Delay(110592,1,1000,1000);
}
}
|