Fork of Demo program for ard2pmod library. Alarm features of RTC have not been tested, please try them out.
Dependencies: Terminal ard2pmod mbed
Fork of ard2pmod_demo by
Diff: main.cpp
- Revision:
- 2:9b1e5efd9a09
- Parent:
- 1:37fd05629bd3
- Child:
- 3:a9453e8c6641
--- a/main.cpp Wed Nov 26 20:18:26 2014 +0000 +++ b/main.cpp Wed Nov 26 20:32:16 2014 +0000 @@ -1,8 +1,50 @@ -//Test Ard2Pmod Class +/********************************************************************** +* +* Demo Ard2Pmod Library +* +* Configures mux for desired pmod type and then displays current time +* and date in endless loop after asking the user for input to configure +* the RTC. +* +* Requires TeraTerm, or your favorite terminal emulator, configured at +* 8N1 9600bps +* +*********************************************************************** +* Copyright (C) 2013 Maxim Integrated Products, Inc., All Rights Reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included +* in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL MAXIM INTEGRATED BE LIABLE FOR ANY CLAIM, DAMAGES +* OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +* OTHER DEALINGS IN THE SOFTWARE. +* +* Except as contained in this notice, the name of Maxim Integrated +* Products, Inc. shall not be used except as stated in the Maxim Integrated +* Products, Inc. Branding Policy. +* +* The mere transfer of this software does not imply any licenses +* of trade secrets, proprietary technology, copyrights, patents, +* trademarks, maskwork rights, or any other form of intellectual +* property whatsoever. Maxim Integrated Products, Inc. retains all +* ownership rights. +**********************************************************************/ #include "ard2pmod.h" + void get_user_input(char* message, uint8_t min, uint8_t max, uint8_t* member); Serial term(USBTX, USBRX); @@ -22,13 +64,14 @@ */ Ard2Pmod ard2pmod(PMOD_TYPE_I2C_AB); - //use to wiggle lines for PMOD_TYPE_1_GPIO + //can be used to wiggle lines for PMOD_TYPE_1_GPIO //BusOut pmod_A(D10, D11, D12, D13); //BusOut pmod_B(D4, D5, D6, D7); //DS3231 rtc variables - //default, use bit masks in ds3231.h for desired operation + //default for control and status registers, + //use bit masks in ds3231.h for desired operation ds3231_cntl_stat_t rtc_control_status = {0,0}; ds3231_time_t rtc_time; ds3231_calendar_t rtc_calendar;