Ignore:
Timestamp:
Mar 28, 2016, 2:09:46 PM (8 years ago)
Author:
ertl-honda
Message:

ライブラリを Arduino IDE 1.7.9 にupdate

Location:
rtos_arduino/trunk/arduino_lib/libraries
Files:
83 added
9 edited

Legend:

Unmodified
Added
Removed
  • rtos_arduino/trunk/arduino_lib/libraries/NAxesMotion/NAxisMotion.h

    r136 r175  
    137137        *Return Parameter: None
    138138        *******************************************************************************************/
    139 #if defined(ARDUINO_ARCH_SAMD)
    140         void initSensor(unsigned int address = 0x29);
    141 #else /* !defined(ARDUINO_ARCH_SAMD) */   
    142139        void initSensor(unsigned int address = 0x28);
    143 #endif /* defined(ARDUINO_ARCH_SAMD) */ 
    144140
    145141        /*******************************************************************************************
  • rtos_arduino/trunk/arduino_lib/libraries/RTC/examples/ALARM_interrupt/ALARM_interrupt.ino

    r136 r175  
    33This mode is more conveniently because you use processor for other tasks and when alarm match occurs interrupt routine is executed.
    44In this way, alarm flag checking is indipendent from main program flow.
     5
     6NOTE: for M0/M0 pro only you can select the oscillator source for count.
     7If you want to use a low power oscillator use rtc.begin(TIME_H24, LOW_POWER); function.
     8If you want to use a more accurate oscillator use rtc.begin(TIME_H24, HIGH_PRECISION); function.
    59******************************************************************************************************************************************************************************/
    610
     
    1822  rtc.setDate(13,8,15);     //setting date
    1923  rtc.enableAlarm(SEC,ALARM_INTERRUPT,alarm_int); //enabling alarm in polled mode and match on second
    20   rtc.local_time.hour=17;
    21   rtc.local_time.minute=5;
    22   rtc.local_time.second=10;  //setting second to match
     24  rtc.time.hour=17;
     25  rtc.time.minute=5;
     26  rtc.time.second=10;  //setting second to match
    2327  rtc.setAlarm();  //write second in alarm register
    2428}
  • rtos_arduino/trunk/arduino_lib/libraries/RTC/examples/ALARM_polled/ALARM_polled.ino

    r136 r175  
    22* This sketch demonstrates how configure alarm in polled mode.
    33  In this mode you hav to check continuously ALARM0 flag in the main program code.
     4 
     5  NOTE: for M0/M0 pro only you can select the oscillator source for count.
     6If you want to use a low power oscillator use rtc.begin(TIME_H24, LOW_POWER); function.
     7If you want to use a more accurate oscillator use rtc.begin(TIME_H24, HIGH_PRECISION); function.
    48*********************************************************************************************************************************************************************************/ 
    59
     
    1721  rtc.setDate(13,8,15);     //setting date
    1822  rtc.enableAlarm(SEC,ALARM_POLLED,NULL); //enabling alarm in polled mode and match on second
    19   rtc.local_time.hour=17;
    20   rtc.local_time.minute=5;
    21   rtc.local_time.second=10;  //setting second to match
     23  rtc.time.hour=17;
     24  rtc.time.minute=5;
     25  rtc.time.second=10;  //setting second to match
    2226  rtc.setAlarm();  //write second in alarm register
    2327}
  • rtos_arduino/trunk/arduino_lib/libraries/RTC/examples/RTC_simple/RTC_simple.ino

    r136 r175  
    22This sketch gives a simple demonstration of how to use RTC library.
    33The code sets date and time using internal structure and then print on serial date and time. Time representation is 12 hour mode
     4
     5NOTE: for M0/M0 pro only you can select the oscillator source for count.
     6If you want to use a low power oscillator use rtc.begin(TIME_H12, LOW_POWER); function.
     7If you want to use a more accurate oscillator use rtc.begin(TIME_H12, HIGH_PRECISION); function.
    48**********************************************************************************************************************************************************/
    59
     
    1721 
    1822  //filling internal structure for time
    19   rtc.local_time.hour = 10;          //hour
    20   rtc.local_time.minute = 44;       //minute
    21   rtc.local_time.second = 0;        //second
    22   rtc.local_time.Tmode = ANTI_MERIDIAN; 
     23  rtc.time.hour = 10;          //hour
     24  rtc.time.minute = 44;       //minute
     25  rtc.time.second = 0;        //second
     26  rtc.time.Tmode = ANTI_MERIDIAN; 
    2327 
    2428  //filling internal structure for date
    25   rtc.local_date.day = 13;        //day
    26   rtc.local_date.month = 8;       //month
    27   rtc.local_date.year = 15;       //year
     29  rtc.date.day = 13;        //day
     30  rtc.date.month = 8;       //month
     31  rtc.date.year = 15;       //year
    2832 
    2933  rtc.setTime();  //setting time
     
    4246 
    4347 //printing date in format YYYY/MM/DD
    44  Serial.print(rtc.local_date.year+2000); // year
     48 Serial.print(rtc.date.year+2000); // year
    4549 Serial.print('/');
    46  Serial.print(rtc.local_date.month);    // month
     50 Serial.print(rtc.date.month);    // month
    4751 Serial.print('/');
    48  Serial.print(rtc.local_date.day);      // day
     52 Serial.print(rtc.date.day);      // day
    4953 Serial.print(' ');
    5054 
    5155 //printing time
    52  Serial.print(rtc.local_time.hour);    //hour
     56 Serial.print(rtc.time.hour);    //hour
    5357 Serial.print(':');
    54  Serial.print(rtc.local_time.minute);  //minute
     58 Serial.print(rtc.time.minute);  //minute
    5559 Serial.print(':');
    56  Serial.print(rtc.local_time.second);  //second
     60 Serial.print(rtc.time.second);  //second
    5761 Serial.print (' ');
    58  if(rtc.local_time.Tmode == ANTI_MERIDIAN) Serial.println("AM"); // print AM or PM
     62 if(rtc.time.Tmode == ANTI_MERIDIAN) Serial.println("AM"); // print AM or PM
    5963 else Serial.println("PM");
    6064 
  • rtos_arduino/trunk/arduino_lib/libraries/RTC/examples/RTC_simple_24H_mode/RTC_simple_24H_mode.ino

    r136 r175  
    22This sketch gives a simple demonstration of how to use RTC library.
    33The code sets date and time using internal structure and then print on serial date and time. Time representation is 24 hour mode
     4
     5NOTE: for M0/M0 pro only you can select the oscillator source for count.
     6If you want to use a low power oscillator use rtc.begin(TIME_H24, LOW_POWER); function.
     7If you want to use a more accurate oscillator use rtc.begin(TIME_H24, HIGH_PRECISION); function.
    48**********************************************************************************************************************************************************/
    59
     
    3438 
    3539 //printing date in format YYYY/MM/DD
    36  Serial.print(rtc.local_date.year+2000); // year
     40 Serial.print(rtc.date.year+2000); // year
    3741 Serial.print('/');
    38  Serial.print(rtc.local_date.month);    // month
     42 Serial.print(rtc.date.month);    // month
    3943 Serial.print('/');
    40  Serial.print(rtc.local_date.day);      // day
     44 Serial.print(rtc.date.day);      // day
    4145 Serial.print(' ');
    4246 
    4347 //printing time
    44  Serial.print(rtc.local_time.hour);    //hour
     48 Serial.print(rtc.time.hour);    //hour
    4549 Serial.print(':');
    46  Serial.print(rtc.local_time.minute);  //minute
     50 Serial.print(rtc.time.minute);  //minute
    4751 Serial.print(':');
    48  Serial.println(rtc.local_time.second);  //second
     52 Serial.println(rtc.time.second);  //second
    4953 
    5054 delay(1000);
  • rtos_arduino/trunk/arduino_lib/libraries/RTC/src/RTCInt.cpp

    r136 r175  
    22  RTC library for Arduino M0/M0PRO.
    33  Copyright (c) 2015 Arduino SRL. All right reserved.
    4 
    54  This library is free software; you can redistribute it and/or
    65  modify it under the terms of the GNU Lesser General Public
    76  License as published by the Free Software Foundation; either
    87  version 2.1 of the License, or (at your option) any later version.
    9 
    108  This library is distributed in the hope that it will be useful,
    119  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1210  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    1311  Lesser General Public License for more details.
    14 
    1512  You should have received a copy of the GNU Lesser General Public
    1613  License along with this library; if not, write to the Free Software
     
    2825*Return Parameter: None
    2926*******************************************************************************************/
    30 void RTCInt::begin(bool timeRep)
     27void RTCInt::begin(bool timeRep, int oscillatorType)
    3128{
    3229 
     
    3734  while (GCLK->STATUS.bit.SYNCBUSY);
    3835 
    39   GCLK->GENCTRL.reg = (GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_OSCULP32K | GCLK_GENCTRL_ID(4) | GCLK_GENCTRL_DIVSEL );
     36  //Set the oscillator to use - M0 only
     37  if(oscillatorType==HIGH_PRECISION)
     38  //External oscillator
     39  GCLK->GENCTRL.reg = (GCLK_GENCTRL_GENEN | GCLK_GENCTRL_SRC_XOSC32K | GCLK_GENCTRL_ID(4) | GCLK_GENCTRL_DIVSEL );
     40 
     41  else
     42  //Internal low power oscillator (default configuration)
     43  GCLK->GENCTRL.reg = (GCLK_GENCTRL_GENEN |  GCLK_GENCTRL_SRC_OSCULP32K | GCLK_GENCTRL_ID(4) | GCLK_GENCTRL_DIVSEL );
     44 
    4045  while (GCLK->STATUS.reg & GCLK_STATUS_SYNCBUSY);
    4146 
     
    7378  RTCenable();
    7479 
     80}
     81
     82void RTCInt::begin(bool timeRep){
     83    begin(timeRep, LOW_POWER);
    7584}
    7685
     
    132141
    133142/**********************************************************************************************************************
    134 *Description: Function for getting time (hours, minutes and seconds). This function fills a structure called local_time
     143*Description: Function for getting time (hours, minutes and seconds). This function fills a structure called time
    135144                          accessible in the class RTCInt.       
    136145*Input Parameters: None
     
    141150        unsigned int hour=0, h=0;
    142151       
    143         local_time.hour = getHour();
     152        time.hour = getHour();
    144153        if(time_Mode == TIME_H12)
    145154        {
    146155                h=RTC->MODE2.CLOCK.bit.HOUR;
    147156                while (RTCSync());
    148                 local_time.Tmode = h & 0x10;
     157                time.Tmode = h & 0x10;
    149158        }       
    150         local_time.minute = getMinute();
    151         local_time.second = getSecond();
     159        time.minute = getMinute();
     160        time.second = getSecond();
    152161}
    153162
     
    219228
    220229/**********************************************************************************************************************
    221 *Description: Function for getting date (day, month and year). This function fills a structure called local_date
     230*Description: Function for getting date (day, month and year). This function fills a structure called date
    222231                          accessible in the class RTCInt.       
    223232*Input Parameters: None
     
    226235void RTCInt::getDate(void)
    227236{
    228         local_date.day = getDay();
    229         local_date.month = getMonth();
    230         local_date.year = getYear();
     237        date.day = getDay();
     238        date.month = getMonth();
     239        date.year = getYear();
    231240}
    232241
     
    315324/**********************************************************************************************************************
    316325*Description: Function for setting time (hour, minute and second). This function sets time retrieving values from a
    317                           local structure called local_time accessible in the class RTCInt.     
     326                          local structure called time accessible in the class RTCInt.   
    318327*Input Parameters: None
    319328*Return Parameter: None
     
    321330void RTCInt::setTime(void)
    322331{
    323         setHour(local_time.hour,local_time.Tmode);
    324     setMinute(local_time.minute);
    325     setSecond(local_time.second); 
     332        setHour(time.hour,time.Tmode);
     333    setMinute(time.minute);
     334    setSecond(time.second); 
    326335}
    327336
     
    397406/**********************************************************************************************************************
    398407*Description: Function for setting date (day, month and year). This function retrieves values from a local structure
    399                           called local_date accessible in the class RTCInt.     
     408                          called date accessible in the class RTCInt.   
    400409*Input Parameters: None
    401410*Return Parameter: None
     
    403412void RTCInt::setDate(void)
    404413{
    405         setDay(local_date.day);
    406         setMonth(local_date.month); 
    407     setYear(local_date.year);
     414        setDay(date.day);
     415        setMonth(date.month); 
     416    setYear(date.year);
    408417}
    409418
     
    461470 /**********************************************************************************************************************
    462471*Description: Function for setting alarm. This function retrieves values from two local structures
    463                           called local_date and local_time accessible in the class RTCInt. According to match alarm type, values
    464                           can be obtained from local_time, local_date or both structures.       
     472                          called date and time accessible in the class RTCInt. According to match alarm type, values
     473                          can be obtained from time, date or both structures.   
    465474*Input Parameters: None
    466475*Return Parameter: None
     
    474483      break;
    475484   case SEC :
    476           RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= local_time.second;
     485          RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= time.second;
    477486          while (RTCSync());
    478487          break;       
    479488   case MMSS :
    480       RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= local_time.minute;
    481           while (RTCSync());
    482           RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= local_time.second;
     489      RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= time.minute;
     490          while (RTCSync());
     491          RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= time.second;
    483492          while (RTCSync());
    484493          break;
    485494   case HHMMSS :
    486       RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= local_time.hour;
    487           while (RTCSync());
    488           RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= local_time.minute;
    489           while (RTCSync());
    490           RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= local_time.second;
     495      RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= time.hour;
     496          while (RTCSync());
     497          RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= time.minute;
     498          while (RTCSync());
     499          RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= time.second;
    491500          while (RTCSync());
    492501      break;
    493502   case DDHHMMSS :
    494       RTC->MODE2.Mode2Alarm->ALARM.bit.DAY= local_date.day;
    495           while (RTCSync());
    496           RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= local_time.hour;
    497           while (RTCSync());
    498           RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= local_time.minute;
    499           while (RTCSync());
    500           RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= local_time.second;
     503      RTC->MODE2.Mode2Alarm->ALARM.bit.DAY= date.day;
     504          while (RTCSync());
     505          RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= time.hour;
     506          while (RTCSync());
     507          RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= time.minute;
     508          while (RTCSync());
     509          RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= time.second;
    501510          while (RTCSync());
    502511      break;
    503512   case MMDDHHMMSS :
    504       RTC->MODE2.Mode2Alarm->ALARM.bit.MONTH= local_date.month;
    505           while (RTCSync());
    506           RTC->MODE2.Mode2Alarm->ALARM.bit.DAY= local_date.day;
    507           while (RTCSync());
    508           RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= local_time.hour;
    509           while (RTCSync());
    510           RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= local_time.minute;
    511           while (RTCSync());
    512           RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= local_time.second;
     513      RTC->MODE2.Mode2Alarm->ALARM.bit.MONTH= date.month;
     514          while (RTCSync());
     515          RTC->MODE2.Mode2Alarm->ALARM.bit.DAY= date.day;
     516          while (RTCSync());
     517          RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= time.hour;
     518          while (RTCSync());
     519          RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= time.minute;
     520          while (RTCSync());
     521          RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= time.second;
    513522          while (RTCSync());
    514523      break;
    515524   case YYMMDDHHMMSS :
    516       RTC->MODE2.Mode2Alarm->ALARM.bit.YEAR= local_date.year;
    517           while (RTCSync());
    518           RTC->MODE2.Mode2Alarm->ALARM.bit.MONTH= local_date.month;
    519           while (RTCSync());
    520           RTC->MODE2.Mode2Alarm->ALARM.bit.DAY= local_date.day;
    521           while (RTCSync());
    522           RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= local_time.hour;
    523           while (RTCSync());
    524           RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= local_time.minute;
    525           while (RTCSync());
    526           RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= local_time.second;
     525      RTC->MODE2.Mode2Alarm->ALARM.bit.YEAR= date.year;
     526          while (RTCSync());
     527          RTC->MODE2.Mode2Alarm->ALARM.bit.MONTH= date.month;
     528          while (RTCSync());
     529          RTC->MODE2.Mode2Alarm->ALARM.bit.DAY= date.day;
     530          while (RTCSync());
     531          RTC->MODE2.Mode2Alarm->ALARM.bit.HOUR= time.hour;
     532          while (RTCSync());
     533          RTC->MODE2.Mode2Alarm->ALARM.bit.MINUTE= time.minute;
     534          while (RTCSync());
     535          RTC->MODE2.Mode2Alarm->ALARM.bit.SECOND= time.second;
    527536          while (RTCSync());
    528537      break;     
  • rtos_arduino/trunk/arduino_lib/libraries/RTC/src/RTCInt.h

    r136 r175  
    22  RTC library for Arduino Zero.
    33  Copyright (c) 2015 Arduino LLC. All right reserved.
    4 
    54  This library is free software; you can redistribute it and/or
    65  modify it under the terms of the GNU Lesser General Public
    76  License as published by the Free Software Foundation; either
    87  version 2.1 of the License, or (at your option) any later version.
    9 
    108  This library is distributed in the hope that it will be useful,
    119  but WITHOUT ANY WARRANTY; without even the implied warranty of
    1210  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    1311  Lesser General Public License for more details.
    14 
    1512  You should have received a copy of the GNU Lesser General Public
    1613  License along with this library; if not, write to the Free Software
     
    3835#define POST_MERIDIAN 1
    3936
     37//Parameter for oscillatorType - M0 only
     38#define HIGH_PRECISION 0
     39#define LOW_POWER 1
     40
    4041#include "Arduino.h"
    4142
     
    6061  RTCInt() {};
    6162 
    62   TIME local_time;
    63   DATE local_date;
     63  TIME time;
     64  DATE date;
    6465 
     66  void begin(bool timeMode, int oscillatorType);
    6567  void begin(bool timeMode);
    6668 
  • rtos_arduino/trunk/arduino_lib/libraries/Rest/library.properties

    r136 r175  
    55sentence=Allows to use the sleep functionalities. For Arduino M0 or M0PRO only.
    66paragraph=With this library you can manage power on an Arduino M0/M0PRO.
    7 category=power
     7category=Device Control
    88url=http://www.arduino.org
    99architectures=samd
  • rtos_arduino/trunk/arduino_lib/libraries/TFT/examples/Arduino/TFTDisplayText/TFTDisplayText.ino

    r144 r175  
    2121// pin definition for the Uno
    2222#define cs   10
    23 #define dc   8
    24 #define rst  9
     23#define dc   9
     24#define rst  8
    2525
    2626// pin definition for the Leonardo
Note: See TracChangeset for help on using the changeset viewer.