MSP430提供的USB官方例程里有一句语法看不懂?求指教!!!里面时钟具体是怎么配置的?我只看见一句话USBHAL_initClocks(8000000); // Config clocks. MCLK=SMCLK=FLL=8MHz; ACLK=REFO=32kHz,这句话如何理解???
具体程序例程见下面:
/* --COPYRIGHT--,BSD
* Copyright (c) 2014, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* * Neither the name of Texas Instruments Incorporated nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* --/COPYRIGHT--*/
/*
* ======== main.c ========
* "Simple Send"
*
* This example shows a very simplified way of sending. This might be used in
* an application where the main functionality doesn't change much if a USB
* host is present or not. It simply calls USBCDC_sendDataInBackground(); if no
* host is present, it simply carries on.
*
* Simply build, run, and attach to a USB host. Run a terminal application
* and open the COM port associated with this device. (In Windows, check the
* Device Manager.) The time should be displayed, every second.
*
* Note that this code is identical to example H9, except for one line of
* code: the call to USBCDC_sendDataInBackground() instead of
* USBHID_sendDataInBackground(). This reflects the symmetry between writing
* MSP430 code for CDC vs. HID-Datapipe.
*
*+----------------------------------------------------------------------------+
* Please refer to the MSP430 USB API Stack Programmer's Guide, located
* in the root directory of this installation for more details.
* ---------------------------------------------------------------------------*/
#include
#include "driverlib.h"
#include "USB_config/descriptors.h"
#include "USB_API/USB_Common/device.h"
#include "USB_API/USB_Common/u***.h" //USB-specific functions
#include "USB_API/USB_CDC_API/U***Cdc.h"
#include "USB_app/u***Constructs.h"
/*
* NOTE: Modify hal.h to select a specific evaluation board and customize for
* your own board.
*/
#include "hal.h"
// Function declarations
void convertTimeBinToASCII(uint8_t* timeStr);
void initRTC(void);
// Application globals
volatile uint8_t hour = 4, min = 30, sec = 00; // Real-time clock (RTC) values. 4:30:00
volatile uint8_t bSendTimeToHost = FALSE; // RTC-->main(): "send the time over USB"
uint8_t timeStr[9]; // Stores the time as an ASCII string
/*
* ======== main ========
|