From 8b7f9606ee3acda31d447612898628829b7e1d24 Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Sun, 29 Sep 2013 09:34:55 +1000 Subject: [PATCH] Update docs --- Bitmap_8cpp_source.html | 1205 +++++++++++---------- Bitmap_8h_source.html | 333 +++--- BlinkLED_8cpp_source.html | 249 +++-- BlinkLED_8h_source.html | 165 +-- BoolField_8cpp_source.html | 249 +++-- BoolField_8h_source.html | 165 +-- Charlieplex_8cpp_source.html | 329 +++--- Charlieplex_8h_source.html | 173 +-- ChaseLEDs_8cpp_source.html | 185 ++-- ChaseLEDs_8h_source.html | 157 +-- DMD_8cpp_source.html | 751 ++++++------- DMD_8h_source.html | 181 ++-- DS1307RTC_8cpp_source.html | 627 +++++------ DS1307RTC_8h_source.html | 181 ++-- DS3232RTC_8cpp_source.html | 933 ++++++++-------- DS3232RTC_8h_source.html | 205 ++-- DejaVuSans9_8h_source.html | 387 +++---- DejaVuSansBold9_8h_source.html | 387 +++---- DejaVuSansItalic9_8h_source.html | 387 +++---- EEPROM24_8cpp_source.html | 413 +++---- EEPROM24_8h_source.html | 229 ++-- Field_8cpp_source.html | 235 ++-- Field_8h_source.html | 175 +-- Form_8cpp_source.html | 399 +++---- Form_8h_source.html | 185 ++-- I2CMaster_8cpp_source.html | 103 +- I2CMaster_8h_source.html | 137 +-- IRreceiver_8cpp_source.html | 387 +++---- IRreceiver_8h_source.html | 173 +-- IntField_8cpp_source.html | 265 ++--- IntField_8h_source.html | 183 ++-- LCD_8cpp_source.html | 433 ++++---- LCD_8h_source.html | 235 ++-- ListField_8cpp_source.html | 291 ++--- ListField_8h_source.html | 167 +-- Melody_8cpp_source.html | 289 ++--- Melody_8h_source.html | 367 ++++--- Mono5x7_8h_source.html | 365 ++++--- PowerSave_8cpp_source.html | 179 +-- PowerSave_8h_source.html | 163 +-- RC5_8h_source.html | 743 ++++++------- RTC_8cpp_source.html | 565 +++++----- RTC_8h_source.html | 265 ++--- SoftI2C_8cpp_source.html | 423 ++++---- SoftI2C_8h_source.html | 167 +-- TextField_8cpp_source.html | 167 +-- TextField_8h_source.html | 139 +-- TimeField_8cpp_source.html | 497 ++++----- TimeField_8h_source.html | 177 +-- alarm-clock_8dox.html | 59 +- alarm_clock.html | 95 +- annotated.html | 105 +- bc_s.png | Bin 677 -> 680 bytes bdwn.png | Bin 0 -> 147 bytes blink-blink_8dox.html | 59 +- blink-charlieplex_8dox.html | 59 +- blink-cylon_8dox.html | 59 +- blink-startrek_8dox.html | 59 +- blink_blink.html | 127 ++- blink_charlieplex.html | 207 ++-- blink_cylon.html | 229 ++-- blink_startrek.html | 305 +++--- classBitmap-members.html | 143 +-- classBitmap.html | 799 ++++++++------ classBitmap.png | Bin 307 -> 333 bytes classBlinkLED-members.html | 75 +- classBlinkLED.html | 256 +++-- classBoolField-members.html | 95 +- classBoolField.html | 308 ++++-- classBoolField.png | Bin 303 -> 331 bytes classCharlieplex-members.html | 77 +- classCharlieplex.html | 310 +++--- classChaseLEDs-members.html | 67 +- classChaseLEDs.html | 241 +++-- classDMD-members.html | 167 +-- classDMD.html | 593 ++++++---- classDMD.png | Bin 303 -> 329 bytes classDS1307RTC-members.html | 119 +- classDS1307RTC.html | 353 ++++-- classDS1307RTC.png | Bin 326 -> 370 bytes classDS3232RTC-members.html | 129 ++- classDS3232RTC.html | 425 +++++--- classDS3232RTC.png | Bin 326 -> 372 bytes classEEPROM24-members.html | 71 +- classEEPROM24.html | 260 ++--- classField-members.html | 81 +- classField.html | 269 +++-- classField.png | Bin 655 -> 852 bytes classForm-members.html | 85 +- classForm.html | 296 ++--- classI2CMaster-members.html | 69 +- classI2CMaster.html | 212 ++-- classI2CMaster.png | Bin 380 -> 438 bytes classIRreceiver-members.html | 69 +- classIRreceiver.html | 300 ++--- classIntField-members.html | 105 +- classIntField.html | 396 ++++--- classIntField.png | Bin 289 -> 311 bytes classLCD-members.html | 87 +- classLCD.html | 320 +++--- classListField-members.html | 91 +- classListField.html | 293 +++-- classListField.png | Bin 296 -> 333 bytes classMelody-members.html | 75 +- classMelody.html | 246 +++-- classRTC-members.html | 115 +- classRTC.html | 446 +++++--- classRTC.png | Bin 442 -> 499 bytes classRTCAlarm-members.html | 61 +- classRTCDate-members.html | 61 +- classRTCTime-members.html | 61 +- classSoftI2C-members.html | 71 +- classSoftI2C.html | 216 ++-- classSoftI2C.png | Bin 376 -> 433 bytes classTextField-members.html | 87 +- classTextField.html | 219 ++-- classTextField.png | Bin 309 -> 342 bytes classTimeField-members.html | 95 +- classTimeField.html | 331 +++--- classTimeField.png | Bin 309 -> 341 bytes classes.html | 93 +- closed.png | Bin 126 -> 132 bytes dir_1586d320a3b1e622174530fde769cda9.html | 103 ++ dir_48f64e79f12bd77ba047e9e436ec978c.html | 113 ++ dir_5e87a7229a108582288ef7eda1233dc3.html | 99 ++ dir_6591a2127a29f6cea3994dcb5b0596d1.html | 105 ++ dir_9a34040863d1190c0e01b23e6b44de01.html | 100 ++ dir_bc0718b08fb2015b8e59c47b2805f60c.html | 105 ++ dir_be059bf9978ae156837504b1b8a7568c.html | 99 ++ dir_f34881fcf60f680b800190d5274dfaea.html | 103 ++ dir_f9b96888882c2691b8eeaeafd1b9501d.html | 103 ++ dmd-demo_8dox.html | 59 +- dmd-running-figure_8dox.html | 59 +- dmd_demo.html | 355 +++--- dmd_running_figure.html | 747 ++++++------- doxygen.css | 578 +++++++--- doxygen.png | Bin 3942 -> 3779 bytes dynsections.js | 78 ++ files.html | 155 +-- ftv2blank.png | Bin 0 -> 86 bytes ftv2cl.png | Bin 0 -> 453 bytes ftv2doc.png | Bin 0 -> 746 bytes ftv2folderclosed.png | Bin 0 -> 616 bytes ftv2folderopen.png | Bin 0 -> 597 bytes ftv2lastnode.png | Bin 0 -> 86 bytes ftv2link.png | Bin 0 -> 746 bytes ftv2mlastnode.png | Bin 0 -> 246 bytes ftv2mnode.png | Bin 0 -> 246 bytes ftv2mo.png | Bin 0 -> 403 bytes ftv2node.png | Bin 0 -> 86 bytes ftv2ns.png | Bin 0 -> 388 bytes ftv2plastnode.png | Bin 0 -> 229 bytes ftv2pnode.png | Bin 0 -> 229 bytes ftv2splitbar.png | Bin 0 -> 314 bytes ftv2vertline.png | Bin 0 -> 86 bytes functions.html | 65 +- functions_0x62.html | 65 +- functions_0x63.html | 65 +- functions_0x64.html | 65 +- functions_0x65.html | 65 +- functions_0x66.html | 74 +- functions_0x67.html | 57 +- functions_0x68.html | 65 +- functions_0x69.html | 65 +- functions_0x6c.html | 68 +- functions_0x6d.html | 65 +- functions_0x6e.html | 65 +- functions_0x6f.html | 65 +- functions_0x70.html | 68 +- functions_0x72.html | 65 +- functions_0x73.html | 67 +- functions_0x74.html | 65 +- functions_0x75.html | 57 +- functions_0x76.html | 65 +- functions_0x77.html | 65 +- functions_0x79.html | 57 +- functions_0x7e.html | 65 +- functions_enum.html | 65 +- functions_eval.html | 65 +- functions_func.html | 65 +- functions_func_0x62.html | 65 +- functions_func_0x63.html | 65 +- functions_func_0x64.html | 69 +- functions_func_0x65.html | 65 +- functions_func_0x66.html | 73 +- functions_func_0x67.html | 57 +- functions_func_0x68.html | 65 +- functions_func_0x69.html | 65 +- functions_func_0x6c.html | 68 +- functions_func_0x6d.html | 65 +- functions_func_0x6e.html | 65 +- functions_func_0x6f.html | 65 +- functions_func_0x70.html | 65 +- functions_func_0x72.html | 65 +- functions_func_0x73.html | 67 +- functions_func_0x74.html | 65 +- functions_func_0x75.html | 57 +- functions_func_0x76.html | 65 +- functions_func_0x77.html | 65 +- functions_func_0x7e.html | 65 +- functions_type.html | 59 +- functions_vars.html | 65 +- group__power__save.html | 122 ++- hierarchy.html | 113 +- index.html | 99 +- ir-dumpir_8dox.html | 59 +- ir-snake_8dox.html | 59 +- ir_dumpir.html | 453 ++++---- ir_snake.html | 433 ++++---- jquery.js | 62 +- lcd-form_8dox.html | 59 +- lcd-helloworld_8dox.html | 59 +- lcd_form.html | 283 ++--- lcd_hello_world.html | 219 ++-- mainpage_8dox.html | 59 +- modules.html | 59 +- nav_f.png | Bin 159 -> 153 bytes nav_g.png | Bin 0 -> 95 bytes nav_h.png | Bin 97 -> 98 bytes open.png | Bin 118 -> 123 bytes pages.html | 90 +- search/all_61.html | 68 +- search/all_61.js | 14 + search/all_62.html | 93 +- search/all_62.js | 17 + search/all_63.html | 65 +- search/all_63.js | 14 + search/all_64.html | 202 +--- search/all_64.js | 33 + search/all_65.html | 75 +- search/all_65.js | 12 + search/all_66.html | 64 +- search/all_66.js | 12 + search/all_67.html | 11 +- search/all_67.js | 4 + search/all_68.html | 42 +- search/all_68.js | 9 + search/all_69.html | 106 +- search/all_69.js | 18 + search/all_6c.html | 65 +- search/all_6c.js | 11 + search/all_6d.html | 61 +- search/all_6d.js | 11 + search/all_6e.html | 29 +- search/all_6e.js | 7 + search/all_6f.html | 17 +- search/all_6f.js | 5 + search/all_70.html | 53 +- search/all_70.js | 13 + search/all_72.html | 122 +-- search/all_72.js | 19 + search/all_73.html | 296 +---- search/all_73.js | 62 ++ search/all_74.html | 52 +- search/all_74.js | 9 + search/all_75.html | 11 +- search/all_75.js | 5 + search/all_76.html | 17 +- search/all_76.js | 4 + search/all_77.html | 74 +- search/all_77.js | 11 + search/all_79.html | 11 +- search/all_79.js | 4 + search/all_7e.html | 35 +- search/all_7e.js | 8 + search/classes_62.html | 20 +- search/classes_62.js | 6 + search/classes_63.html | 15 +- search/classes_63.js | 5 + search/classes_64.html | 20 +- search/classes_64.js | 6 + search/classes_65.html | 10 +- search/classes_65.js | 4 + search/classes_66.html | 15 +- search/classes_66.js | 5 + search/classes_69.html | 20 +- search/classes_69.js | 6 + search/classes_6c.html | 15 +- search/classes_6c.js | 5 + search/classes_6d.html | 10 +- search/classes_6d.js | 4 + search/classes_72.html | 25 +- search/classes_72.js | 7 + search/classes_73.html | 10 +- search/classes_73.js | 4 + search/classes_74.html | 15 +- search/classes_74.js | 5 + search/enums_64.html | 11 +- search/enums_64.js | 4 + search/enums_73.html | 11 +- search/enums_73.js | 5 + search/enumvalues_62.html | 17 +- search/enumvalues_62.js | 5 + search/enumvalues_64.html | 11 +- search/enumvalues_64.js | 4 + search/enumvalues_73.html | 25 + search/enumvalues_73.js | 13 + search/files_61.html | 10 +- search/files_61.js | 4 + search/files_62.html | 25 +- search/files_62.js | 7 + search/files_64.html | 15 +- search/files_64.js | 5 + search/files_69.html | 15 +- search/files_69.js | 5 + search/files_6c.html | 15 +- search/files_6c.js | 5 + search/files_6d.html | 10 +- search/files_6d.js | 4 + search/functions_61.html | 51 +- search/functions_61.js | 10 + search/functions_62.html | 48 +- search/functions_62.js | 9 + search/functions_63.html | 53 +- search/functions_63.js | 11 + search/functions_64.html | 162 +-- search/functions_64.js | 26 + search/functions_65.html | 72 +- search/functions_65.js | 12 + search/functions_66.html | 56 +- search/functions_66.js | 10 + search/functions_67.html | 11 +- search/functions_67.js | 4 + search/functions_68.html | 33 +- search/functions_68.js | 7 + search/functions_69.html | 81 +- search/functions_69.js | 14 + search/functions_6c.html | 53 +- search/functions_6c.js | 9 + search/functions_6d.html | 38 +- search/functions_6d.js | 8 + search/functions_6e.html | 17 +- search/functions_6e.js | 5 + search/functions_6f.html | 17 +- search/functions_6f.js | 5 + search/functions_70.html | 53 +- search/functions_70.js | 11 + search/functions_72.html | 104 +- search/functions_72.js | 15 + search/functions_73.html | 284 +---- search/functions_73.js | 48 + search/functions_74.html | 50 +- search/functions_74.js | 9 + search/functions_75.html | 11 +- search/functions_75.js | 5 + search/functions_76.html | 17 +- search/functions_76.js | 4 + search/functions_77.html | 62 +- search/functions_77.js | 9 + search/functions_7e.html | 35 +- search/functions_7e.js | 8 + search/groups_70.html | 25 + search/groups_70.js | 4 + search/pages_61.html | 25 + search/pages_61.js | 4 + search/pages_62.html | 25 + search/pages_62.js | 4 + search/pages_63.html | 25 + search/pages_63.js | 5 + search/pages_64.html | 25 + search/pages_64.js | 5 + search/pages_66.html | 25 + search/pages_66.js | 4 + search/pages_68.html | 25 + search/pages_68.js | 4 + search/pages_72.html | 25 + search/pages_72.js | 4 + search/pages_73.html | 25 + search/pages_73.js | 5 + search/search.css | 12 +- search/search.js | 83 +- search/typedefs_63.html | 11 +- search/typedefs_63.js | 4 + search/typedefs_66.html | 25 + search/typedefs_66.js | 4 + search/typedefs_70.html | 25 + search/typedefs_70.js | 4 + search/variables_61.html | 17 +- search/variables_61.js | 5 + search/variables_62.html | 11 +- search/variables_62.js | 4 + search/variables_64.html | 17 +- search/variables_64.js | 5 + search/variables_66.html | 11 +- search/variables_66.js | 4 + search/variables_68.html | 14 +- search/variables_68.js | 4 + search/variables_69.html | 11 +- search/variables_69.js | 4 + search/variables_6d.html | 20 +- search/variables_6d.js | 5 + search/variables_6e.html | 17 +- search/variables_6e.js | 5 + search/variables_73.html | 11 +- search/variables_73.js | 4 + search/variables_77.html | 17 +- search/variables_77.js | 5 + search/variables_79.html | 11 +- search/variables_79.js | 4 + structRTCAlarm.html | 101 +- structRTCDate.html | 112 +- structRTCTime.html | 112 +- sync_off.png | Bin 0 -> 853 bytes sync_on.png | Bin 0 -> 845 bytes tab_a.png | Bin 140 -> 142 bytes tab_b.png | Bin 178 -> 167 bytes tab_h.png | Bin 192 -> 192 bytes tab_s.png | Bin 189 -> 184 bytes tabs.css | 1 + 409 files changed, 21357 insertions(+), 18181 deletions(-) create mode 100644 bdwn.png create mode 100644 dir_1586d320a3b1e622174530fde769cda9.html create mode 100644 dir_48f64e79f12bd77ba047e9e436ec978c.html create mode 100644 dir_5e87a7229a108582288ef7eda1233dc3.html create mode 100644 dir_6591a2127a29f6cea3994dcb5b0596d1.html create mode 100644 dir_9a34040863d1190c0e01b23e6b44de01.html create mode 100644 dir_bc0718b08fb2015b8e59c47b2805f60c.html create mode 100644 dir_be059bf9978ae156837504b1b8a7568c.html create mode 100644 dir_f34881fcf60f680b800190d5274dfaea.html create mode 100644 dir_f9b96888882c2691b8eeaeafd1b9501d.html create mode 100644 dynsections.js create mode 100644 ftv2blank.png create mode 100644 ftv2cl.png create mode 100644 ftv2doc.png create mode 100644 ftv2folderclosed.png create mode 100644 ftv2folderopen.png create mode 100644 ftv2lastnode.png create mode 100644 ftv2link.png create mode 100644 ftv2mlastnode.png create mode 100644 ftv2mnode.png create mode 100644 ftv2mo.png create mode 100644 ftv2node.png create mode 100644 ftv2ns.png create mode 100644 ftv2plastnode.png create mode 100644 ftv2pnode.png create mode 100644 ftv2splitbar.png create mode 100644 ftv2vertline.png create mode 100644 nav_g.png create mode 100644 search/all_61.js create mode 100644 search/all_62.js create mode 100644 search/all_63.js create mode 100644 search/all_64.js create mode 100644 search/all_65.js create mode 100644 search/all_66.js create mode 100644 search/all_67.js create mode 100644 search/all_68.js create mode 100644 search/all_69.js create mode 100644 search/all_6c.js create mode 100644 search/all_6d.js create mode 100644 search/all_6e.js create mode 100644 search/all_6f.js create mode 100644 search/all_70.js create mode 100644 search/all_72.js create mode 100644 search/all_73.js create mode 100644 search/all_74.js create mode 100644 search/all_75.js create mode 100644 search/all_76.js create mode 100644 search/all_77.js create mode 100644 search/all_79.js create mode 100644 search/all_7e.js create mode 100644 search/classes_62.js create mode 100644 search/classes_63.js create mode 100644 search/classes_64.js create mode 100644 search/classes_65.js create mode 100644 search/classes_66.js create mode 100644 search/classes_69.js create mode 100644 search/classes_6c.js create mode 100644 search/classes_6d.js create mode 100644 search/classes_72.js create mode 100644 search/classes_73.js create mode 100644 search/classes_74.js create mode 100644 search/enums_64.js create mode 100644 search/enums_73.js create mode 100644 search/enumvalues_62.js create mode 100644 search/enumvalues_64.js create mode 100644 search/enumvalues_73.html create mode 100644 search/enumvalues_73.js create mode 100644 search/files_61.js create mode 100644 search/files_62.js create mode 100644 search/files_64.js create mode 100644 search/files_69.js create mode 100644 search/files_6c.js create mode 100644 search/files_6d.js create mode 100644 search/functions_61.js create mode 100644 search/functions_62.js create mode 100644 search/functions_63.js create mode 100644 search/functions_64.js create mode 100644 search/functions_65.js create mode 100644 search/functions_66.js create mode 100644 search/functions_67.js create mode 100644 search/functions_68.js create mode 100644 search/functions_69.js create mode 100644 search/functions_6c.js create mode 100644 search/functions_6d.js create mode 100644 search/functions_6e.js create mode 100644 search/functions_6f.js create mode 100644 search/functions_70.js create mode 100644 search/functions_72.js create mode 100644 search/functions_73.js create mode 100644 search/functions_74.js create mode 100644 search/functions_75.js create mode 100644 search/functions_76.js create mode 100644 search/functions_77.js create mode 100644 search/functions_7e.js create mode 100644 search/groups_70.html create mode 100644 search/groups_70.js create mode 100644 search/pages_61.html create mode 100644 search/pages_61.js create mode 100644 search/pages_62.html create mode 100644 search/pages_62.js create mode 100644 search/pages_63.html create mode 100644 search/pages_63.js create mode 100644 search/pages_64.html create mode 100644 search/pages_64.js create mode 100644 search/pages_66.html create mode 100644 search/pages_66.js create mode 100644 search/pages_68.html create mode 100644 search/pages_68.js create mode 100644 search/pages_72.html create mode 100644 search/pages_72.js create mode 100644 search/pages_73.html create mode 100644 search/pages_73.js create mode 100644 search/typedefs_63.js create mode 100644 search/typedefs_66.html create mode 100644 search/typedefs_66.js create mode 100644 search/typedefs_70.html create mode 100644 search/typedefs_70.js create mode 100644 search/variables_61.js create mode 100644 search/variables_62.js create mode 100644 search/variables_64.js create mode 100644 search/variables_66.js create mode 100644 search/variables_68.js create mode 100644 search/variables_69.js create mode 100644 search/variables_6d.js create mode 100644 search/variables_6e.js create mode 100644 search/variables_73.js create mode 100644 search/variables_77.js create mode 100644 search/variables_79.js create mode 100644 sync_off.png create mode 100644 sync_on.png diff --git a/Bitmap_8cpp_source.html b/Bitmap_8cpp_source.html index bcd3c362..7d864f3a 100644 --- a/Bitmap_8cpp_source.html +++ b/Bitmap_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Bitmap.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Bitmap.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "Bitmap.h"
-00024 #include <WString.h>
-00025 #include <string.h>
-00026 #include <stdlib.h>
-00027 
-00078 Bitmap::Bitmap(int width, int height)
-00079     : _width(width)
-00080     , _height(height)
-00081     , _stride((width + 7) / 8)
-00082     , fb(0)
-00083     , _font(0)
-00084     , _textColor(White)
-00085 {
-00086     // Allocate memory for the framebuffer and clear it (1 = pixel off).
-00087     unsigned int size = _stride * _height;
-00088     fb = (uint8_t *)malloc(size);
-00089     if (fb)
-00090         memset(fb, 0xFF, size);
-00091 }
-00092 
-00096 Bitmap::~Bitmap()
-00097 {
-00098     if (fb)
-00099         free(fb);
-00100 }
-00101 
-00164 void Bitmap::clear(Color color)
-00165 {
-00166     unsigned int size = _stride * _height;
-00167     if (color == Black)
-00168         memset(fb, 0xFF, size);
-00169     else
-00170         memset(fb, 0x00, size);
-00171 }
-00172 
-00181 Bitmap::Color Bitmap::pixel(int x, int y) const
-00182 {
-00183     if (((unsigned int)x) >= ((unsigned int)_width) ||
-00184             ((unsigned int)y) >= ((unsigned int)_height))
-00185         return Black;
-00186     uint8_t *ptr = fb + y * _stride + (x >> 3);
-00187     if (*ptr & ((uint8_t)0x80) >> (x & 0x07))
-00188         return Black;
-00189     else
-00190         return White;
-00191 }
-00192 
-00198 void Bitmap::setPixel(int x, int y, Color color)
-00199 {
-00200     if (((unsigned int)x) >= ((unsigned int)_width) ||
-00201             ((unsigned int)y) >= ((unsigned int)_height))
-00202         return;     // Pixel is off-screen.
-00203     uint8_t *ptr = fb + y * _stride + (x >> 3);
-00204     if (color)
-00205         *ptr &= ~(((uint8_t)0x80) >> (x & 0x07));
-00206     else
-00207         *ptr |= (((uint8_t)0x80) >> (x & 0x07));
-00208 }
-00209 
-00215 void Bitmap::drawLine(int x1, int y1, int x2, int y2, Color color)
-00216 {
-00217     // Midpoint line scan-conversion algorithm from "Computer Graphics:
-00218     // Principles and Practice", Second Edition, Foley, van Dam, et al.
-00219     int dx = x2 - x1;
-00220     int dy = y2 - y1;
-00221     int xstep, ystep;
-00222     int d, incrE, incrNE;
-00223     if (dx < 0) {
-00224         xstep = -1;
-00225         dx = -dx;
-00226     } else {
-00227         xstep = 1;
-00228     }
-00229     if (dy < 0) {
-00230         ystep = -1;
-00231         dy = -dy;
-00232     } else {
-00233         ystep = 1;
-00234     }
-00235     if (dx >= dy) {
-00236         d = 2 * dy - dx;
-00237         incrE = 2 * dy;
-00238         incrNE = 2 * (dy - dx);
-00239         setPixel(x1, y1, color);
-00240         while (x1 != x2) {
-00241             if (d <= 0) {
-00242                 d += incrE;
-00243             } else {
-00244                 d += incrNE;
-00245                 y1 += ystep;
-00246             }
-00247             x1 += xstep;
-00248             setPixel(x1, y1, color);
-00249         }
-00250     } else {
-00251         d = 2 * dx - dy;
-00252         incrE = 2 * dx;
-00253         incrNE = 2 * (dx - dy);
-00254         setPixel(x1, y1, color);
-00255         while (y1 != y2) {
-00256             if (d <= 0) {
-00257                 d += incrE;
-00258             } else {
-00259                 d += incrNE;
-00260                 x1 += xstep;
-00261             }
-00262             y1 += ystep;
-00263             setPixel(x1, y1, color);
-00264         }
-00265     }
-00266 }
-00267 
-00276 void Bitmap::drawRect(int x1, int y1, int x2, int y2, Color borderColor, Color fillColor)
-00277 {
-00278     int temp;
-00279     if (x1 > x2) {
-00280         temp = x1;
-00281         x1 = x2;
-00282         x2 = temp;
-00283     }
-00284     if (y1 > y2) {
-00285         temp = y1;
-00286         y1 = y2;
-00287         y2 = temp;
-00288     }
-00289     if (fillColor == borderColor) {
-00290         fill(x1, y1, x2 - x1 + 1, y2 - y1 + 1, fillColor);
-00291     } else {
-00292         drawLine(x1, y1, x2, y1, borderColor);
-00293         if (y1 < y2)
-00294             drawLine(x2, y1 + 1, x2, y2, borderColor);
-00295         if (x1 < x2)
-00296             drawLine(x2 - 1, y2, x1, y2, borderColor);
-00297         if (y1 < (y2 - 1))
-00298             drawLine(x1, y2 - 1, x1, y1 + 1, borderColor);
-00299         if (fillColor != NoFill)
-00300             fill(x1 + 1, y1 + 1, x2 - x1 - 1, y2 - y1 - 1, fillColor);
-00301     }
-00302 }
-00303 
-00324 void Bitmap::drawCircle(int centerX, int centerY, int radius, Color borderColor, Color fillColor)
-00325 {
-00326     // Midpoint circle scan-conversion algorithm using second-order
-00327     // differences from "Computer Graphics: Principles and Practice",
-00328     // Second Edition, Foley, van Dam, et al.
-00329     if (radius < 0)
-00330         radius = -radius;
-00331     int x = 0;
-00332     int y = radius;
-00333     int d = 1 - radius;
-00334     int deltaE = 3;
-00335     int deltaSE = 5 - 2 * radius;
-00336     drawCirclePoints(centerX, centerY, radius, x, y, borderColor, fillColor);
-00337     while (y > x) {
-00338         if (d < 0) {
-00339             d += deltaE;
-00340             deltaE += 2;
-00341             deltaSE += 2;
-00342         } else {
-00343             d += deltaSE;
-00344             deltaE += 2;
-00345             deltaSE += 4;
-00346             --y;
-00347         }
-00348         ++x;
-00349         drawCirclePoints(centerX, centerY, radius, x, y, borderColor, fillColor);
-00350     }
-00351 }
-00352 
-00378 void Bitmap::drawBitmap(int x, int y, const Bitmap &bitmap, Color color)
-00379 {
-00380     int w = bitmap.width();
-00381     int s = bitmap.stride();
-00382     int h = bitmap.height();
-00383     Color invColor = !color;
-00384     for (uint8_t by = 0; by < h; ++by) {
-00385         const uint8_t *line = bitmap.data() + by * s;
-00386         uint8_t mask = 0x80;
-00387         uint8_t value = *line++;
-00388         for (uint8_t bx = 0; bx < w; ++bx) {
-00389             if (value & mask)
-00390                 setPixel(x + bx, y + by, invColor);
-00391             else
-00392                 setPixel(x + bx, y + by, color);
-00393             mask >>= 1;
-00394             if (!mask) {
-00395                 mask = 0x80;
-00396                 value = *line++;
-00397             }
-00398         }
-00399     }
-00400 }
-00401 
-00415 void Bitmap::drawBitmap(int x, int y, const prog_uint8_t *bitmap, Color color)
-00416 {
-00417     uint8_t w = pgm_read_byte(bitmap);
-00418     uint8_t s = (w + 7) >> 3;
-00419     uint8_t h = pgm_read_byte(bitmap + 1);
-00420     Color invColor = !color;
-00421     for (uint8_t by = 0; by < h; ++by) {
-00422         const prog_uint8_t *line = bitmap + 2 + by * s;
-00423         uint8_t mask = 0x80;
-00424         uint8_t value = pgm_read_byte(line);
-00425         for (uint8_t bx = 0; bx < w; ++bx) {
-00426             if (value & mask)
-00427                 setPixel(x + bx, y + by, color);
-00428             else
-00429                 setPixel(x + bx, y + by, invColor);
-00430             mask >>= 1;
-00431             if (!mask) {
-00432                 mask = 0x80;
-00433                 ++line;
-00434                 value = pgm_read_byte(line);
-00435             }
-00436         }
-00437     }
-00438 }
-00439 
-00499 #define fontIsFixed(font)   (pgm_read_byte((font)) == 0 && \
-00500                              pgm_read_byte((font) + 1) == 0)
-00501 #define fontWidth(font)     (pgm_read_byte((font) + 2))
-00502 #define fontHeight(font)    (pgm_read_byte((font) + 3))
-00503 #define fontFirstChar(font) (pgm_read_byte((font) + 4))
-00504 #define fontCharCount(font) (pgm_read_byte((font) + 5))
-00505 
-00516 void Bitmap::drawText(int x, int y, const char *str, int len)
-00517 {
-00518     if (!_font)
-00519         return;
-00520     uint8_t height = fontHeight(_font);
-00521     if (len < 0)
-00522         len = strlen(str);
-00523     while (len-- > 0) {
-00524         x += drawChar(x, y, *str++);
-00525         if (len > 0) {
-00526             fill(x, y, 1, height, !_textColor);
-00527             ++x;
-00528         }
-00529         if (x >= _width)
-00530             break;
-00531     }
-00532 }
-00533 
-00545 void Bitmap::drawText(int x, int y, const String &str, int start, int len)
-00546 {
-00547     if (!_font)
-00548         return;
-00549     uint8_t height = fontHeight(_font);
-00550     if (len < 0)
-00551         len = str.length() - start;
-00552     while (len-- > 0) {
-00553         x += drawChar(x, y, str[start++]);
-00554         if (len > 0) {
-00555             fill(x, y, 1, height, !_textColor);
-00556             ++x;
-00557         }
-00558         if (x >= _width)
-00559             break;
-00560     }
-00561 }
-00562 
-00575 int Bitmap::drawChar(int x, int y, char ch)
-00576 {
-00577     uint8_t height = fontHeight(_font);
-00578     if (ch == ' ') {
-00579         // Font may not have space, or it is zero-width.  Calculate
-00580         // the real size and fill the space.
-00581         int spaceWidth = charWidth('n');
-00582         fill(x, y, spaceWidth, height, !_textColor);
-00583         return spaceWidth;
-00584     }
-00585     uint8_t first = fontFirstChar(_font);
-00586     uint8_t count = fontCharCount(_font);
-00587     uint8_t index = (uint8_t)ch;
-00588     if (index < first || index >= (first + count))
-00589         return 0;
-00590     index -= first;
-00591     uint8_t heightBytes = (height + 7) >> 3;;
-00592     uint8_t width;
-00593     const prog_uint8_t *image;
-00594     if (fontIsFixed(_font)) {
-00595         // Fixed-width font.
-00596         width = fontWidth(_font);
-00597         image = _font + 6 + index * heightBytes * width;
-00598     } else {
-00599         // Variable-width font.
-00600         width = pgm_read_byte(_font + 6 + index);
-00601         image = _font + 6 + count;
-00602         for (uint8_t temp = 0; temp < index; ++temp) {
-00603             // Scan through all previous characters to find the starting
-00604             // location for this one.
-00605             image += pgm_read_byte(_font + 6 + temp) * heightBytes;
-00606         }
-00607     }
-00608     if ((x + width) <= 0 || (y + height) <= 0)
-00609         return width;   // Character is off the top or left of the screen.
-00610     Color invColor = !_textColor;
-00611     for (uint8_t cx = 0; cx < width; ++cx) {
-00612         for (uint8_t cy = 0; cy < heightBytes; ++cy) {
-00613             uint8_t value = pgm_read_byte(image + cy * width + cx);
-00614             int posn;
-00615             if (heightBytes > 1 && cy == (heightBytes - 1))
-00616                 posn = height - 8;
-00617             else
-00618                 posn = cy * 8;
-00619             for (uint8_t bit = 0; bit < 8; ++bit) {
-00620                 if ((posn + bit) >= (cy * 8) && (posn + bit) <= height) {
-00621                     if (value & 0x01)
-00622                         setPixel(x + cx, y + posn + bit, _textColor);
-00623                     else
-00624                         setPixel(x + cx, y + posn + bit, invColor);
-00625                 }
-00626                 value >>= 1;
-00627             }
-00628         }
-00629     }
-00630     return width;
-00631 }
-00632 
-00640 int Bitmap::charWidth(char ch) const
-00641 {
-00642     uint8_t index = (uint8_t)ch;
-00643     if (!_font)
-00644         return 0;
-00645     uint8_t first = fontFirstChar(_font);
-00646     uint8_t count = fontCharCount(_font);
-00647     if (index == ' ')
-00648         index = 'n';    // In case the font does not contain space.
-00649     if (index < first || index >= (first + count))
-00650         return 0;
-00651     if (fontIsFixed(_font))
-00652         return fontWidth(_font);
-00653     else
-00654         return pgm_read_byte(_font + 6 + (index - first));
-00655 }
-00656 
-00665 int Bitmap::textWidth(const char *str, int len) const
-00666 {
-00667     int width = 0;
-00668     if (len < 0)
-00669         len = strlen(str);
-00670     while (len-- > 0) {
-00671         width += charWidth(*str++);
-00672         if (len > 0)
-00673             ++width;
-00674     }
-00675     return width;
-00676 }
-00677 
-00687 int Bitmap::textWidth(const String &str, int start, int len) const
-00688 {
-00689     int width = 0;
-00690     if (len < 0)
-00691         len = str.length() - start;
-00692     while (len-- > 0) {
-00693         width += charWidth(str[start++]);
-00694         if (len > 0)
-00695             ++width;
-00696     }
-00697     return width;
-00698 }
-00699 
-00706 int Bitmap::textHeight() const
-00707 {
-00708     if (_font)
-00709         return fontHeight(_font);
-00710     else
-00711         return 0;
-00712 }
-00713 
-00728 void Bitmap::copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
-00729 {
-00730     if (dest == this) {
-00731         // Copying to within the same bitmap, so copy in a direction
-00732         // that will prevent problems with overlap.
-00733         blit(x, y, x + width - 1, y + height - 1, destX, destY);
-00734     } else {
-00735         // Copying to a different bitmap.
-00736         while (height > 0) {
-00737             for (int tempx = 0; tempx < width; ++tempx)
-00738                 dest->setPixel(destX + tempx, destY, pixel(x + tempx, y));
-00739             ++y;
-00740             ++destY;
-00741             --height;
-00742         }
-00743     }
-00744 }
-00745 
-00752 void Bitmap::fill(int x, int y, int width, int height, Color color)
-00753 {
-00754     while (height > 0) {
-00755         for (int temp = 0; temp < width; ++temp)
-00756             setPixel(x + temp, y, color);
-00757         ++y;
-00758         --height;
-00759     }
-00760 }
-00761 
-00775 void Bitmap::fill(int x, int y, int width, int height, const prog_uint8_t *pattern, Color color)
-00776 {
-00777     uint8_t w = pgm_read_byte(pattern);
-00778     uint8_t s = (w + 7) >> 3;
-00779     uint8_t h = pgm_read_byte(pattern + 1);
-00780     if (!w || !h)
-00781         return;
-00782     Color invColor = !color;
-00783     for (int tempy = 0; tempy < height; ++tempy) {
-00784         const prog_uint8_t *startLine = pattern + 2 + (tempy % h) * s;
-00785         const prog_uint8_t *line = startLine;
-00786         uint8_t mask = 0x80;
-00787         uint8_t value = pgm_read_byte(line++);
-00788         int bit = 0;
-00789         for (int tempx = 0; tempx < width; ++tempx) {
-00790             if (value & mask)
-00791                 setPixel(x + tempx, y + tempy, color);
-00792             else
-00793                 setPixel(x + tempx, y + tempy, invColor);
-00794             if (++bit >= w) {
-00795                 mask = 0x80;
-00796                 line = startLine;
-00797                 value = pgm_read_byte(line++);
-00798                 bit = 0;
-00799             } else {
-00800                 mask >>= 1;
-00801                 if (!mask) {
-00802                     mask = 0x80;
-00803                     value = pgm_read_byte(line++);
-00804                 }
-00805             }
-00806         }
-00807     }
-00808 }
-00809 
-00831 void Bitmap::scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor)
-00832 {
-00833     // Bail out if no scrolling at all.
-00834     if (!dx && !dy)
-00835         return;
-00836 
-00837     // Clamp the scroll region to the extents of the bitmap.
-00838     if (x < 0) {
-00839         width += x;
-00840         x = 0;
-00841     }
-00842     if (y < 0) {
-00843         height += y;
-00844         y = 0;
-00845     }
-00846     if ((x + width) > _width)
-00847         width = _width - x;
-00848     if ((y + height) > _height)
-00849         height = _height - y;
-00850     if (width <= 0 || height <= 0)
-00851         return;
-00852 
-00853     // Scroll the region in the specified direction.
-00854     if (dy < 0) {
-00855         if (dx < 0)
-00856             blit(x - dx, y - dy, x + width - 1 + dx, y + height - 1 + dy, x, y);
-00857         else
-00858             blit(x, y - dy, x + width - 1 - dx, y + height - 1 + dy, x + dx, y);
-00859     } else {
-00860         if (dx < 0)
-00861             blit(x - dx, y, x + width - 1 + dx, y + height - 1 - dy, x, y + dy);
-00862         else
-00863             blit(x, y, x + width - 1 - dx, y + height - 1 - dy, x + dx, y + dy);
-00864     }
-00865 
-00866     // Fill the pixels that were uncovered by the scroll.
-00867     if (dy < 0) {
-00868         fill(x, y + height + dy, width, -dy, fillColor);
-00869         if (dx < 0)
-00870             fill(x + width + dx, y, -dx, height + dy, fillColor);
-00871         else if (dx > 0)
-00872             fill(x, y, dx, height + dy, fillColor);
-00873     } else if (dy > 0) {
-00874         fill(x, y, width, -dy, fillColor);
-00875         if (dx < 0)
-00876             fill(x + width + dx, y + dy, -dx, height - dy, fillColor);
-00877         else if (dx > 0)
-00878             fill(x, y + dy, dx, height - dy, fillColor);
-00879     } else if (dx < 0) {
-00880         fill(x + width + dx, y, -dx, height, fillColor);
-00881     } else if (dx > 0) {
-00882         fill(x, y, dx, height, fillColor);
-00883     }
-00884 }
-00885 
-00892 void Bitmap::invert(int x, int y, int width, int height)
-00893 {
-00894     while (height > 0) {
-00895         for (int tempx = x + width - 1; tempx >= x; --tempx)
-00896             setPixel(tempx, y, !pixel(tempx, y));
-00897         --height;
-00898         ++y;
-00899     }
-00900 }
-00901 
-00902 void Bitmap::blit(int x1, int y1, int x2, int y2, int x3, int y3)
-00903 {
-00904     if (y3 < y1 || (y1 == y3 && x3 <= x1)) {
-00905         for (int tempy = y1; tempy <= y2; ++tempy) {
-00906             int y = y1 - tempy + y3;
-00907             int x = x3 - x1;
-00908             for (int tempx = x1; tempx <= x2; ++tempx)
-00909                 setPixel(x + tempx, y, pixel(tempx, tempy));
-00910         }
-00911     } else {
-00912         for (int tempy = y2; tempy >= y1; --tempy) {
-00913             int y = y1 - tempy + y3;
-00914             int x = x3 - x1;
-00915             for (int tempx = x2; tempx >= x1; --tempx)
-00916                 setPixel(x + tempx, y, pixel(tempx, tempy));
-00917         }
-00918     }
-00919 }
-00920 
-00921 void Bitmap::drawCirclePoints(int centerX, int centerY, int radius, int x, int y, Color borderColor, Color fillColor)
-00922 {
-00923     if (x != y) {
-00924         setPixel(centerX + x, centerY + y, borderColor);
-00925         setPixel(centerX + y, centerY + x, borderColor);
-00926         setPixel(centerX + y, centerY - x, borderColor);
-00927         setPixel(centerX + x, centerY - y, borderColor);
-00928         setPixel(centerX - x, centerY - y, borderColor);
-00929         setPixel(centerX - y, centerY - x, borderColor);
-00930         setPixel(centerX - y, centerY + x, borderColor);
-00931         setPixel(centerX - x, centerY + y, borderColor);
-00932         if (fillColor != NoFill) {
-00933             if (radius > 1) {
-00934                 drawLine(centerX - x + 1, centerY + y, centerX + x - 1, centerY + y, fillColor);
-00935                 drawLine(centerX - y + 1, centerY + x, centerX + y - 1, centerY + x, fillColor);
-00936                 drawLine(centerX - x + 1, centerY - y, centerX + x - 1, centerY - y, fillColor);
-00937                 drawLine(centerX - y + 1, centerY - x, centerX + y - 1, centerY - x, fillColor);
-00938             } else if (radius == 1) {
-00939                 setPixel(centerX, centerY, fillColor);
-00940             }
-00941         }
-00942     } else {
-00943         setPixel(centerX + x, centerY + y, borderColor);
-00944         setPixel(centerX + y, centerY - x, borderColor);
-00945         setPixel(centerX - x, centerY - y, borderColor);
-00946         setPixel(centerX - y, centerY + x, borderColor);
-00947         if (fillColor != NoFill) {
-00948             if (radius > 1) {
-00949                 drawLine(centerX - x + 1, centerY + y, centerX + x - 1, centerY + y, fillColor);
-00950                 drawLine(centerX - x + 1, centerY - y, centerX + x - 1, centerY - y, fillColor);
-00951             } else if (radius == 1) {
-00952                 setPixel(centerX, centerY, fillColor);
-00953             }
-00954         }
-00955     }
-00956 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -651,8 +77,597 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Bitmap.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Bitmap.h"
+
24 #include <WString.h>
+
25 #include <string.h>
+
26 #include <stdlib.h>
+
27 
+
88 Bitmap::Bitmap(int width, int height)
+
89  : _width(width)
+
90  , _height(height)
+
91  , _stride((width + 7) / 8)
+
92  , fb(0)
+
93  , _font(0)
+
94  , _textColor(White)
+
95 {
+
96  // Allocate memory for the framebuffer and clear it (1 = pixel off).
+
97  unsigned int size = _stride * _height;
+
98  fb = (uint8_t *)malloc(size);
+
99  if (fb)
+
100  memset(fb, 0xFF, size);
+
101 }
+
102 
+ +
107 {
+
108  if (fb)
+
109  free(fb);
+
110 }
+
111 
+
174 void Bitmap::clear(Color color)
+
175 {
+
176  unsigned int size = _stride * _height;
+
177  if (color == Black)
+
178  memset(fb, 0xFF, size);
+
179  else
+
180  memset(fb, 0x00, size);
+
181 }
+
182 
+
191 Bitmap::Color Bitmap::pixel(int x, int y) const
+
192 {
+
193  if (((unsigned int)x) >= ((unsigned int)_width) ||
+
194  ((unsigned int)y) >= ((unsigned int)_height))
+
195  return Black;
+
196  uint8_t *ptr = fb + y * _stride + (x >> 3);
+
197  if (*ptr & ((uint8_t)0x80) >> (x & 0x07))
+
198  return Black;
+
199  else
+
200  return White;
+
201 }
+
202 
+
208 void Bitmap::setPixel(int x, int y, Color color)
+
209 {
+
210  if (((unsigned int)x) >= ((unsigned int)_width) ||
+
211  ((unsigned int)y) >= ((unsigned int)_height))
+
212  return; // Pixel is off-screen.
+
213  uint8_t *ptr = fb + y * _stride + (x >> 3);
+
214  if (color)
+
215  *ptr &= ~(((uint8_t)0x80) >> (x & 0x07));
+
216  else
+
217  *ptr |= (((uint8_t)0x80) >> (x & 0x07));
+
218 }
+
219 
+
225 void Bitmap::drawLine(int x1, int y1, int x2, int y2, Color color)
+
226 {
+
227  // Midpoint line scan-conversion algorithm from "Computer Graphics:
+
228  // Principles and Practice", Second Edition, Foley, van Dam, et al.
+
229  int dx = x2 - x1;
+
230  int dy = y2 - y1;
+
231  int xstep, ystep;
+
232  int d, incrE, incrNE;
+
233  if (dx < 0) {
+
234  xstep = -1;
+
235  dx = -dx;
+
236  } else {
+
237  xstep = 1;
+
238  }
+
239  if (dy < 0) {
+
240  ystep = -1;
+
241  dy = -dy;
+
242  } else {
+
243  ystep = 1;
+
244  }
+
245  if (dx >= dy) {
+
246  d = 2 * dy - dx;
+
247  incrE = 2 * dy;
+
248  incrNE = 2 * (dy - dx);
+
249  setPixel(x1, y1, color);
+
250  while (x1 != x2) {
+
251  if (d <= 0) {
+
252  d += incrE;
+
253  } else {
+
254  d += incrNE;
+
255  y1 += ystep;
+
256  }
+
257  x1 += xstep;
+
258  setPixel(x1, y1, color);
+
259  }
+
260  } else {
+
261  d = 2 * dx - dy;
+
262  incrE = 2 * dx;
+
263  incrNE = 2 * (dx - dy);
+
264  setPixel(x1, y1, color);
+
265  while (y1 != y2) {
+
266  if (d <= 0) {
+
267  d += incrE;
+
268  } else {
+
269  d += incrNE;
+
270  x1 += xstep;
+
271  }
+
272  y1 += ystep;
+
273  setPixel(x1, y1, color);
+
274  }
+
275  }
+
276 }
+
277 
+
286 void Bitmap::drawRect(int x1, int y1, int x2, int y2, Color borderColor, Color fillColor)
+
287 {
+
288  int temp;
+
289  if (x1 > x2) {
+
290  temp = x1;
+
291  x1 = x2;
+
292  x2 = temp;
+
293  }
+
294  if (y1 > y2) {
+
295  temp = y1;
+
296  y1 = y2;
+
297  y2 = temp;
+
298  }
+
299  if (fillColor == borderColor) {
+
300  fill(x1, y1, x2 - x1 + 1, y2 - y1 + 1, fillColor);
+
301  } else {
+
302  drawLine(x1, y1, x2, y1, borderColor);
+
303  if (y1 < y2)
+
304  drawLine(x2, y1 + 1, x2, y2, borderColor);
+
305  if (x1 < x2)
+
306  drawLine(x2 - 1, y2, x1, y2, borderColor);
+
307  if (y1 < (y2 - 1))
+
308  drawLine(x1, y2 - 1, x1, y1 + 1, borderColor);
+
309  if (fillColor != NoFill)
+
310  fill(x1 + 1, y1 + 1, x2 - x1 - 1, y2 - y1 - 1, fillColor);
+
311  }
+
312 }
+
313 
+
334 void Bitmap::drawCircle(int centerX, int centerY, int radius, Color borderColor, Color fillColor)
+
335 {
+
336  // Midpoint circle scan-conversion algorithm using second-order
+
337  // differences from "Computer Graphics: Principles and Practice",
+
338  // Second Edition, Foley, van Dam, et al.
+
339  if (radius < 0)
+
340  radius = -radius;
+
341  int x = 0;
+
342  int y = radius;
+
343  int d = 1 - radius;
+
344  int deltaE = 3;
+
345  int deltaSE = 5 - 2 * radius;
+
346  drawCirclePoints(centerX, centerY, radius, x, y, borderColor, fillColor);
+
347  while (y > x) {
+
348  if (d < 0) {
+
349  d += deltaE;
+
350  deltaE += 2;
+
351  deltaSE += 2;
+
352  } else {
+
353  d += deltaSE;
+
354  deltaE += 2;
+
355  deltaSE += 4;
+
356  --y;
+
357  }
+
358  ++x;
+
359  drawCirclePoints(centerX, centerY, radius, x, y, borderColor, fillColor);
+
360  }
+
361 }
+
362 
+
388 void Bitmap::drawBitmap(int x, int y, const Bitmap &bitmap, Color color)
+
389 {
+
390  int w = bitmap.width();
+
391  int s = bitmap.stride();
+
392  int h = bitmap.height();
+
393  Color invColor = !color;
+
394  for (uint8_t by = 0; by < h; ++by) {
+
395  const uint8_t *line = bitmap.data() + by * s;
+
396  uint8_t mask = 0x80;
+
397  uint8_t value = *line++;
+
398  for (uint8_t bx = 0; bx < w; ++bx) {
+
399  if (value & mask)
+
400  setPixel(x + bx, y + by, invColor);
+
401  else
+
402  setPixel(x + bx, y + by, color);
+
403  mask >>= 1;
+
404  if (!mask) {
+
405  mask = 0x80;
+
406  value = *line++;
+
407  }
+
408  }
+
409  }
+
410 }
+
411 
+
425 void Bitmap::drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color)
+
426 {
+
427  uint8_t w = pgm_read_byte(bitmap);
+
428  uint8_t s = (w + 7) >> 3;
+
429  uint8_t h = pgm_read_byte(bitmap + 1);
+
430  Color invColor = !color;
+
431  for (uint8_t by = 0; by < h; ++by) {
+
432  const uint8_t *line = ((const uint8_t *)bitmap) + 2 + by * s;
+
433  uint8_t mask = 0x80;
+
434  uint8_t value = pgm_read_byte(line);
+
435  for (uint8_t bx = 0; bx < w; ++bx) {
+
436  if (value & mask)
+
437  setPixel(x + bx, y + by, color);
+
438  else
+
439  setPixel(x + bx, y + by, invColor);
+
440  mask >>= 1;
+
441  if (!mask) {
+
442  mask = 0x80;
+
443  ++line;
+
444  value = pgm_read_byte(line);
+
445  }
+
446  }
+
447  }
+
448 }
+
449 
+
509 #define fontIsFixed(font) (pgm_read_byte((font)) == 0 && \
+
510  pgm_read_byte((font) + 1) == 0)
+
511 #define fontWidth(font) (pgm_read_byte((font) + 2))
+
512 #define fontHeight(font) (pgm_read_byte((font) + 3))
+
513 #define fontFirstChar(font) (pgm_read_byte((font) + 4))
+
514 #define fontCharCount(font) (pgm_read_byte((font) + 5))
+
515 
+
526 void Bitmap::drawText(int x, int y, const char *str, int len)
+
527 {
+
528  if (!_font)
+
529  return;
+
530  uint8_t height = fontHeight(_font);
+
531  if (len < 0)
+
532  len = strlen(str);
+
533  while (len-- > 0) {
+
534  x += drawChar(x, y, *str++);
+
535  if (len > 0) {
+
536  fill(x, y, 1, height, !_textColor);
+
537  ++x;
+
538  }
+
539  if (x >= _width)
+
540  break;
+
541  }
+
542 }
+
543 
+
555 void Bitmap::drawText(int x, int y, const String &str, int start, int len)
+
556 {
+
557  if (!_font)
+
558  return;
+
559  uint8_t height = fontHeight(_font);
+
560  if (len < 0)
+
561  len = str.length() - start;
+
562  while (len-- > 0) {
+
563  x += drawChar(x, y, str[start++]);
+
564  if (len > 0) {
+
565  fill(x, y, 1, height, !_textColor);
+
566  ++x;
+
567  }
+
568  if (x >= _width)
+
569  break;
+
570  }
+
571 }
+
572 
+
585 int Bitmap::drawChar(int x, int y, char ch)
+
586 {
+
587  uint8_t height = fontHeight(_font);
+
588  if (ch == ' ') {
+
589  // Font may not have space, or it is zero-width. Calculate
+
590  // the real size and fill the space.
+
591  int spaceWidth = charWidth('n');
+
592  fill(x, y, spaceWidth, height, !_textColor);
+
593  return spaceWidth;
+
594  }
+
595  uint8_t first = fontFirstChar(_font);
+
596  uint8_t count = fontCharCount(_font);
+
597  uint8_t index = (uint8_t)ch;
+
598  if (index < first || index >= (first + count))
+
599  return 0;
+
600  index -= first;
+
601  uint8_t heightBytes = (height + 7) >> 3;;
+
602  uint8_t width;
+
603  const uint8_t *image;
+
604  if (fontIsFixed(_font)) {
+
605  // Fixed-width font.
+
606  width = fontWidth(_font);
+
607  image = ((const uint8_t *)_font) + 6 + index * heightBytes * width;
+
608  } else {
+
609  // Variable-width font.
+
610  width = pgm_read_byte(_font + 6 + index);
+
611  image = ((const uint8_t *)_font) + 6 + count;
+
612  for (uint8_t temp = 0; temp < index; ++temp) {
+
613  // Scan through all previous characters to find the starting
+
614  // location for this one.
+
615  image += pgm_read_byte(_font + 6 + temp) * heightBytes;
+
616  }
+
617  }
+
618  if ((x + width) <= 0 || (y + height) <= 0)
+
619  return width; // Character is off the top or left of the screen.
+
620  Color invColor = !_textColor;
+
621  for (uint8_t cx = 0; cx < width; ++cx) {
+
622  for (uint8_t cy = 0; cy < heightBytes; ++cy) {
+
623  uint8_t value = pgm_read_byte(image + cy * width + cx);
+
624  int posn;
+
625  if (heightBytes > 1 && cy == (heightBytes - 1))
+
626  posn = height - 8;
+
627  else
+
628  posn = cy * 8;
+
629  for (uint8_t bit = 0; bit < 8; ++bit) {
+
630  if ((posn + bit) >= (cy * 8) && (posn + bit) <= height) {
+
631  if (value & 0x01)
+
632  setPixel(x + cx, y + posn + bit, _textColor);
+
633  else
+
634  setPixel(x + cx, y + posn + bit, invColor);
+
635  }
+
636  value >>= 1;
+
637  }
+
638  }
+
639  }
+
640  return width;
+
641 }
+
642 
+
650 int Bitmap::charWidth(char ch) const
+
651 {
+
652  uint8_t index = (uint8_t)ch;
+
653  if (!_font)
+
654  return 0;
+
655  uint8_t first = fontFirstChar(_font);
+
656  uint8_t count = fontCharCount(_font);
+
657  if (index == ' ')
+
658  index = 'n'; // In case the font does not contain space.
+
659  if (index < first || index >= (first + count))
+
660  return 0;
+
661  if (fontIsFixed(_font))
+
662  return fontWidth(_font);
+
663  else
+
664  return pgm_read_byte(_font + 6 + (index - first));
+
665 }
+
666 
+
675 int Bitmap::textWidth(const char *str, int len) const
+
676 {
+
677  int width = 0;
+
678  if (len < 0)
+
679  len = strlen(str);
+
680  while (len-- > 0) {
+
681  width += charWidth(*str++);
+
682  if (len > 0)
+
683  ++width;
+
684  }
+
685  return width;
+
686 }
+
687 
+
697 int Bitmap::textWidth(const String &str, int start, int len) const
+
698 {
+
699  int width = 0;
+
700  if (len < 0)
+
701  len = str.length() - start;
+
702  while (len-- > 0) {
+
703  width += charWidth(str[start++]);
+
704  if (len > 0)
+
705  ++width;
+
706  }
+
707  return width;
+
708 }
+
709 
+ +
717 {
+
718  if (_font)
+
719  return fontHeight(_font);
+
720  else
+
721  return 0;
+
722 }
+
723 
+
738 void Bitmap::copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
+
739 {
+
740  if (dest == this) {
+
741  // Copying to within the same bitmap, so copy in a direction
+
742  // that will prevent problems with overlap.
+
743  blit(x, y, x + width - 1, y + height - 1, destX, destY);
+
744  } else {
+
745  // Copying to a different bitmap.
+
746  while (height > 0) {
+
747  for (int tempx = 0; tempx < width; ++tempx)
+
748  dest->setPixel(destX + tempx, destY, pixel(x + tempx, y));
+
749  ++y;
+
750  ++destY;
+
751  --height;
+
752  }
+
753  }
+
754 }
+
755 
+
762 void Bitmap::fill(int x, int y, int width, int height, Color color)
+
763 {
+
764  while (height > 0) {
+
765  for (int temp = 0; temp < width; ++temp)
+
766  setPixel(x + temp, y, color);
+
767  ++y;
+
768  --height;
+
769  }
+
770 }
+
771 
+
785 void Bitmap::fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color)
+
786 {
+
787  uint8_t w = pgm_read_byte(pattern);
+
788  uint8_t s = (w + 7) >> 3;
+
789  uint8_t h = pgm_read_byte(pattern + 1);
+
790  if (!w || !h)
+
791  return;
+
792  Color invColor = !color;
+
793  for (int tempy = 0; tempy < height; ++tempy) {
+
794  const uint8_t *startLine = ((const uint8_t *)pattern) + 2 + (tempy % h) * s;
+
795  const uint8_t *line = startLine;
+
796  uint8_t mask = 0x80;
+
797  uint8_t value = pgm_read_byte(line++);
+
798  int bit = 0;
+
799  for (int tempx = 0; tempx < width; ++tempx) {
+
800  if (value & mask)
+
801  setPixel(x + tempx, y + tempy, color);
+
802  else
+
803  setPixel(x + tempx, y + tempy, invColor);
+
804  if (++bit >= w) {
+
805  mask = 0x80;
+
806  line = startLine;
+
807  value = pgm_read_byte(line++);
+
808  bit = 0;
+
809  } else {
+
810  mask >>= 1;
+
811  if (!mask) {
+
812  mask = 0x80;
+
813  value = pgm_read_byte(line++);
+
814  }
+
815  }
+
816  }
+
817  }
+
818 }
+
819 
+
841 void Bitmap::scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor)
+
842 {
+
843  // Bail out if no scrolling at all.
+
844  if (!dx && !dy)
+
845  return;
+
846 
+
847  // Clamp the scroll region to the extents of the bitmap.
+
848  if (x < 0) {
+
849  width += x;
+
850  x = 0;
+
851  }
+
852  if (y < 0) {
+
853  height += y;
+
854  y = 0;
+
855  }
+
856  if ((x + width) > _width)
+
857  width = _width - x;
+
858  if ((y + height) > _height)
+
859  height = _height - y;
+
860  if (width <= 0 || height <= 0)
+
861  return;
+
862 
+
863  // Scroll the region in the specified direction.
+
864  if (dy < 0) {
+
865  if (dx < 0)
+
866  blit(x - dx, y - dy, x + width - 1 + dx, y + height - 1 + dy, x, y);
+
867  else
+
868  blit(x, y - dy, x + width - 1 - dx, y + height - 1 + dy, x + dx, y);
+
869  } else {
+
870  if (dx < 0)
+
871  blit(x - dx, y, x + width - 1 + dx, y + height - 1 - dy, x, y + dy);
+
872  else
+
873  blit(x, y, x + width - 1 - dx, y + height - 1 - dy, x + dx, y + dy);
+
874  }
+
875 
+
876  // Fill the pixels that were uncovered by the scroll.
+
877  if (dy < 0) {
+
878  fill(x, y + height + dy, width, -dy, fillColor);
+
879  if (dx < 0)
+
880  fill(x + width + dx, y, -dx, height + dy, fillColor);
+
881  else if (dx > 0)
+
882  fill(x, y, dx, height + dy, fillColor);
+
883  } else if (dy > 0) {
+
884  fill(x, y, width, -dy, fillColor);
+
885  if (dx < 0)
+
886  fill(x + width + dx, y + dy, -dx, height - dy, fillColor);
+
887  else if (dx > 0)
+
888  fill(x, y + dy, dx, height - dy, fillColor);
+
889  } else if (dx < 0) {
+
890  fill(x + width + dx, y, -dx, height, fillColor);
+
891  } else if (dx > 0) {
+
892  fill(x, y, dx, height, fillColor);
+
893  }
+
894 }
+
895 
+
902 void Bitmap::invert(int x, int y, int width, int height)
+
903 {
+
904  while (height > 0) {
+
905  for (int tempx = x + width - 1; tempx >= x; --tempx)
+
906  setPixel(tempx, y, !pixel(tempx, y));
+
907  --height;
+
908  ++y;
+
909  }
+
910 }
+
911 
+
912 void Bitmap::blit(int x1, int y1, int x2, int y2, int x3, int y3)
+
913 {
+
914  if (y3 < y1 || (y1 == y3 && x3 <= x1)) {
+
915  for (int tempy = y1; tempy <= y2; ++tempy) {
+
916  int y = y1 - tempy + y3;
+
917  int x = x3 - x1;
+
918  for (int tempx = x1; tempx <= x2; ++tempx)
+
919  setPixel(x + tempx, y, pixel(tempx, tempy));
+
920  }
+
921  } else {
+
922  for (int tempy = y2; tempy >= y1; --tempy) {
+
923  int y = y1 - tempy + y3;
+
924  int x = x3 - x1;
+
925  for (int tempx = x2; tempx >= x1; --tempx)
+
926  setPixel(x + tempx, y, pixel(tempx, tempy));
+
927  }
+
928  }
+
929 }
+
930 
+
931 void Bitmap::drawCirclePoints(int centerX, int centerY, int radius, int x, int y, Color borderColor, Color fillColor)
+
932 {
+
933  if (x != y) {
+
934  setPixel(centerX + x, centerY + y, borderColor);
+
935  setPixel(centerX + y, centerY + x, borderColor);
+
936  setPixel(centerX + y, centerY - x, borderColor);
+
937  setPixel(centerX + x, centerY - y, borderColor);
+
938  setPixel(centerX - x, centerY - y, borderColor);
+
939  setPixel(centerX - y, centerY - x, borderColor);
+
940  setPixel(centerX - y, centerY + x, borderColor);
+
941  setPixel(centerX - x, centerY + y, borderColor);
+
942  if (fillColor != NoFill) {
+
943  if (radius > 1) {
+
944  drawLine(centerX - x + 1, centerY + y, centerX + x - 1, centerY + y, fillColor);
+
945  drawLine(centerX - y + 1, centerY + x, centerX + y - 1, centerY + x, fillColor);
+
946  drawLine(centerX - x + 1, centerY - y, centerX + x - 1, centerY - y, fillColor);
+
947  drawLine(centerX - y + 1, centerY - x, centerX + y - 1, centerY - x, fillColor);
+
948  } else if (radius == 1) {
+
949  setPixel(centerX, centerY, fillColor);
+
950  }
+
951  }
+
952  } else {
+
953  setPixel(centerX + x, centerY + y, borderColor);
+
954  setPixel(centerX + y, centerY - x, borderColor);
+
955  setPixel(centerX - x, centerY - y, borderColor);
+
956  setPixel(centerX - y, centerY + x, borderColor);
+
957  if (fillColor != NoFill) {
+
958  if (radius > 1) {
+
959  drawLine(centerX - x + 1, centerY + y, centerX + x - 1, centerY + y, fillColor);
+
960  drawLine(centerX - x + 1, centerY - y, centerX + x - 1, centerY - y, fillColor);
+
961  } else if (radius == 1) {
+
962  setPixel(centerX, centerY, fillColor);
+
963  }
+
964  }
+
965  }
+
966 }
+
+ + diff --git a/Bitmap_8h_source.html b/Bitmap_8h_source.html index b1cb4fd8..96a50a86 100644 --- a/Bitmap_8h_source.html +++ b/Bitmap_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Bitmap.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Bitmap.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef Bitmap_h
-00024 #define Bitmap_h
-00025 
-00026 #include <inttypes.h>
-00027 #include <avr/pgmspace.h>
-00028 
-00029 class DMD;
-00030 class String;
-00031 
-00032 class Bitmap
-00033 {
-00034 public:
-00035     Bitmap(int width, int height);
-00036     ~Bitmap();
-00037 
-00038     bool isValid() const { return fb != 0; }
-00039 
-00040     typedef uint8_t Color;
-00041 
-00042     static const Color Black  = 0;
-00043     static const Color White  = 1;
-00044     static const Color NoFill = 2;
-00045 
-00046     int width() const { return _width; }
-00047     int height() const { return _height; }
-00048     int stride() const { return _stride; }
-00049     int bitsPerPixel() const { return 1; }
-00050 
-00051     uint8_t *data() { return fb; }
-00052     const uint8_t *data() const { return fb; }
-00053 
-00054     void clear(Color color = Black);
-00055 
-00056     Color pixel(int x, int y) const;
-00057     void setPixel(int x, int y, Color color);
-00058 
-00059     void drawLine(int x1, int y1, int x2, int y2, Color color = White);
-00060     void drawRect(int x1, int y1, int x2, int y2, Color borderColor = White, Color fillColor = NoFill);
-00061     void drawFilledRect(int x1, int y1, int x2, int y2, Color color = White);
-00062     void drawCircle(int centerX, int centerY, int radius, Color borderColor = White, Color fillColor = NoFill);
-00063     void drawFilledCircle(int centerX, int centerY, int radius, Color color = White);
-00064 
-00065     void drawBitmap(int x, int y, const Bitmap &bitmap, Color color = White);
-00066     void drawBitmap(int x, int y, const prog_uint8_t *bitmap, Color color = White);
-00067     void drawInvertedBitmap(int x, int y, const Bitmap &bitmap);
-00068     void drawInvertedBitmap(int x, int y, const prog_uint8_t *bitmap);
-00069 
-00070     const prog_uint8_t *font() const { return _font; }
-00071     void setFont(const prog_uint8_t *font) { _font = font; }
-00072 
-00073     Color textColor() const { return _textColor; }
-00074     void setTextColor(Color color) { _textColor = color; }
-00075 
-00076     void drawText(int x, int y, const char *str, int len = -1);
-00077     void drawText(int x, int y, const String &str, int start = 0, int len = -1);
-00078 
-00079     int drawChar(int x, int y, char ch);
-00080 
-00081     int charWidth(char ch) const;
-00082     int textWidth(const char *str, int len = -1) const;
-00083     int textWidth(const String &str, int start = 0, int len = -1) const;
-00084     int textHeight() const;
-00085 
-00086     void copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY);
-00087     void fill(int x, int y, int width, int height, Color color);
-00088     void fill(int x, int y, int width, int height, const prog_uint8_t *pattern, Color color = White);
-00089 
-00090     void scroll(int dx, int dy, Color fillColor = Black);
-00091     void scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor = Black);
-00092 
-00093     void invert(int x, int y, int width, int height);
-00094 
-00095 private:
-00096     // Disable copy constructor and operator=().
-00097     Bitmap(const Bitmap &) {}
-00098     Bitmap &operator=(const Bitmap &) { return *this; }
-00099 
-00100     int _width;
-00101     int _height;
-00102     int _stride;
-00103     uint8_t *fb;
-00104     const prog_uint8_t *_font;
-00105     Color _textColor;
-00106 
-00107     friend class DMD;
-00108 
-00109     void blit(int x1, int y1, int x2, int y2, int x3, int y3);
-00110     void drawCirclePoints(int centerX, int centerY, int radius, int x, int y, Color borderColor, Color fillColor);
-00111 };
-00112 
-00113 inline void Bitmap::drawFilledRect(int x1, int y1, int x2, int y2, Color color)
-00114 {
-00115     drawRect(x1, y1, x2, y2, color, color);
-00116 }
-00117 
-00118 inline void Bitmap::drawFilledCircle(int centerX, int centerY, int radius, Color color)
-00119 {
-00120     drawCircle(centerX, centerY, radius, color, color);
-00121 }
-00122 
-00123 inline void Bitmap::drawInvertedBitmap(int x, int y, const Bitmap &bitmap)
-00124 {
-00125     drawBitmap(x, y, bitmap, Black);
-00126 }
-00127 
-00128 inline void Bitmap::drawInvertedBitmap(int x, int y, const prog_uint8_t *bitmap)
-00129 {
-00130     drawBitmap(x, y, bitmap, Black);
-00131 }
-00132 
-00133 inline void Bitmap::scroll(int dx, int dy, Color fillColor)
-00134 {
-00135     scroll(0, 0, _width, _height, dx, dy, fillColor);
-00136 }
-00137 
-00138 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -214,8 +77,162 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Bitmap.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Bitmap_h
+
24 #define Bitmap_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <avr/pgmspace.h>
+
28 
+
29 class DMD;
+
30 class String;
+
31 
+
32 class Bitmap
+
33 {
+
34 public:
+
35  Bitmap(int width, int height);
+
36  ~Bitmap();
+
37 
+
38  bool isValid() const { return fb != 0; }
+
39 
+
40  typedef uint8_t Color;
+
41  typedef PGM_VOID_P ProgMem;
+
42  typedef PGM_VOID_P Font;
+
43 
+
44  static const Color Black = 0;
+
45  static const Color White = 1;
+
46  static const Color NoFill = 2;
+
47 
+
48  int width() const { return _width; }
+
49  int height() const { return _height; }
+
50  int stride() const { return _stride; }
+
51  int bitsPerPixel() const { return 1; }
+
52 
+
53  uint8_t *data() { return fb; }
+
54  const uint8_t *data() const { return fb; }
+
55 
+
56  void clear(Color color = Black);
+
57 
+
58  Color pixel(int x, int y) const;
+
59  void setPixel(int x, int y, Color color);
+
60 
+
61  void drawLine(int x1, int y1, int x2, int y2, Color color = White);
+
62  void drawRect(int x1, int y1, int x2, int y2, Color borderColor = White, Color fillColor = NoFill);
+
63  void drawFilledRect(int x1, int y1, int x2, int y2, Color color = White);
+
64  void drawCircle(int centerX, int centerY, int radius, Color borderColor = White, Color fillColor = NoFill);
+
65  void drawFilledCircle(int centerX, int centerY, int radius, Color color = White);
+
66 
+
67  void drawBitmap(int x, int y, const Bitmap &bitmap, Color color = White);
+
68  void drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color = White);
+
69  void drawInvertedBitmap(int x, int y, const Bitmap &bitmap);
+
70  void drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap);
+
71 
+
72  Font font() const { return _font; }
+
73  void setFont(Font font) { _font = font; }
+
74 
+
75  Color textColor() const { return _textColor; }
+
76  void setTextColor(Color color) { _textColor = color; }
+
77 
+
78  void drawText(int x, int y, const char *str, int len = -1);
+
79  void drawText(int x, int y, const String &str, int start = 0, int len = -1);
+
80 
+
81  int drawChar(int x, int y, char ch);
+
82 
+
83  int charWidth(char ch) const;
+
84  int textWidth(const char *str, int len = -1) const;
+
85  int textWidth(const String &str, int start = 0, int len = -1) const;
+
86  int textHeight() const;
+
87 
+
88  void copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY);
+
89  void fill(int x, int y, int width, int height, Color color);
+
90  void fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color = White);
+
91 
+
92  void scroll(int dx, int dy, Color fillColor = Black);
+
93  void scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor = Black);
+
94 
+
95  void invert(int x, int y, int width, int height);
+
96 
+
97 private:
+
98  // Disable copy constructor and operator=().
+
99  Bitmap(const Bitmap &) {}
+
100  Bitmap &operator=(const Bitmap &) { return *this; }
+
101 
+
102  int _width;
+
103  int _height;
+
104  int _stride;
+
105  uint8_t *fb;
+
106  Font _font;
+
107  Color _textColor;
+
108 
+
109  friend class DMD;
+
110 
+
111  void blit(int x1, int y1, int x2, int y2, int x3, int y3);
+
112  void drawCirclePoints(int centerX, int centerY, int radius, int x, int y, Color borderColor, Color fillColor);
+
113 };
+
114 
+
115 inline void Bitmap::drawFilledRect(int x1, int y1, int x2, int y2, Color color)
+
116 {
+
117  drawRect(x1, y1, x2, y2, color, color);
+
118 }
+
119 
+
120 inline void Bitmap::drawFilledCircle(int centerX, int centerY, int radius, Color color)
+
121 {
+
122  drawCircle(centerX, centerY, radius, color, color);
+
123 }
+
124 
+
125 inline void Bitmap::drawInvertedBitmap(int x, int y, const Bitmap &bitmap)
+
126 {
+
127  drawBitmap(x, y, bitmap, Black);
+
128 }
+
129 
+
130 inline void Bitmap::drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)
+
131 {
+
132  drawBitmap(x, y, bitmap, Black);
+
133 }
+
134 
+
135 inline void Bitmap::scroll(int dx, int dy, Color fillColor)
+
136 {
+
137  scroll(0, 0, _width, _height, dx, dy, fillColor);
+
138 }
+
139 
+
140 #endif
+
+ + diff --git a/BlinkLED_8cpp_source.html b/BlinkLED_8cpp_source.html index 63a00a4a..bd6ae2d7 100644 --- a/BlinkLED_8cpp_source.html +++ b/BlinkLED_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: BlinkLED.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
BlinkLED.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "BlinkLED.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 
-00064 BlinkLED::BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState)
-00065     : _pin(pin)
-00066     , _state(initialState)
-00067     , _paused(false)
-00068     , _onTime(onTime)
-00069     , _offTime(offTime)
-00070 {
-00071     pinMode(pin, OUTPUT);
-00072     digitalWrite(pin, initialState ? HIGH : LOW);
-00073     _lastChange = millis();
-00074 }
-00075 
-00079 void BlinkLED::loop()
-00080 {
-00081     if (_paused)
-00082         return;
-00083     unsigned long currentTime = millis();
-00084     if (_state) {
-00085         if ((currentTime - _lastChange) >= _onTime) {
-00086             digitalWrite(_pin, LOW);
-00087             _lastChange += _onTime;
-00088             _state = false;
-00089         }
-00090     } else {
-00091         if ((currentTime - _lastChange) >= _offTime) {
-00092             digitalWrite(_pin, HIGH);
-00093             _lastChange += _offTime;
-00094             _state = true;
-00095         }
-00096     }
-00097 }
-00098 
-00122 void BlinkLED::setBlinkRate(unsigned long onTime, unsigned long offTime)
-00123 {
-00124     _onTime = onTime;
-00125     _offTime = offTime;
-00126 }
-00127 
-00145 void BlinkLED::setState(bool state)
-00146 {
-00147     if (_state != state) {
-00148         digitalWrite(_pin, state ? HIGH : LOW);
-00149         _state = state;
-00150         _lastChange = millis();
-00151     }
-00152 }
-00153 
-00170 void BlinkLED::resume()
-00171 {
-00172     if (_paused) {
-00173         _paused = false;
-00174         unsigned long currentTime = millis();
-00175         if (_state) {
-00176             if ((currentTime - _lastChange) >= _onTime) {
-00177                 digitalWrite(_pin, LOW);
-00178                 _lastChange = currentTime;
-00179                 _state = false;
-00180             }
-00181         } else {
-00182             if ((currentTime - _lastChange) >= _offTime) {
-00183                 digitalWrite(_pin, HIGH);
-00184                 _lastChange = currentTime;
-00185                 _state = true;
-00186             }
-00187         }
-00188     }
-00189 }
-00190 
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -173,8 +77,119 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
BlinkLED.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "BlinkLED.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
64 BlinkLED::BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState)
+
65  : _pin(pin)
+
66  , _state(initialState)
+
67  , _paused(false)
+
68  , _onTime(onTime)
+
69  , _offTime(offTime)
+
70 {
+
71  pinMode(pin, OUTPUT);
+
72  digitalWrite(pin, initialState ? HIGH : LOW);
+
73  _lastChange = millis();
+
74 }
+
75 
+ +
80 {
+
81  if (_paused)
+
82  return;
+
83  unsigned long currentTime = millis();
+
84  if (_state) {
+
85  if ((currentTime - _lastChange) >= _onTime) {
+
86  digitalWrite(_pin, LOW);
+
87  _lastChange += _onTime;
+
88  _state = false;
+
89  }
+
90  } else {
+
91  if ((currentTime - _lastChange) >= _offTime) {
+
92  digitalWrite(_pin, HIGH);
+
93  _lastChange += _offTime;
+
94  _state = true;
+
95  }
+
96  }
+
97 }
+
98 
+
122 void BlinkLED::setBlinkRate(unsigned long onTime, unsigned long offTime)
+
123 {
+
124  _onTime = onTime;
+
125  _offTime = offTime;
+
126 }
+
127 
+
145 void BlinkLED::setState(bool state)
+
146 {
+
147  if (_state != state) {
+
148  digitalWrite(_pin, state ? HIGH : LOW);
+
149  _state = state;
+
150  _lastChange = millis();
+
151  }
+
152 }
+
153 
+ +
171 {
+
172  if (_paused) {
+
173  _paused = false;
+
174  unsigned long currentTime = millis();
+
175  if (_state) {
+
176  if ((currentTime - _lastChange) >= _onTime) {
+
177  digitalWrite(_pin, LOW);
+
178  _lastChange = currentTime;
+
179  _state = false;
+
180  }
+
181  } else {
+
182  if ((currentTime - _lastChange) >= _offTime) {
+
183  digitalWrite(_pin, HIGH);
+
184  _lastChange = currentTime;
+
185  _state = true;
+
186  }
+
187  }
+
188  }
+
189 }
+
190 
+
+ + diff --git a/BlinkLED_8h_source.html b/BlinkLED_8h_source.html index 053aad8f..4c750cd9 100644 --- a/BlinkLED_8h_source.html +++ b/BlinkLED_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: BlinkLED.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
BlinkLED.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef BlinkLED_h
-00024 #define BlinkLED_h
-00025 
-00026 #include <inttypes.h>
-00027 
-00028 class BlinkLED
-00029 {
-00030 public:
-00031     BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState = false);
-00032 
-00033     void loop();
-00034 
-00035     unsigned long onTime() const { return _onTime; }
-00036     unsigned long offTime() const { return _offTime; }
-00037     void setBlinkRate(unsigned long onTime, unsigned long offTime);
-00038 
-00039     bool state() const { return _state; }
-00040     void setState(bool state);
-00041 
-00042     void pause() { _paused = true; }
-00043     void resume();
-00044     bool isPaused() const { return _paused; }
-00045 
-00046 private:
-00047     uint8_t _pin;
-00048     bool _state;
-00049     bool _paused;
-00050     unsigned long _onTime;
-00051     unsigned long _offTime;
-00052     unsigned long _lastChange;
-00053 };
-00054 
-00055 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -131,8 +77,77 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
BlinkLED.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef BlinkLED_h
+
24 #define BlinkLED_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 class BlinkLED
+
29 {
+
30 public:
+
31  BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState = false);
+
32 
+
33  void loop();
+
34 
+
35  unsigned long onTime() const { return _onTime; }
+
36  unsigned long offTime() const { return _offTime; }
+
37  void setBlinkRate(unsigned long onTime, unsigned long offTime);
+
38 
+
39  bool state() const { return _state; }
+
40  void setState(bool state);
+
41 
+
42  void pause() { _paused = true; }
+
43  void resume();
+
44  bool isPaused() const { return _paused; }
+
45 
+
46 private:
+
47  uint8_t _pin;
+
48  bool _state;
+
49  bool _paused;
+
50  unsigned long _onTime;
+
51  unsigned long _offTime;
+
52  unsigned long _lastChange;
+
53 };
+
54 
+
55 #endif
+
+ + diff --git a/BoolField_8cpp_source.html b/BoolField_8cpp_source.html index 9835ca3c..f6266459 100644 --- a/BoolField_8cpp_source.html +++ b/BoolField_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: BoolField.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
BoolField.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "BoolField.h"
-00024 
-00077 BoolField::BoolField(const String &label)
-00078     : Field(label)
-00079     , _printLen(0)
-00080     , _value(false)
-00081 {
-00082 }
-00083 
-00094 BoolField::BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)
-00095     : Field(form, label)
-00096     , _trueLabel(trueLabel)
-00097     , _falseLabel(falseLabel)
-00098     , _printLen(0)
-00099     , _value(value)
-00100 {
-00101 }
-00102 
-00103 int BoolField::dispatch(int event)
-00104 {
-00105     if (event == LCD_BUTTON_UP || event == LCD_BUTTON_DOWN) {
-00106         setValue(!_value);
-00107         return FORM_CHANGED;
-00108     } else {
-00109         return -1;
-00110     }
-00111 }
-00112 
-00113 void BoolField::enterField(bool reverse)
-00114 {
-00115     Field::enterField(reverse);
-00116     printValue();
-00117 }
-00118 
-00131 void BoolField::setValue(bool value)
-00132 {
-00133     if (value != _value) {
-00134         _value = value;
-00135         if (isCurrent())
-00136             printValue();
-00137     }
-00138 }
-00139 
-00153 void BoolField::setTrueLabel(const String &trueLabel)
-00154 {
-00155     _trueLabel = trueLabel;
-00156     if (isCurrent())
-00157         printValue();
-00158 }
-00159 
-00173 void BoolField::setFalseLabel(const String &falseLabel)
-00174 {
-00175     _falseLabel = falseLabel;
-00176     if (isCurrent())
-00177         printValue();
-00178 }
-00179 
-00180 void BoolField::printValue()
-00181 {
-00182     unsigned int len;
-00183     lcd()->setCursor(0, 1);
-00184     if (_value) {
-00185         lcd()->print(_trueLabel);
-00186         len = _trueLabel.length();
-00187         while (len++ < _printLen)
-00188             lcd()->write(' ');
-00189         _printLen = _trueLabel.length();
-00190     } else {
-00191         lcd()->print(_falseLabel);
-00192         len = _falseLabel.length();
-00193         while (len++ < _printLen)
-00194             lcd()->write(' ');
-00195         _printLen = _falseLabel.length();
-00196     }
-00197 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -173,8 +77,119 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
BoolField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "BoolField.h"
+
24 
+
77 BoolField::BoolField(const String &label)
+
78  : Field(label)
+
79  , _printLen(0)
+
80  , _value(false)
+
81 {
+
82 }
+
83 
+
94 BoolField::BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)
+
95  : Field(form, label)
+
96  , _trueLabel(trueLabel)
+
97  , _falseLabel(falseLabel)
+
98  , _printLen(0)
+
99  , _value(value)
+
100 {
+
101 }
+
102 
+
103 int BoolField::dispatch(int event)
+
104 {
+
105  if (event == LCD_BUTTON_UP || event == LCD_BUTTON_DOWN) {
+
106  setValue(!_value);
+
107  return FORM_CHANGED;
+
108  } else {
+
109  return -1;
+
110  }
+
111 }
+
112 
+
113 void BoolField::enterField(bool reverse)
+
114 {
+
115  Field::enterField(reverse);
+
116  printValue();
+
117 }
+
118 
+
131 void BoolField::setValue(bool value)
+
132 {
+
133  if (value != _value) {
+
134  _value = value;
+
135  if (isCurrent())
+
136  printValue();
+
137  }
+
138 }
+
139 
+
153 void BoolField::setTrueLabel(const String &trueLabel)
+
154 {
+
155  _trueLabel = trueLabel;
+
156  if (isCurrent())
+
157  printValue();
+
158 }
+
159 
+
173 void BoolField::setFalseLabel(const String &falseLabel)
+
174 {
+
175  _falseLabel = falseLabel;
+
176  if (isCurrent())
+
177  printValue();
+
178 }
+
179 
+
180 void BoolField::printValue()
+
181 {
+
182  unsigned int len;
+
183  lcd()->setCursor(0, 1);
+
184  if (_value) {
+
185  lcd()->print(_trueLabel);
+
186  len = _trueLabel.length();
+
187  while (len++ < _printLen)
+
188  lcd()->write(' ');
+
189  _printLen = _trueLabel.length();
+
190  } else {
+
191  lcd()->print(_falseLabel);
+
192  len = _falseLabel.length();
+
193  while (len++ < _printLen)
+
194  lcd()->write(' ');
+
195  _printLen = _falseLabel.length();
+
196  }
+
197 }
+
+ + diff --git a/BoolField_8h_source.html b/BoolField_8h_source.html index ba71e447..81e3c46e 100644 --- a/BoolField_8h_source.html +++ b/BoolField_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: BoolField.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
BoolField.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef BoolField_h
-00024 #define BoolField_h
-00025 
-00026 #include "Field.h"
-00027 
-00028 class BoolField : public Field {
-00029 public:
-00030     explicit BoolField(const String &label);
-00031     BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value);
-00032 
-00033     int dispatch(int event);
-00034 
-00035     void enterField(bool reverse);
-00036 
-00037     bool value() const { return _value; }
-00038     void setValue(bool value);
-00039 
-00040     const String &trueLabel() const { return _trueLabel; }
-00041     void setTrueLabel(const String &trueLabel);
-00042 
-00043     const String &falseLabel() const { return _falseLabel; }
-00044     void setFalseLabel(const String &falseLabel);
-00045 
-00046 private:
-00047     String _trueLabel;
-00048     String _falseLabel;
-00049     int _printLen;
-00050     bool _value;
-00051 
-00052     void printValue();
-00053 };
-00054 
-00055 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -131,8 +77,77 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
BoolField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef BoolField_h
+
24 #define BoolField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 class BoolField : public Field {
+
29 public:
+
30  explicit BoolField(const String &label);
+
31  BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value);
+
32 
+
33  int dispatch(int event);
+
34 
+
35  void enterField(bool reverse);
+
36 
+
37  bool value() const { return _value; }
+
38  void setValue(bool value);
+
39 
+
40  const String &trueLabel() const { return _trueLabel; }
+
41  void setTrueLabel(const String &trueLabel);
+
42 
+
43  const String &falseLabel() const { return _falseLabel; }
+
44  void setFalseLabel(const String &falseLabel);
+
45 
+
46 private:
+
47  String _trueLabel;
+
48  String _falseLabel;
+
49  int _printLen;
+
50  bool _value;
+
51 
+
52  void printValue();
+
53 };
+
54 
+
55 #endif
+
+ + diff --git a/Charlieplex_8cpp_source.html b/Charlieplex_8cpp_source.html index 8fa5455a..2446b44e 100644 --- a/Charlieplex_8cpp_source.html +++ b/Charlieplex_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Charlieplex.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Charlieplex.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "Charlieplex.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 #include <stdlib.h>
-00030 #include <string.h>
-00031 
-00121 Charlieplex::Charlieplex(const uint8_t *pins, uint8_t numPins)
-00122     : _count(((int)numPins) * (numPins - 1))
-00123     , _lastTime(micros())
-00124     , _currentIndex(-1)
-00125     , _pwmPhase(0xC0)
-00126 {
-00127     // Determine the best hold time for 50 Hz refresh when all LED's
-00128     // are lit.  Divide it again by 4 (to get 200 Hz) to manage the
-00129     // simulated PWM in refresh().
-00130     _holdTime = 20000 / _count / 4;
-00131 
-00132     // Allocate the pin arrays and populate them.  Doing this now makes
-00133     // refresh() more efficient later, at the expense of some memory.
-00134     _pins1 = (uint8_t *)malloc(_count);
-00135     _pins2 = (uint8_t *)malloc(_count);
-00136     int n = 0;
-00137     for (uint8_t pass = 1; pass < numPins; ++pass) {
-00138         for (uint8_t pin = 0; pin < (numPins - pass); ++pin) {
-00139             _pins1[n] = _pins2[n + 1] = pins[pin];
-00140             _pins2[n] = _pins1[n + 1] = pins[pin + pass];
-00141             n += 2;
-00142         }
-00143     }
-00144 
-00145     // Allocate space for the LED value array and zero it.
-00146     _values = (uint8_t *)malloc(_count);
-00147     memset(_values, 0, _count);
-00148 
-00149     // Start with all pins configured as floating inputs (all LED's off).
-00150     for (uint8_t pin = 0; pin < numPins; ++pin) {
-00151         digitalWrite(pins[pin], LOW);
-00152         pinMode(pins[pin], INPUT);
-00153     }
-00154 }
-00155 
-00159 Charlieplex::~Charlieplex()
-00160 {
-00161     free(_pins1);
-00162     free(_pins2);
-00163     free(_values);
-00164 }
-00165 
-00277 void Charlieplex::loop()
-00278 {
-00279     unsigned long us = micros();
-00280     if ((us - _lastTime) >= _holdTime) {
-00281         _lastTime = us;
-00282         refresh();
-00283     }
-00284 }
-00285 
-00296 void Charlieplex::refresh()
-00297 {
-00298     // Find the next LED to be lit.
-00299     int prevIndex = _currentIndex;
-00300     int limit = _count;
-00301     while (limit >= 0) {
-00302         _currentIndex = (_currentIndex + 1) % _count;
-00303         if (_values[_currentIndex] != 0)
-00304             break;
-00305         --limit;
-00306     }
-00307     if (limit < 0) {
-00308         // No LED's are lit.  Turn off the previous LED and exit.
-00309         if (prevIndex != -1) {
-00310             digitalWrite(_pins1[prevIndex], LOW);
-00311             digitalWrite(_pins2[prevIndex], LOW);
-00312             pinMode(_pins1[prevIndex], INPUT);
-00313             pinMode(_pins2[prevIndex], INPUT);
-00314         }
-00315         _currentIndex = -1;
-00316         return;
-00317     }
-00318 
-00319     // Light the current LED.
-00320     uint8_t value = _values[_currentIndex];
-00321     uint8_t pin1 = _pins1[_currentIndex];
-00322     uint8_t pin2 = _pins2[_currentIndex];
-00323     _pwmPhase += 0x40;
-00324     if (prevIndex != _currentIndex) {
-00325         // Turn off the previous LED.
-00326         if (prevIndex != -1) {
-00327             digitalWrite(_pins1[prevIndex], LOW);
-00328             digitalWrite(_pins2[prevIndex], LOW);
-00329             pinMode(_pins1[prevIndex], INPUT);
-00330             pinMode(_pins2[prevIndex], INPUT);
-00331         }
-00332 
-00333         // We simulate PWM using a phase counter because analogWrite()
-00334         // combined with holdTime() causes too much flickering if more
-00335         // than one LED is lit.  This reduces the PWM resolution to 1 in 4.
-00336         pinMode(pin1, OUTPUT);
-00337         pinMode(pin2, OUTPUT);
-00338         if (value > _pwmPhase)
-00339             digitalWrite(pin1, HIGH);
-00340         else
-00341             digitalWrite(pin1, LOW);
-00342     } else {
-00343         // Same LED as previous.  Since there is only a single LED
-00344         // that is lit, we can use analogWrite() to set the PWM state.
-00345         if (value == 255)
-00346             digitalWrite(pin1, HIGH);
-00347         else
-00348             analogWrite(pin1, value);
-00349     }
-00350 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -213,8 +77,159 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Charlieplex.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Charlieplex.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 #include <stdlib.h>
+
30 #include <string.h>
+
31 
+
121 Charlieplex::Charlieplex(const uint8_t *pins, uint8_t numPins)
+
122  : _count(((int)numPins) * (numPins - 1))
+
123  , _lastTime(micros())
+
124  , _currentIndex(-1)
+
125  , _pwmPhase(0xC0)
+
126 {
+
127  // Determine the best hold time for 50 Hz refresh when all LED's
+
128  // are lit. Divide it again by 4 (to get 200 Hz) to manage the
+
129  // simulated PWM in refresh().
+
130  _holdTime = 20000 / _count / 4;
+
131 
+
132  // Allocate the pin arrays and populate them. Doing this now makes
+
133  // refresh() more efficient later, at the expense of some memory.
+
134  _pins1 = (uint8_t *)malloc(_count);
+
135  _pins2 = (uint8_t *)malloc(_count);
+
136  int n = 0;
+
137  for (uint8_t pass = 1; pass < numPins; ++pass) {
+
138  for (uint8_t pin = 0; pin < (numPins - pass); ++pin) {
+
139  _pins1[n] = _pins2[n + 1] = pins[pin];
+
140  _pins2[n] = _pins1[n + 1] = pins[pin + pass];
+
141  n += 2;
+
142  }
+
143  }
+
144 
+
145  // Allocate space for the LED value array and zero it.
+
146  _values = (uint8_t *)malloc(_count);
+
147  memset(_values, 0, _count);
+
148 
+
149  // Start with all pins configured as floating inputs (all LED's off).
+
150  for (uint8_t pin = 0; pin < numPins; ++pin) {
+
151  digitalWrite(pins[pin], LOW);
+
152  pinMode(pins[pin], INPUT);
+
153  }
+
154 }
+
155 
+ +
160 {
+
161  free(_pins1);
+
162  free(_pins2);
+
163  free(_values);
+
164 }
+
165 
+ +
278 {
+
279  unsigned long us = micros();
+
280  if ((us - _lastTime) >= _holdTime) {
+
281  _lastTime = us;
+
282  refresh();
+
283  }
+
284 }
+
285 
+ +
297 {
+
298  // Find the next LED to be lit.
+
299  int prevIndex = _currentIndex;
+
300  int limit = _count;
+
301  while (limit >= 0) {
+
302  _currentIndex = (_currentIndex + 1) % _count;
+
303  if (_values[_currentIndex] != 0)
+
304  break;
+
305  --limit;
+
306  }
+
307  if (limit < 0) {
+
308  // No LED's are lit. Turn off the previous LED and exit.
+
309  if (prevIndex != -1) {
+
310  digitalWrite(_pins1[prevIndex], LOW);
+
311  digitalWrite(_pins2[prevIndex], LOW);
+
312  pinMode(_pins1[prevIndex], INPUT);
+
313  pinMode(_pins2[prevIndex], INPUT);
+
314  }
+
315  _currentIndex = -1;
+
316  return;
+
317  }
+
318 
+
319  // Light the current LED.
+
320  uint8_t value = _values[_currentIndex];
+
321  uint8_t pin1 = _pins1[_currentIndex];
+
322  uint8_t pin2 = _pins2[_currentIndex];
+
323  _pwmPhase += 0x40;
+
324  if (prevIndex != _currentIndex) {
+
325  // Turn off the previous LED.
+
326  if (prevIndex != -1) {
+
327  digitalWrite(_pins1[prevIndex], LOW);
+
328  digitalWrite(_pins2[prevIndex], LOW);
+
329  pinMode(_pins1[prevIndex], INPUT);
+
330  pinMode(_pins2[prevIndex], INPUT);
+
331  }
+
332 
+
333  // We simulate PWM using a phase counter because analogWrite()
+
334  // combined with holdTime() causes too much flickering if more
+
335  // than one LED is lit. This reduces the PWM resolution to 1 in 4.
+
336  pinMode(pin1, OUTPUT);
+
337  pinMode(pin2, OUTPUT);
+
338  if (value > _pwmPhase)
+
339  digitalWrite(pin1, HIGH);
+
340  else
+
341  digitalWrite(pin1, LOW);
+
342  } else {
+
343  // Same LED as previous. Since there is only a single LED
+
344  // that is lit, we can use analogWrite() to set the PWM state.
+
345  if (value == 255)
+
346  digitalWrite(pin1, HIGH);
+
347  else
+
348  analogWrite(pin1, value);
+
349  }
+
350 }
+
+ + diff --git a/Charlieplex_8h_source.html b/Charlieplex_8h_source.html index 4aa6a1e8..b1516b43 100644 --- a/Charlieplex_8h_source.html +++ b/Charlieplex_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Charlieplex.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Charlieplex.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef Charlieplex_h
-00024 #define Charlieplex_h
-00025 
-00026 #include <inttypes.h>
-00027 
-00028 class Charlieplex
-00029 {
-00030 public:
-00031     Charlieplex(const uint8_t *pins, uint8_t numPins);
-00032     ~Charlieplex();
-00033 
-00034     int count() const { return _count; }
-00035 
-00036     bool led(int index) const { return _values[index] != 0; }
-00037     void setLed(int index, bool value) { _values[index] = (value ? 255 : 0); }
-00038 
-00039     uint8_t pwmLed(int index) const { return _values[index]; }
-00040     void setPwmLed(int index, uint8_t value) { _values[index] = value; }
-00041 
-00042     unsigned long holdTime() const { return _holdTime; }
-00043     void setHoldTime(unsigned long us) { _holdTime = us; }
-00044 
-00045     void loop();
-00046     void refresh();
-00047 
-00048 private:
-00049     int _count;
-00050     uint8_t *_pins1;
-00051     uint8_t *_pins2;
-00052     uint8_t *_values;
-00053     unsigned long _holdTime;
-00054     unsigned long _lastTime;
-00055     int _currentIndex;
-00056     uint8_t _pwmPhase;
-00057 };
-00058 
-00059 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -135,8 +77,81 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Charlieplex.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Charlieplex_h
+
24 #define Charlieplex_h
+
25 
+
26 #include <inttypes.h>
+
27 
+ +
29 {
+
30 public:
+
31  Charlieplex(const uint8_t *pins, uint8_t numPins);
+
32  ~Charlieplex();
+
33 
+
34  int count() const { return _count; }
+
35 
+
36  bool led(int index) const { return _values[index] != 0; }
+
37  void setLed(int index, bool value) { _values[index] = (value ? 255 : 0); }
+
38 
+
39  uint8_t pwmLed(int index) const { return _values[index]; }
+
40  void setPwmLed(int index, uint8_t value) { _values[index] = value; }
+
41 
+
42  unsigned long holdTime() const { return _holdTime; }
+
43  void setHoldTime(unsigned long us) { _holdTime = us; }
+
44 
+
45  void loop();
+
46  void refresh();
+
47 
+
48 private:
+
49  int _count;
+
50  uint8_t *_pins1;
+
51  uint8_t *_pins2;
+
52  uint8_t *_values;
+
53  unsigned long _holdTime;
+
54  unsigned long _lastTime;
+
55  int _currentIndex;
+
56  uint8_t _pwmPhase;
+
57 };
+
58 
+
59 #endif
+
+ + diff --git a/ChaseLEDs_8cpp_source.html b/ChaseLEDs_8cpp_source.html index 4b1f45ef..a60396e0 100644 --- a/ChaseLEDs_8cpp_source.html +++ b/ChaseLEDs_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: ChaseLEDs.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
ChaseLEDs.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "ChaseLEDs.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 
-00071 ChaseLEDs::ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)
-00072     : _pins(pins)
-00073     , _numPins(num)
-00074     , _currentIndex(-1)
-00075     , _advanceTime(advanceTime)
-00076     , _lastChange(millis())
-00077 {
-00078     for (uint8_t index = 0; index < _numPins; ++index) {
-00079         pinMode(_pins[index], OUTPUT);
-00080         digitalWrite(_pins[index], LOW);
-00081     }
-00082 }
-00083 
-00087 void ChaseLEDs::loop()
-00088 {
-00089     if (_currentIndex >= 0) {
-00090         if ((millis() - _lastChange) >= _advanceTime) {
-00091             // Advance to the next LED in sequence.
-00092             _currentIndex = (_currentIndex + 1) % _numPins;
-00093             _lastChange += _advanceTime;
-00094             advance(previousPin(1), _pins[_currentIndex]);
-00095         }
-00096     } else {
-00097         // First time - light the first LED.
-00098         _currentIndex = 0;
-00099         _lastChange = millis();
-00100         advance(previousPin(1), _pins[_currentIndex]);
-00101     }
-00102 }
-00103 
-00136 void ChaseLEDs::advance(uint8_t prevPin, uint8_t nextPin)
-00137 {
-00138     digitalWrite(prevPin, LOW);
-00139     digitalWrite(nextPin, HIGH);
-00140 }
-00141 
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -141,8 +77,87 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
ChaseLEDs.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "ChaseLEDs.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
71 ChaseLEDs::ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)
+
72  : _pins(pins)
+
73  , _numPins(num)
+
74  , _currentIndex(-1)
+
75  , _advanceTime(advanceTime)
+
76  , _lastChange(millis())
+
77 {
+
78  for (uint8_t index = 0; index < _numPins; ++index) {
+
79  pinMode(_pins[index], OUTPUT);
+
80  digitalWrite(_pins[index], LOW);
+
81  }
+
82 }
+
83 
+ +
88 {
+
89  if (_currentIndex >= 0) {
+
90  if ((millis() - _lastChange) >= _advanceTime) {
+
91  // Advance to the next LED in sequence.
+
92  _currentIndex = (_currentIndex + 1) % _numPins;
+
93  _lastChange += _advanceTime;
+
94  advance(previousPin(1), _pins[_currentIndex]);
+
95  }
+
96  } else {
+
97  // First time - light the first LED.
+
98  _currentIndex = 0;
+
99  _lastChange = millis();
+
100  advance(previousPin(1), _pins[_currentIndex]);
+
101  }
+
102 }
+
103 
+
136 void ChaseLEDs::advance(uint8_t prevPin, uint8_t nextPin)
+
137 {
+
138  digitalWrite(prevPin, LOW);
+
139  digitalWrite(nextPin, HIGH);
+
140 }
+
141 
+
+ + diff --git a/ChaseLEDs_8h_source.html b/ChaseLEDs_8h_source.html index e120a221..db99df74 100644 --- a/ChaseLEDs_8h_source.html +++ b/ChaseLEDs_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: ChaseLEDs.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
ChaseLEDs.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef ChaseLEDs_h
-00024 #define ChaseLEDs_h
-00025 
-00026 #include <inttypes.h>
-00027 
-00028 class ChaseLEDs
-00029 {
-00030 public:
-00031     ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime);
-00032 
-00033     void loop();
-00034 
-00035     unsigned long advanceTime() const { return _advanceTime; }
-00036     void setAdvanceTime(unsigned long advanceTime) { _advanceTime = advanceTime; }
-00037 
-00038 protected:
-00039     virtual void advance(uint8_t prevPin, uint8_t nextPin);
-00040     uint8_t previousPin(int n) const
-00041         { return _pins[(_currentIndex + _numPins - n) % _numPins]; }
-00042 
-00043 private:
-00044     const uint8_t *_pins;
-00045     int _numPins;
-00046     int _currentIndex;
-00047     unsigned long _advanceTime;
-00048     unsigned long _lastChange;
-00049 };
-00050 
-00051 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -127,8 +77,73 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
ChaseLEDs.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef ChaseLEDs_h
+
24 #define ChaseLEDs_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 class ChaseLEDs
+
29 {
+
30 public:
+
31  ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime);
+
32 
+
33  void loop();
+
34 
+
35  unsigned long advanceTime() const { return _advanceTime; }
+
36  void setAdvanceTime(unsigned long advanceTime) { _advanceTime = advanceTime; }
+
37 
+
38 protected:
+
39  virtual void advance(uint8_t prevPin, uint8_t nextPin);
+
40  uint8_t previousPin(int n) const
+
41  { return _pins[(_currentIndex + _numPins - n) % _numPins]; }
+
42 
+
43 private:
+
44  const uint8_t *_pins;
+
45  int _numPins;
+
46  int _currentIndex;
+
47  unsigned long _advanceTime;
+
48  unsigned long _lastChange;
+
49 };
+
50 
+
51 #endif
+
+ + diff --git a/DMD_8cpp_source.html b/DMD_8cpp_source.html index 520cac7e..30e75d92 100644 --- a/DMD_8cpp_source.html +++ b/DMD_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DMD.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DMD.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "DMD.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 #include <pins_arduino.h>
-00030 #include <avr/io.h>
-00031 #include <avr/interrupt.h>
-00032 #include <string.h>
-00033 #include <stdlib.h>
-00034 
-00210 // Pins on the DMD connector board.
-00211 #define DMD_PIN_PHASE_LSB       6       // A
-00212 #define DMD_PIN_PHASE_MSB       7       // B
-00213 #define DMD_PIN_LATCH           8       // SCLK
-00214 #define DMD_PIN_OUTPUT_ENABLE   9       // nOE
-00215 #define DMD_PIN_SPI_SS          SS      // SPI Slave Select
-00216 #define DMD_PIN_SPI_MOSI        MOSI    // SPI Master Out, Slave In (R)
-00217 #define DMD_PIN_SPI_MISO        MISO    // SPI Master In, Slave Out
-00218 #define DMD_PIN_SPI_SCK         SCK     // SPI Serial Clock (CLK)
-00219 
-00220 // Dimension information for the display.
-00221 #define DMD_NUM_COLUMNS         32      // Number of columns in a panel.
-00222 #define DMD_NUM_ROWS            16      // Number of rows in a panel.
-00223 
-00224 // Refresh times.
-00225 #define DMD_REFRESH_MS          5
-00226 #define DMD_REFRESH_US          5000
-00227 
-00237 DMD::DMD(int widthPanels, int heightPanels)
-00238     : Bitmap(widthPanels * DMD_NUM_COLUMNS, heightPanels * DMD_NUM_ROWS)
-00239     , _doubleBuffer(false)
-00240     , phase(0)
-00241     , fb0(0)
-00242     , fb1(0)
-00243     , displayfb(0)
-00244     , lastRefresh(millis())
-00245 {
-00246     // Both rendering and display are to fb0 initially.
-00247     fb0 = displayfb = fb;
-00248 
-00249     // Initialize SPI to MSB-first, mode 0, clock divider = 2.
-00250     pinMode(DMD_PIN_SPI_SCK, OUTPUT);
-00251     pinMode(DMD_PIN_SPI_MOSI, OUTPUT);
-00252     pinMode(DMD_PIN_SPI_SS, OUTPUT);
-00253     digitalWrite(DMD_PIN_SPI_SCK, LOW);
-00254     digitalWrite(DMD_PIN_SPI_MOSI, LOW);
-00255     digitalWrite(DMD_PIN_SPI_SS, HIGH);
-00256     SPCR |= _BV(MSTR);
-00257     SPCR |= _BV(SPE);
-00258     SPCR &= ~(_BV(DORD));   // MSB-first
-00259     SPCR &= ~0x0C;          // Mode 0
-00260     SPCR &= ~0x03;          // Clock divider rate 2
-00261     SPSR |= 0x01;           // MSB of clock divider rate
-00262 
-00263     // Initialize the DMD-specific pins.
-00264     pinMode(DMD_PIN_PHASE_LSB, OUTPUT);
-00265     pinMode(DMD_PIN_PHASE_MSB, OUTPUT);
-00266     pinMode(DMD_PIN_LATCH, OUTPUT);
-00267     pinMode(DMD_PIN_OUTPUT_ENABLE, OUTPUT);
-00268     digitalWrite(DMD_PIN_PHASE_LSB, LOW);
-00269     digitalWrite(DMD_PIN_PHASE_MSB, LOW);
-00270     digitalWrite(DMD_PIN_LATCH, LOW);
-00271     digitalWrite(DMD_PIN_OUTPUT_ENABLE, LOW);
-00272     digitalWrite(DMD_PIN_SPI_MOSI, HIGH);
-00273 }
-00274 
-00278 DMD::~DMD()
-00279 {
-00280     if (fb0)
-00281         free(fb0);
-00282     if (fb1)
-00283         free(fb1);
-00284     fb = 0; // Don't free the buffer again in the base class.
-00285 }
-00286 
-00314 void DMD::setDoubleBuffer(bool doubleBuffer)
-00315 {
-00316     if (doubleBuffer != _doubleBuffer) {
-00317         _doubleBuffer = doubleBuffer;
-00318         if (doubleBuffer) {
-00319             // Allocate a new back buffer.
-00320             unsigned int size = _stride * _height;
-00321             fb1 = (uint8_t *)malloc(size);
-00322 
-00323             // Clear the new back buffer and then switch to it, leaving
-00324             // the current contents of fb0 on the screen.
-00325             if (fb1) {
-00326                 memset(fb1, 0xFF, size);
-00327                 cli();
-00328                 fb = fb1;
-00329                 displayfb = fb0;
-00330                 sei();
-00331             } else {
-00332                 // Failed to allocate the memory, so revert to single-buffered.
-00333                 _doubleBuffer = false;
-00334             }
-00335         } else if (fb1) {
-00336             // Disabling double-buffering, so forcibly switch to fb0.
-00337             cli();
-00338             fb = fb0;
-00339             displayfb = fb0;
-00340             sei();
-00341 
-00342             // Free the unnecessary buffer.
-00343             free(fb1);
-00344             fb1 = 0;
-00345         }
-00346     }
-00347 }
-00348 
-00363 void DMD::swapBuffers()
-00364 {
-00365     if (_doubleBuffer) {
-00366         // Turn off interrupts while swapping buffers so that we don't
-00367         // accidentally try to refresh() in the middle of this code.
-00368         cli();
-00369         if (fb == fb0) {
-00370             fb = fb1;
-00371             displayfb = fb0;
-00372         } else {
-00373             fb = fb0;
-00374             displayfb = fb1;
-00375         }
-00376         sei();
-00377     }
-00378 }
-00379 
-00396 void DMD::swapBuffersAndCopy()
-00397 {
-00398     swapBuffers();
-00399     if (_doubleBuffer)
-00400         memcpy(fb, displayfb, _stride * _height);
-00401 }
-00402 
-00420 void DMD::loop()
-00421 {
-00422     unsigned long currentTime = millis();
-00423     if ((currentTime - lastRefresh) >= DMD_REFRESH_MS) {
-00424         lastRefresh = currentTime;
-00425         refresh();
-00426     }
-00427 }
-00428 
-00429 // Send a single byte via SPI.
-00430 static inline void spiSend(byte value)
-00431 {
-00432     SPDR = value;
-00433     while (!(SPSR & _BV(SPIF)))
-00434         ;   // Wait for the transfer to complete.
-00435 }
-00436 
-00437 // Flip the bits in a byte.  Table generated by genflip.c
-00438 static const uint8_t flipBits[256] PROGMEM = {
-00439     0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0,
-00440     0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
-00441     0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4,
-00442     0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
-00443     0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC,
-00444     0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2,
-00445     0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA,
-00446     0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
-00447     0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6,
-00448     0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE,
-00449     0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1,
-00450     0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
-00451     0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9,
-00452     0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5,
-00453     0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD,
-00454     0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
-00455     0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3,
-00456     0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB,
-00457     0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7,
-00458     0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
-00459     0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF,
-00460     0x3F, 0xBF, 0x7F, 0xFF
-00461 };
-00462 
-00478 void DMD::refresh()
-00479 {
-00480     // Bail out if there is a conflict on the SPI bus.
-00481     if (!digitalRead(DMD_PIN_SPI_SS))
-00482         return;
-00483 
-00484     // Transfer the data for the next group of interleaved rows.
-00485     int stride4 = _stride * 4;
-00486     uint8_t *data0;
-00487     uint8_t *data1;
-00488     uint8_t *data2;
-00489     uint8_t *data3;
-00490     bool flipRow = ((_height & 0x10) == 0);
-00491     for (int y = 0; y < _height; y += 16) {
-00492         if (!flipRow) {
-00493             // The panels in this row are the right way up.
-00494             data0 = displayfb + _stride * (y + phase);
-00495             data1 = data0 + stride4;
-00496             data2 = data1 + stride4;
-00497             data3 = data2 + stride4;
-00498             for (int x = _stride; x > 0; --x) {
-00499                 spiSend(*data3++);
-00500                 spiSend(*data2++);
-00501                 spiSend(*data1++);
-00502                 spiSend(*data0++);
-00503             }
-00504             flipRow = true;
-00505         } else {
-00506             // The panels in this row are upside-down and reversed.
-00507             data0 = displayfb + _stride * (y + 16 - phase) - 1;
-00508             data1 = data0 - stride4;
-00509             data2 = data1 - stride4;
-00510             data3 = data2 - stride4;
-00511             for (int x = _stride; x > 0; --x) {
-00512                 spiSend(pgm_read_byte(&(flipBits[*data3--])));
-00513                 spiSend(pgm_read_byte(&(flipBits[*data2--])));
-00514                 spiSend(pgm_read_byte(&(flipBits[*data1--])));
-00515                 spiSend(pgm_read_byte(&(flipBits[*data0--])));
-00516             }
-00517             flipRow = false;
-00518         }
-00519     }
-00520 
-00521     // Latch the data from the shift registers onto the actual display.
-00522     digitalWrite(DMD_PIN_OUTPUT_ENABLE, LOW);
-00523     digitalWrite(DMD_PIN_LATCH, HIGH);
-00524     digitalWrite(DMD_PIN_LATCH, LOW);
-00525     if (phase & 0x02)
-00526         digitalWrite(DMD_PIN_PHASE_MSB, HIGH);
-00527     else
-00528         digitalWrite(DMD_PIN_PHASE_MSB, LOW);
-00529     if (phase & 0x01)
-00530         digitalWrite(DMD_PIN_PHASE_LSB, HIGH);
-00531     else
-00532         digitalWrite(DMD_PIN_PHASE_LSB, LOW);
-00533     digitalWrite(DMD_PIN_OUTPUT_ENABLE, HIGH);
-00534     phase = (phase + 1) & 0x03;
-00535 }
-00536 
-00563 void DMD::enableTimer1()
-00564 {
-00565     // Number of CPU cycles in the display's refresh period.
-00566     unsigned long numCycles = (F_CPU / 2000000) * DMD_REFRESH_US;
-00567 
-00568     // Determine the prescaler to be used.
-00569     #define TIMER1_RESOLUTION  65536UL
-00570     uint8_t prescaler;
-00571     if (numCycles < TIMER1_RESOLUTION) {
-00572         // No prescaling required.
-00573         prescaler = _BV(CS10);
-00574     } else if (numCycles < TIMER1_RESOLUTION * 8) {
-00575         // Prescaler = 8.
-00576         prescaler = _BV(CS11);
-00577         numCycles >>= 3;
-00578     } else if (numCycles < TIMER1_RESOLUTION * 64) {
-00579         // Prescaler = 64.
-00580         prescaler = _BV(CS11) | _BV(CS10);
-00581         numCycles >>= 6;
-00582     } else if (numCycles < TIMER1_RESOLUTION * 256) {
-00583         // Prescaler = 256.
-00584         prescaler = _BV(CS12);
-00585         numCycles >>= 8;
-00586     } else if (numCycles < TIMER1_RESOLUTION * 1024) {
-00587         // Prescaler = 1024.
-00588         prescaler = _BV(CS12) | _BV(CS10);
-00589         numCycles >>= 10;
-00590     } else {
-00591         // Too long, so set the maximum timeout.
-00592         prescaler = _BV(CS12) | _BV(CS10);
-00593         numCycles = TIMER1_RESOLUTION - 1;
-00594     }
-00595 
-00596     // Configure Timer1 for the period we want.
-00597     TCCR1A = 0;
-00598     TCCR1B = _BV(WGM13);
-00599     uint8_t saveSREG = SREG;
-00600     cli();
-00601     ICR1 = numCycles;
-00602     SREG = saveSREG;    // Implicit sei() if interrupts were on previously.
-00603     TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11) | _BV(CS10))) | prescaler;
-00604 
-00605     // Turn on the Timer1 overflow interrupt.
-00606     TIMSK1 |= _BV(TOIE1);
-00607 }
-00608 
-00614 void DMD::disableTimer1()
-00615 {
-00616     // Turn off the Timer1 overflow interrupt.
-00617     TIMSK1 &= ~_BV(TOIE1);
-00618 }
-00619 
-00646 void DMD::enableTimer2()
-00647 {
-00648     // Configure Timer2 for the period we want.  With the prescaler set
-00649     // to 128, then 256 increments of Timer2 gives roughly 4 ms between
-00650     // overflows on a system with a 16 MHz clock.  We adjust the prescaler
-00651     // accordingly for other clock frequencies.
-00652     TCCR2A = 0;
-00653     if (F_CPU >= 32000000)
-00654         TCCR2B = _BV(CS22) | _BV(CS21); // Prescaler = 256
-00655     else if (F_CPU >= 16000000)
-00656         TCCR2B = _BV(CS22) | _BV(CS20); // Prescaler = 128
-00657     else if (F_CPU >= 8000000)
-00658         TCCR2B = _BV(CS22);             // Prescaler = 64
-00659     else
-00660         TCCR2B = _BV(CS21) | _BV(CS20); // Prescaler = 32
-00661 
-00662     // Reset Timer2 to kick off the process.
-00663     TCNT2 = 0;
-00664 
-00665     // Turn on the Timer2 overflow interrupt (also turn off OCIE2A and OCIE2B).
-00666     TIMSK2 = _BV(TOIE2);
-00667 }
-00668 
-00674 void DMD::disableTimer2()
-00675 {
-00676     // Turn off the Timer2 overflow interrupt.
-00677     TIMSK2 &= ~_BV(TOIE2);
-00678 }
-00679 
-00690 DMD::Color DMD::fromRGB(uint8_t r, uint8_t g, uint8_t b)
-00691 {
-00692     if (r || g || b)
-00693         return White;
-00694     else
-00695         return Black;
-00696 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -424,8 +77,370 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DMD.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "DMD.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 #include <pins_arduino.h>
+
30 #include <avr/io.h>
+
31 #include <avr/interrupt.h>
+
32 #include <string.h>
+
33 #include <stdlib.h>
+
34 
+
210 // Pins on the DMD connector board.
+
211 #define DMD_PIN_PHASE_LSB 6 // A
+
212 #define DMD_PIN_PHASE_MSB 7 // B
+
213 #define DMD_PIN_LATCH 8 // SCLK
+
214 #define DMD_PIN_OUTPUT_ENABLE 9 // nOE
+
215 #define DMD_PIN_SPI_SS SS // SPI Slave Select
+
216 #define DMD_PIN_SPI_MOSI MOSI // SPI Master Out, Slave In (R)
+
217 #define DMD_PIN_SPI_MISO MISO // SPI Master In, Slave Out
+
218 #define DMD_PIN_SPI_SCK SCK // SPI Serial Clock (CLK)
+
219 
+
220 // Dimension information for the display.
+
221 #define DMD_NUM_COLUMNS 32 // Number of columns in a panel.
+
222 #define DMD_NUM_ROWS 16 // Number of rows in a panel.
+
223 
+
224 // Refresh times.
+
225 #define DMD_REFRESH_MS 5
+
226 #define DMD_REFRESH_US 5000
+
227 
+
237 DMD::DMD(int widthPanels, int heightPanels)
+
238  : Bitmap(widthPanels * DMD_NUM_COLUMNS, heightPanels * DMD_NUM_ROWS)
+
239  , _doubleBuffer(false)
+
240  , phase(0)
+
241  , fb0(0)
+
242  , fb1(0)
+
243  , displayfb(0)
+
244  , lastRefresh(millis())
+
245 {
+
246  // Both rendering and display are to fb0 initially.
+
247  fb0 = displayfb = fb;
+
248 
+
249  // Initialize SPI to MSB-first, mode 0, clock divider = 2.
+
250  pinMode(DMD_PIN_SPI_SCK, OUTPUT);
+
251  pinMode(DMD_PIN_SPI_MOSI, OUTPUT);
+
252  pinMode(DMD_PIN_SPI_SS, OUTPUT);
+
253  digitalWrite(DMD_PIN_SPI_SCK, LOW);
+
254  digitalWrite(DMD_PIN_SPI_MOSI, LOW);
+
255  digitalWrite(DMD_PIN_SPI_SS, HIGH);
+
256  SPCR |= _BV(MSTR);
+
257  SPCR |= _BV(SPE);
+
258  SPCR &= ~(_BV(DORD)); // MSB-first
+
259  SPCR &= ~0x0C; // Mode 0
+
260  SPCR &= ~0x03; // Clock divider rate 2
+
261  SPSR |= 0x01; // MSB of clock divider rate
+
262 
+
263  // Initialize the DMD-specific pins.
+
264  pinMode(DMD_PIN_PHASE_LSB, OUTPUT);
+
265  pinMode(DMD_PIN_PHASE_MSB, OUTPUT);
+
266  pinMode(DMD_PIN_LATCH, OUTPUT);
+
267  pinMode(DMD_PIN_OUTPUT_ENABLE, OUTPUT);
+
268  digitalWrite(DMD_PIN_PHASE_LSB, LOW);
+
269  digitalWrite(DMD_PIN_PHASE_MSB, LOW);
+
270  digitalWrite(DMD_PIN_LATCH, LOW);
+
271  digitalWrite(DMD_PIN_OUTPUT_ENABLE, LOW);
+
272  digitalWrite(DMD_PIN_SPI_MOSI, HIGH);
+
273 }
+
274 
+ +
279 {
+
280  if (fb0)
+
281  free(fb0);
+
282  if (fb1)
+
283  free(fb1);
+
284  fb = 0; // Don't free the buffer again in the base class.
+
285 }
+
286 
+
314 void DMD::setDoubleBuffer(bool doubleBuffer)
+
315 {
+
316  if (doubleBuffer != _doubleBuffer) {
+
317  _doubleBuffer = doubleBuffer;
+
318  if (doubleBuffer) {
+
319  // Allocate a new back buffer.
+
320  unsigned int size = _stride * _height;
+
321  fb1 = (uint8_t *)malloc(size);
+
322 
+
323  // Clear the new back buffer and then switch to it, leaving
+
324  // the current contents of fb0 on the screen.
+
325  if (fb1) {
+
326  memset(fb1, 0xFF, size);
+
327  cli();
+
328  fb = fb1;
+
329  displayfb = fb0;
+
330  sei();
+
331  } else {
+
332  // Failed to allocate the memory, so revert to single-buffered.
+
333  _doubleBuffer = false;
+
334  }
+
335  } else if (fb1) {
+
336  // Disabling double-buffering, so forcibly switch to fb0.
+
337  cli();
+
338  fb = fb0;
+
339  displayfb = fb0;
+
340  sei();
+
341 
+
342  // Free the unnecessary buffer.
+
343  free(fb1);
+
344  fb1 = 0;
+
345  }
+
346  }
+
347 }
+
348 
+ +
364 {
+
365  if (_doubleBuffer) {
+
366  // Turn off interrupts while swapping buffers so that we don't
+
367  // accidentally try to refresh() in the middle of this code.
+
368  cli();
+
369  if (fb == fb0) {
+
370  fb = fb1;
+
371  displayfb = fb0;
+
372  } else {
+
373  fb = fb0;
+
374  displayfb = fb1;
+
375  }
+
376  sei();
+
377  }
+
378 }
+
379 
+ +
397 {
+
398  swapBuffers();
+
399  if (_doubleBuffer)
+
400  memcpy(fb, displayfb, _stride * _height);
+
401 }
+
402 
+
420 void DMD::loop()
+
421 {
+
422  unsigned long currentTime = millis();
+
423  if ((currentTime - lastRefresh) >= DMD_REFRESH_MS) {
+
424  lastRefresh = currentTime;
+
425  refresh();
+
426  }
+
427 }
+
428 
+
429 // Send a single byte via SPI.
+
430 static inline void spiSend(byte value)
+
431 {
+
432  SPDR = value;
+
433  while (!(SPSR & _BV(SPIF)))
+
434  ; // Wait for the transfer to complete.
+
435 }
+
436 
+
437 // Flip the bits in a byte. Table generated by genflip.c
+
438 static const uint8_t flipBits[256] PROGMEM = {
+
439  0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0,
+
440  0x30, 0xB0, 0x70, 0xF0, 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8,
+
441  0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, 0x04, 0x84, 0x44, 0xC4,
+
442  0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4,
+
443  0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC,
+
444  0x3C, 0xBC, 0x7C, 0xFC, 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2,
+
445  0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, 0x0A, 0x8A, 0x4A, 0xCA,
+
446  0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA,
+
447  0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6,
+
448  0x36, 0xB6, 0x76, 0xF6, 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE,
+
449  0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, 0x01, 0x81, 0x41, 0xC1,
+
450  0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1,
+
451  0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9,
+
452  0x39, 0xB9, 0x79, 0xF9, 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5,
+
453  0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, 0x0D, 0x8D, 0x4D, 0xCD,
+
454  0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
+
455  0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3,
+
456  0x33, 0xB3, 0x73, 0xF3, 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB,
+
457  0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, 0x07, 0x87, 0x47, 0xC7,
+
458  0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7,
+
459  0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF,
+
460  0x3F, 0xBF, 0x7F, 0xFF
+
461 };
+
462 
+ +
479 {
+
480  // Bail out if there is a conflict on the SPI bus.
+
481  if (!digitalRead(DMD_PIN_SPI_SS))
+
482  return;
+
483 
+
484  // Transfer the data for the next group of interleaved rows.
+
485  int stride4 = _stride * 4;
+
486  uint8_t *data0;
+
487  uint8_t *data1;
+
488  uint8_t *data2;
+
489  uint8_t *data3;
+
490  bool flipRow = ((_height & 0x10) == 0);
+
491  for (int y = 0; y < _height; y += 16) {
+
492  if (!flipRow) {
+
493  // The panels in this row are the right way up.
+
494  data0 = displayfb + _stride * (y + phase);
+
495  data1 = data0 + stride4;
+
496  data2 = data1 + stride4;
+
497  data3 = data2 + stride4;
+
498  for (int x = _stride; x > 0; --x) {
+
499  spiSend(*data3++);
+
500  spiSend(*data2++);
+
501  spiSend(*data1++);
+
502  spiSend(*data0++);
+
503  }
+
504  flipRow = true;
+
505  } else {
+
506  // The panels in this row are upside-down and reversed.
+
507  data0 = displayfb + _stride * (y + 16 - phase) - 1;
+
508  data1 = data0 - stride4;
+
509  data2 = data1 - stride4;
+
510  data3 = data2 - stride4;
+
511  for (int x = _stride; x > 0; --x) {
+
512  spiSend(pgm_read_byte(&(flipBits[*data3--])));
+
513  spiSend(pgm_read_byte(&(flipBits[*data2--])));
+
514  spiSend(pgm_read_byte(&(flipBits[*data1--])));
+
515  spiSend(pgm_read_byte(&(flipBits[*data0--])));
+
516  }
+
517  flipRow = false;
+
518  }
+
519  }
+
520 
+
521  // Latch the data from the shift registers onto the actual display.
+
522  digitalWrite(DMD_PIN_OUTPUT_ENABLE, LOW);
+
523  digitalWrite(DMD_PIN_LATCH, HIGH);
+
524  digitalWrite(DMD_PIN_LATCH, LOW);
+
525  if (phase & 0x02)
+
526  digitalWrite(DMD_PIN_PHASE_MSB, HIGH);
+
527  else
+
528  digitalWrite(DMD_PIN_PHASE_MSB, LOW);
+
529  if (phase & 0x01)
+
530  digitalWrite(DMD_PIN_PHASE_LSB, HIGH);
+
531  else
+
532  digitalWrite(DMD_PIN_PHASE_LSB, LOW);
+
533  digitalWrite(DMD_PIN_OUTPUT_ENABLE, HIGH);
+
534  phase = (phase + 1) & 0x03;
+
535 }
+
536 
+ +
564 {
+
565  // Number of CPU cycles in the display's refresh period.
+
566  unsigned long numCycles = (F_CPU / 2000000) * DMD_REFRESH_US;
+
567 
+
568  // Determine the prescaler to be used.
+
569  #define TIMER1_RESOLUTION 65536UL
+
570  uint8_t prescaler;
+
571  if (numCycles < TIMER1_RESOLUTION) {
+
572  // No prescaling required.
+
573  prescaler = _BV(CS10);
+
574  } else if (numCycles < TIMER1_RESOLUTION * 8) {
+
575  // Prescaler = 8.
+
576  prescaler = _BV(CS11);
+
577  numCycles >>= 3;
+
578  } else if (numCycles < TIMER1_RESOLUTION * 64) {
+
579  // Prescaler = 64.
+
580  prescaler = _BV(CS11) | _BV(CS10);
+
581  numCycles >>= 6;
+
582  } else if (numCycles < TIMER1_RESOLUTION * 256) {
+
583  // Prescaler = 256.
+
584  prescaler = _BV(CS12);
+
585  numCycles >>= 8;
+
586  } else if (numCycles < TIMER1_RESOLUTION * 1024) {
+
587  // Prescaler = 1024.
+
588  prescaler = _BV(CS12) | _BV(CS10);
+
589  numCycles >>= 10;
+
590  } else {
+
591  // Too long, so set the maximum timeout.
+
592  prescaler = _BV(CS12) | _BV(CS10);
+
593  numCycles = TIMER1_RESOLUTION - 1;
+
594  }
+
595 
+
596  // Configure Timer1 for the period we want.
+
597  TCCR1A = 0;
+
598  TCCR1B = _BV(WGM13);
+
599  uint8_t saveSREG = SREG;
+
600  cli();
+
601  ICR1 = numCycles;
+
602  SREG = saveSREG; // Implicit sei() if interrupts were on previously.
+
603  TCCR1B = (TCCR1B & ~(_BV(CS12) | _BV(CS11) | _BV(CS10))) | prescaler;
+
604 
+
605  // Turn on the Timer1 overflow interrupt.
+
606  TIMSK1 |= _BV(TOIE1);
+
607 }
+
608 
+ +
615 {
+
616  // Turn off the Timer1 overflow interrupt.
+
617  TIMSK1 &= ~_BV(TOIE1);
+
618 }
+
619 
+ +
647 {
+
648  // Configure Timer2 for the period we want. With the prescaler set
+
649  // to 128, then 256 increments of Timer2 gives roughly 4 ms between
+
650  // overflows on a system with a 16 MHz clock. We adjust the prescaler
+
651  // accordingly for other clock frequencies.
+
652  TCCR2A = 0;
+
653  if (F_CPU >= 32000000)
+
654  TCCR2B = _BV(CS22) | _BV(CS21); // Prescaler = 256
+
655  else if (F_CPU >= 16000000)
+
656  TCCR2B = _BV(CS22) | _BV(CS20); // Prescaler = 128
+
657  else if (F_CPU >= 8000000)
+
658  TCCR2B = _BV(CS22); // Prescaler = 64
+
659  else
+
660  TCCR2B = _BV(CS21) | _BV(CS20); // Prescaler = 32
+
661 
+
662  // Reset Timer2 to kick off the process.
+
663  TCNT2 = 0;
+
664 
+
665  // Turn on the Timer2 overflow interrupt (also turn off OCIE2A and OCIE2B).
+
666  TIMSK2 = _BV(TOIE2);
+
667 }
+
668 
+ +
675 {
+
676  // Turn off the Timer2 overflow interrupt.
+
677  TIMSK2 &= ~_BV(TOIE2);
+
678 }
+
679 
+
690 DMD::Color DMD::fromRGB(uint8_t r, uint8_t g, uint8_t b)
+
691 {
+
692  if (r || g || b)
+
693  return White;
+
694  else
+
695  return Black;
+
696 }
+
+ + diff --git a/DMD_8h_source.html b/DMD_8h_source.html index 43396f1c..7986e95b 100644 --- a/DMD_8h_source.html +++ b/DMD_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DMD.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DMD.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef DMD_h
-00024 #define DMD_h
-00025 
-00026 #include "Bitmap.h"
-00027 
-00028 class DMD : public Bitmap
-00029 {
-00030 public:
-00031     explicit DMD(int widthPanels = 1, int heightPanels = 1);
-00032     ~DMD();
-00033 
-00034     bool doubleBuffer() const { return _doubleBuffer; }
-00035     void setDoubleBuffer(bool doubleBuffer);
-00036     void swapBuffers();
-00037     void swapBuffersAndCopy();
-00038 
-00039     void loop();
-00040     void refresh();
-00041 
-00042     void enableTimer1();
-00043     void disableTimer1();
-00044 
-00045     void enableTimer2();
-00046     void disableTimer2();
-00047 
-00048     static Color fromRGB(uint8_t r, uint8_t g, uint8_t b);
-00049 
-00050 private:
-00051     // Disable copy constructor and operator=().
-00052     DMD(const DMD &other) : Bitmap(other) {}
-00053     DMD &operator=(const DMD &) { return *this; }
-00054 
-00055     bool _doubleBuffer;
-00056     uint8_t phase;
-00057     uint8_t *fb0;
-00058     uint8_t *fb1;
-00059     uint8_t *displayfb;
-00060     unsigned long lastRefresh;
-00061 };
-00062 
-00063 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -139,8 +77,85 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DMD.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef DMD_h
+
24 #define DMD_h
+
25 
+
26 #include "Bitmap.h"
+
27 
+
28 class DMD : public Bitmap
+
29 {
+
30 public:
+
31  explicit DMD(int widthPanels = 1, int heightPanels = 1);
+
32  ~DMD();
+
33 
+
34  bool doubleBuffer() const { return _doubleBuffer; }
+
35  void setDoubleBuffer(bool doubleBuffer);
+
36  void swapBuffers();
+
37  void swapBuffersAndCopy();
+
38 
+
39  void loop();
+
40  void refresh();
+
41 
+
42  void enableTimer1();
+
43  void disableTimer1();
+
44 
+
45  void enableTimer2();
+
46  void disableTimer2();
+
47 
+
48  static Color fromRGB(uint8_t r, uint8_t g, uint8_t b);
+
49 
+
50 private:
+
51  // Disable copy constructor and operator=().
+
52  DMD(const DMD &other) : Bitmap(other) {}
+
53  DMD &operator=(const DMD &) { return *this; }
+
54 
+
55  bool _doubleBuffer;
+
56  uint8_t phase;
+
57  uint8_t *fb0;
+
58  uint8_t *fb1;
+
59  uint8_t *displayfb;
+
60  unsigned long lastRefresh;
+
61 };
+
62 
+
63 #endif
+
+ + diff --git a/DS1307RTC_8cpp_source.html b/DS1307RTC_8cpp_source.html index 59c145b9..dd2a90c1 100644 --- a/DS1307RTC_8cpp_source.html +++ b/DS1307RTC_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DS1307RTC.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DS1307RTC.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "DS1307RTC.h"
-00024 #include "../I2C/I2CMaster.h"
-00025 #if defined(ARDUINO) && ARDUINO >= 100
-00026 #include <Arduino.h>
-00027 #else
-00028 #include <WProgram.h>
-00029 #endif
-00030 
-00054 // I2C address of the RTC chip (7-bit).
-00055 #define DS1307_I2C_ADDRESS  0x68
-00056 
-00057 // Registers.
-00058 #define DS1307_SECOND       0x00
-00059 #define DS1307_MINUTE       0x01
-00060 #define DS1307_HOUR         0x02
-00061 #define DS1307_DAY_OF_WEEK  0x03
-00062 #define DS1307_DATE         0x04
-00063 #define DS1307_MONTH        0x05
-00064 #define DS1307_YEAR         0x06
-00065 #define DS1307_CONTROL      0x07
-00066 #define DS1307_NVRAM        0x08
-00067 
-00068 // Alarm storage at the end of the RTC's NVRAM.
-00069 #define DS1307_ALARM_SIZE   3
-00070 #define DS1307_ALARMS       (64 - RTC::ALARM_COUNT * DS1307_ALARM_SIZE - 1)
-00071 #define DS1307_ALARM_MAGIC  63
-00072 
-00083 DS1307RTC::DS1307RTC(I2CMaster &bus, uint8_t oneHzPin)
-00084     : _bus(&bus)
-00085     , _oneHzPin(oneHzPin)
-00086     , prevOneHz(false)
-00087     , _isRealTime(true)
-00088 {
-00089     // Make sure the CH bit in register 0 is off or the clock won't update.
-00090     _bus->startWrite(DS1307_I2C_ADDRESS);
-00091     _bus->write(DS1307_SECOND);
-00092     if (_bus->startRead(DS1307_I2C_ADDRESS, 1)) {
-00093         uint8_t value = _bus->read();
-00094         if ((value & 0x80) != 0)
-00095             writeRegister(DS1307_SECOND, value & 0x7F);
-00096     } else {
-00097         // Did not get an acknowledgement from the RTC chip.
-00098         _isRealTime = false;
-00099     }
-00100 
-00101     // Turn on the 1 Hz square wave signal if required.
-00102     if (oneHzPin != 255 && _isRealTime) {
-00103         pinMode(oneHzPin, INPUT);
-00104         digitalWrite(oneHzPin, HIGH);
-00105         writeRegister(DS1307_CONTROL, 0x10);
-00106     }
-00107 
-00108     // Initialize the alarms in the RTC chip's NVRAM.
-00109     if (_isRealTime)
-00110         initAlarms();
-00111 }
-00112 
-00118 bool DS1307RTC::hasUpdates()
-00119 {
-00120     // If not using a 1 Hz pin or there is no RTC chip available,
-00121     // then assume that there is an update available.
-00122     if (_oneHzPin == 255 || !_isRealTime)
-00123         return true;
-00124 
-00125     // The DS1307 updates the internal registers on the falling edge of the
-00126     // 1 Hz clock.  The values should be ready to read on the rising edge.
-00127     bool value = digitalRead(_oneHzPin);
-00128     if (value && !prevOneHz) {
-00129         prevOneHz = value;
-00130         return true;
-00131     } else {
-00132         prevOneHz = value;
-00133         return false;
-00134     }
-00135 }
-00136 
-00137 inline uint8_t fromBCD(uint8_t value)
-00138 {
-00139     return (value >> 4) * 10 + (value & 0x0F);
-00140 }
-00141 
-00142 inline uint8_t fromHourBCD(uint8_t value)
-00143 {
-00144     if ((value & 0x40) != 0) {
-00145         // 12-hour mode.
-00146         uint8_t result = ((value >> 4) & 0x01) * 10 + (value & 0x0F);
-00147         if ((value & 0x20) != 0)
-00148             return (result == 12) ? 12 : (result + 12);     // PM
-00149         else
-00150             return (result == 12) ? 0 : result;             // AM
-00151     } else {
-00152         // 24-hour mode.
-00153         return fromBCD(value);
-00154     }
-00155 }
-00156 
-00157 void DS1307RTC::readTime(RTCTime *value)
-00158 {
-00159     if (_isRealTime) {
-00160         _bus->startWrite(DS1307_I2C_ADDRESS);
-00161         _bus->write(DS1307_SECOND);
-00162         if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
-00163             value->second = fromBCD(_bus->read() & 0x7F);
-00164             value->minute = fromBCD(_bus->read());
-00165             value->hour = fromHourBCD(_bus->read());
-00166         } else {
-00167             // RTC chip is not responding.
-00168             value->second = 0;
-00169             value->minute = 0;
-00170             value->hour = 0;
-00171         }
-00172     } else {
-00173         RTC::readTime(value);
-00174     }
-00175 }
-00176 
-00177 void DS1307RTC::readDate(RTCDate *value)
-00178 {
-00179     if (!_isRealTime) {
-00180         RTC::readDate(value);
-00181         return;
-00182     }
-00183     _bus->startWrite(DS1307_I2C_ADDRESS);
-00184     _bus->write(DS1307_DATE);
-00185     if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
-00186         value->day = fromBCD(_bus->read());
-00187         value->month = fromBCD(_bus->read());
-00188         value->year = fromBCD(_bus->read()) + 2000;
-00189     } else {
-00190         // RTC chip is not responding.
-00191         value->day = 1;
-00192         value->month = 1;
-00193         value->year = 2000;
-00194     }
-00195 }
-00196 
-00197 inline uint8_t toBCD(uint8_t value)
-00198 {
-00199     return ((value / 10) << 4) + (value % 10);
-00200 }
-00201 
-00202 void DS1307RTC::writeTime(const RTCTime *value)
-00203 {
-00204     if (_isRealTime) {
-00205         _bus->startWrite(DS1307_I2C_ADDRESS);
-00206         _bus->write(DS1307_SECOND);
-00207         _bus->write(toBCD(value->second));
-00208         _bus->write(toBCD(value->minute));
-00209         _bus->write(toBCD(value->hour));    // Changes mode to 24-hour clock.
-00210         _bus->endWrite();
-00211     } else {
-00212         RTC::writeTime(value);
-00213     }
-00214 }
-00215 
-00216 void DS1307RTC::writeDate(const RTCDate *value)
-00217 {
-00218     if (_isRealTime) {
-00219         _bus->startWrite(DS1307_I2C_ADDRESS);
-00220         _bus->write(DS1307_DATE);
-00221         _bus->write(toBCD(value->day));
-00222         _bus->write(toBCD(value->month));
-00223         _bus->write(toBCD(value->year % 100));
-00224         _bus->endWrite();
-00225     } else {
-00226         RTC::writeDate(value);
-00227     }
-00228 }
-00229 
-00230 void DS1307RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
-00231 {
-00232     if (_isRealTime) {
-00233         _bus->startWrite(DS1307_I2C_ADDRESS);
-00234         _bus->write(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
-00235         if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
-00236             value->hour = fromBCD(_bus->read());
-00237             value->minute = fromBCD(_bus->read());
-00238             value->flags = _bus->read();
-00239         } else {
-00240             // RTC chip is not responding.
-00241             value->hour = 0;
-00242             value->minute = 0;
-00243             value->flags = 0;
-00244         }
-00245     } else {
-00246         RTC::readAlarm(alarmNum, value);
-00247     }
-00248 }
-00249 
-00250 void DS1307RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
-00251 {
-00252     if (_isRealTime) {
-00253         _bus->startWrite(DS1307_I2C_ADDRESS);
-00254         _bus->write(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
-00255         _bus->write(toBCD(value->hour));
-00256         _bus->write(toBCD(value->minute));
-00257         _bus->write(value->flags);
-00258         _bus->endWrite();
-00259     } else {
-00260         RTC::writeAlarm(alarmNum, value);
-00261     }
-00262 }
-00263 
-00264 int DS1307RTC::byteCount() const
-00265 {
-00266     return DS1307_ALARMS - DS1307_NVRAM;
-00267 }
-00268 
-00269 uint8_t DS1307RTC::readByte(uint8_t offset)
-00270 {
-00271     if (_isRealTime)
-00272         return readRegister(DS1307_NVRAM + offset);
-00273     else
-00274         return RTC::readByte(offset);
-00275 }
-00276 
-00277 void DS1307RTC::writeByte(uint8_t offset, uint8_t value)
-00278 {
-00279     if (_isRealTime)
-00280         writeRegister(DS1307_NVRAM + offset, value);
-00281     else
-00282         RTC::writeByte(offset, value);
-00283 }
-00284 
-00285 void DS1307RTC::initAlarms()
-00286 {
-00287     uint8_t value = readRegister(DS1307_ALARM_MAGIC);
-00288     if (value != (0xB0 + ALARM_COUNT)) {
-00289         // This is the first time we have used this clock chip,
-00290         // so initialize all alarms to their default state.
-00291         RTCAlarm alarm;
-00292         alarm.hour = 6;         // Default to 6am for alarms.
-00293         alarm.minute = 0;
-00294         alarm.flags = 0;
-00295         for (uint8_t index = 0; index < ALARM_COUNT; ++index)
-00296             writeAlarm(index, &alarm);
-00297         writeRegister(DS1307_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
-00298 
-00299         // Also clear the rest of NVRAM so that it is in a known state.
-00300         // Otherwise we'll have whatever garbage was present at power-on.
-00301         _bus->startWrite(DS1307_I2C_ADDRESS);
-00302         _bus->write(DS1307_NVRAM);
-00303         for (uint8_t index = DS1307_NVRAM; index < DS1307_ALARMS; ++index)
-00304             _bus->write(0);
-00305         _bus->endWrite();
-00306     }
-00307 }
-00308 
-00309 uint8_t DS1307RTC::readRegister(uint8_t reg)
-00310 {
-00311     _bus->startWrite(DS1307_I2C_ADDRESS);
-00312     _bus->write(reg);
-00313     if (!_bus->startRead(DS1307_I2C_ADDRESS, 1))
-00314         return 0;   // RTC chip is not responding.
-00315     return _bus->read();
-00316 }
-00317 
-00318 bool DS1307RTC::writeRegister(uint8_t reg, uint8_t value)
-00319 {
-00320     _bus->startWrite(DS1307_I2C_ADDRESS);
-00321     _bus->write(reg);
-00322     _bus->write(value);
-00323     return _bus->endWrite();
-00324 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -362,8 +77,308 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DS1307RTC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "DS1307RTC.h"
+
24 #include "../I2C/I2CMaster.h"
+
25 #if defined(ARDUINO) && ARDUINO >= 100
+
26 #include <Arduino.h>
+
27 #else
+
28 #include <WProgram.h>
+
29 #endif
+
30 
+
54 // I2C address of the RTC chip (7-bit).
+
55 #define DS1307_I2C_ADDRESS 0x68
+
56 
+
57 // Registers.
+
58 #define DS1307_SECOND 0x00
+
59 #define DS1307_MINUTE 0x01
+
60 #define DS1307_HOUR 0x02
+
61 #define DS1307_DAY_OF_WEEK 0x03
+
62 #define DS1307_DATE 0x04
+
63 #define DS1307_MONTH 0x05
+
64 #define DS1307_YEAR 0x06
+
65 #define DS1307_CONTROL 0x07
+
66 #define DS1307_NVRAM 0x08
+
67 
+
68 // Alarm storage at the end of the RTC's NVRAM.
+
69 #define DS1307_ALARM_SIZE 3
+
70 #define DS1307_ALARMS (64 - RTC::ALARM_COUNT * DS1307_ALARM_SIZE - 1)
+
71 #define DS1307_ALARM_MAGIC 63
+
72 
+
83 DS1307RTC::DS1307RTC(I2CMaster &bus, uint8_t oneHzPin)
+
84  : _bus(&bus)
+
85  , _oneHzPin(oneHzPin)
+
86  , prevOneHz(false)
+
87  , _isRealTime(true)
+
88 {
+
89  // Make sure the CH bit in register 0 is off or the clock won't update.
+
90  _bus->startWrite(DS1307_I2C_ADDRESS);
+
91  _bus->write(DS1307_SECOND);
+
92  if (_bus->startRead(DS1307_I2C_ADDRESS, 1)) {
+
93  uint8_t value = _bus->read();
+
94  if ((value & 0x80) != 0)
+
95  writeRegister(DS1307_SECOND, value & 0x7F);
+
96  } else {
+
97  // Did not get an acknowledgement from the RTC chip.
+
98  _isRealTime = false;
+
99  }
+
100 
+
101  // Turn on the 1 Hz square wave signal if required.
+
102  if (oneHzPin != 255 && _isRealTime) {
+
103  pinMode(oneHzPin, INPUT);
+
104  digitalWrite(oneHzPin, HIGH);
+
105  writeRegister(DS1307_CONTROL, 0x10);
+
106  }
+
107 
+
108  // Initialize the alarms in the RTC chip's NVRAM.
+
109  if (_isRealTime)
+
110  initAlarms();
+
111 }
+
112 
+ +
119 {
+
120  // If not using a 1 Hz pin or there is no RTC chip available,
+
121  // then assume that there is an update available.
+
122  if (_oneHzPin == 255 || !_isRealTime)
+
123  return true;
+
124 
+
125  // The DS1307 updates the internal registers on the falling edge of the
+
126  // 1 Hz clock. The values should be ready to read on the rising edge.
+
127  bool value = digitalRead(_oneHzPin);
+
128  if (value && !prevOneHz) {
+
129  prevOneHz = value;
+
130  return true;
+
131  } else {
+
132  prevOneHz = value;
+
133  return false;
+
134  }
+
135 }
+
136 
+
137 inline uint8_t fromBCD(uint8_t value)
+
138 {
+
139  return (value >> 4) * 10 + (value & 0x0F);
+
140 }
+
141 
+
142 inline uint8_t fromHourBCD(uint8_t value)
+
143 {
+
144  if ((value & 0x40) != 0) {
+
145  // 12-hour mode.
+
146  uint8_t result = ((value >> 4) & 0x01) * 10 + (value & 0x0F);
+
147  if ((value & 0x20) != 0)
+
148  return (result == 12) ? 12 : (result + 12); // PM
+
149  else
+
150  return (result == 12) ? 0 : result; // AM
+
151  } else {
+
152  // 24-hour mode.
+
153  return fromBCD(value);
+
154  }
+
155 }
+
156 
+ +
158 {
+
159  if (_isRealTime) {
+
160  _bus->startWrite(DS1307_I2C_ADDRESS);
+
161  _bus->write(DS1307_SECOND);
+
162  if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
+
163  value->second = fromBCD(_bus->read() & 0x7F);
+
164  value->minute = fromBCD(_bus->read());
+
165  value->hour = fromHourBCD(_bus->read());
+
166  } else {
+
167  // RTC chip is not responding.
+
168  value->second = 0;
+
169  value->minute = 0;
+
170  value->hour = 0;
+
171  }
+
172  } else {
+
173  RTC::readTime(value);
+
174  }
+
175 }
+
176 
+ +
178 {
+
179  if (!_isRealTime) {
+
180  RTC::readDate(value);
+
181  return;
+
182  }
+
183  _bus->startWrite(DS1307_I2C_ADDRESS);
+
184  _bus->write(DS1307_DATE);
+
185  if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
+
186  value->day = fromBCD(_bus->read());
+
187  value->month = fromBCD(_bus->read());
+
188  value->year = fromBCD(_bus->read()) + 2000;
+
189  } else {
+
190  // RTC chip is not responding.
+
191  value->day = 1;
+
192  value->month = 1;
+
193  value->year = 2000;
+
194  }
+
195 }
+
196 
+
197 inline uint8_t toBCD(uint8_t value)
+
198 {
+
199  return ((value / 10) << 4) + (value % 10);
+
200 }
+
201 
+
202 void DS1307RTC::writeTime(const RTCTime *value)
+
203 {
+
204  if (_isRealTime) {
+
205  _bus->startWrite(DS1307_I2C_ADDRESS);
+
206  _bus->write(DS1307_SECOND);
+
207  _bus->write(toBCD(value->second));
+
208  _bus->write(toBCD(value->minute));
+
209  _bus->write(toBCD(value->hour)); // Changes mode to 24-hour clock.
+
210  _bus->endWrite();
+
211  } else {
+
212  RTC::writeTime(value);
+
213  }
+
214 }
+
215 
+
216 void DS1307RTC::writeDate(const RTCDate *value)
+
217 {
+
218  if (_isRealTime) {
+
219  _bus->startWrite(DS1307_I2C_ADDRESS);
+
220  _bus->write(DS1307_DATE);
+
221  _bus->write(toBCD(value->day));
+
222  _bus->write(toBCD(value->month));
+
223  _bus->write(toBCD(value->year % 100));
+
224  _bus->endWrite();
+
225  } else {
+
226  RTC::writeDate(value);
+
227  }
+
228 }
+
229 
+
230 void DS1307RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
+
231 {
+
232  if (_isRealTime) {
+
233  _bus->startWrite(DS1307_I2C_ADDRESS);
+
234  _bus->write(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
+
235  if (_bus->startRead(DS1307_I2C_ADDRESS, 3)) {
+
236  value->hour = fromBCD(_bus->read());
+
237  value->minute = fromBCD(_bus->read());
+
238  value->flags = _bus->read();
+
239  } else {
+
240  // RTC chip is not responding.
+
241  value->hour = 0;
+
242  value->minute = 0;
+
243  value->flags = 0;
+
244  }
+
245  } else {
+
246  RTC::readAlarm(alarmNum, value);
+
247  }
+
248 }
+
249 
+
250 void DS1307RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
+
251 {
+
252  if (_isRealTime) {
+
253  _bus->startWrite(DS1307_I2C_ADDRESS);
+
254  _bus->write(DS1307_ALARMS + alarmNum * DS1307_ALARM_SIZE);
+
255  _bus->write(toBCD(value->hour));
+
256  _bus->write(toBCD(value->minute));
+
257  _bus->write(value->flags);
+
258  _bus->endWrite();
+
259  } else {
+
260  RTC::writeAlarm(alarmNum, value);
+
261  }
+
262 }
+
263 
+ +
265 {
+
266  return DS1307_ALARMS - DS1307_NVRAM;
+
267 }
+
268 
+
269 uint8_t DS1307RTC::readByte(uint8_t offset)
+
270 {
+
271  if (_isRealTime)
+
272  return readRegister(DS1307_NVRAM + offset);
+
273  else
+
274  return RTC::readByte(offset);
+
275 }
+
276 
+
277 void DS1307RTC::writeByte(uint8_t offset, uint8_t value)
+
278 {
+
279  if (_isRealTime)
+
280  writeRegister(DS1307_NVRAM + offset, value);
+
281  else
+
282  RTC::writeByte(offset, value);
+
283 }
+
284 
+
285 void DS1307RTC::initAlarms()
+
286 {
+
287  uint8_t value = readRegister(DS1307_ALARM_MAGIC);
+
288  if (value != (0xB0 + ALARM_COUNT)) {
+
289  // This is the first time we have used this clock chip,
+
290  // so initialize all alarms to their default state.
+
291  RTCAlarm alarm;
+
292  alarm.hour = 6; // Default to 6am for alarms.
+
293  alarm.minute = 0;
+
294  alarm.flags = 0;
+
295  for (uint8_t index = 0; index < ALARM_COUNT; ++index)
+
296  writeAlarm(index, &alarm);
+
297  writeRegister(DS1307_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
+
298 
+
299  // Also clear the rest of NVRAM so that it is in a known state.
+
300  // Otherwise we'll have whatever garbage was present at power-on.
+
301  _bus->startWrite(DS1307_I2C_ADDRESS);
+
302  _bus->write(DS1307_NVRAM);
+
303  for (uint8_t index = DS1307_NVRAM; index < DS1307_ALARMS; ++index)
+
304  _bus->write(0);
+
305  _bus->endWrite();
+
306  }
+
307 }
+
308 
+
309 uint8_t DS1307RTC::readRegister(uint8_t reg)
+
310 {
+
311  _bus->startWrite(DS1307_I2C_ADDRESS);
+
312  _bus->write(reg);
+
313  if (!_bus->startRead(DS1307_I2C_ADDRESS, 1))
+
314  return 0; // RTC chip is not responding.
+
315  return _bus->read();
+
316 }
+
317 
+
318 bool DS1307RTC::writeRegister(uint8_t reg, uint8_t value)
+
319 {
+
320  _bus->startWrite(DS1307_I2C_ADDRESS);
+
321  _bus->write(reg);
+
322  _bus->write(value);
+
323  return _bus->endWrite();
+
324 }
+
+ + diff --git a/DS1307RTC_8h_source.html b/DS1307RTC_8h_source.html index eb758297..04110a7d 100644 --- a/DS1307RTC_8h_source.html +++ b/DS1307RTC_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DS1307RTC.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DS1307RTC.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef DS1307RTC_h
-00024 #define DS1307RTC_h
-00025 
-00026 #include "RTC.h"
-00027 
-00028 class I2CMaster;
-00029 
-00030 class DS1307RTC : public RTC {
-00031 public:
-00032     DS1307RTC(I2CMaster &bus, uint8_t oneHzPin = 255);
-00033 
-00034     bool isRealTime() const { return _isRealTime; }
-00035 
-00036     bool hasUpdates();
-00037 
-00038     void readTime(RTCTime *value);
-00039     void readDate(RTCDate *value);
-00040 
-00041     void writeTime(const RTCTime *value);
-00042     void writeDate(const RTCDate *value);
-00043 
-00044     void readAlarm(uint8_t alarmNum, RTCAlarm *value);
-00045     void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
-00046 
-00047     int byteCount() const;
-00048     uint8_t readByte(uint8_t offset);
-00049     void writeByte(uint8_t offset, uint8_t value);
-00050 
-00051 private:
-00052     I2CMaster *_bus;
-00053     uint8_t _oneHzPin;
-00054     bool prevOneHz;
-00055     bool _isRealTime;
-00056 
-00057     void initAlarms();
-00058 
-00059     uint8_t readRegister(uint8_t reg);
-00060     bool writeRegister(uint8_t reg, uint8_t value);
-00061 };
-00062 
-00063 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -139,8 +77,85 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DS1307RTC.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef DS1307RTC_h
+
24 #define DS1307RTC_h
+
25 
+
26 #include "RTC.h"
+
27 
+
28 class I2CMaster;
+
29 
+
30 class DS1307RTC : public RTC {
+
31 public:
+
32  DS1307RTC(I2CMaster &bus, uint8_t oneHzPin = 255);
+
33 
+
34  bool isRealTime() const { return _isRealTime; }
+
35 
+
36  bool hasUpdates();
+
37 
+
38  void readTime(RTCTime *value);
+
39  void readDate(RTCDate *value);
+
40 
+
41  void writeTime(const RTCTime *value);
+
42  void writeDate(const RTCDate *value);
+
43 
+
44  void readAlarm(uint8_t alarmNum, RTCAlarm *value);
+
45  void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
+
46 
+
47  int byteCount() const;
+
48  uint8_t readByte(uint8_t offset);
+
49  void writeByte(uint8_t offset, uint8_t value);
+
50 
+
51 private:
+
52  I2CMaster *_bus;
+
53  uint8_t _oneHzPin;
+
54  bool prevOneHz;
+
55  bool _isRealTime;
+
56 
+
57  void initAlarms();
+
58 
+
59  uint8_t readRegister(uint8_t reg);
+
60  bool writeRegister(uint8_t reg, uint8_t value);
+
61 };
+
62 
+
63 #endif
+
+ + diff --git a/DS3232RTC_8cpp_source.html b/DS3232RTC_8cpp_source.html index 3afd9f30..096b8256 100644 --- a/DS3232RTC_8cpp_source.html +++ b/DS3232RTC_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DS3232RTC.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DS3232RTC.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "DS3232RTC.h"
-00024 #include "../I2C/I2CMaster.h"
-00025 #if defined(ARDUINO) && ARDUINO >= 100
-00026 #include <Arduino.h>
-00027 #else
-00028 #include <WProgram.h>
-00029 #endif
-00030 
-00059 // I2C address of the RTC chip (7-bit).
-00060 #define DS3232_I2C_ADDRESS  0x68
-00061 
-00062 // Registers.
-00063 #define DS3232_SECOND       0x00
-00064 #define DS3232_MINUTE       0x01
-00065 #define DS3232_HOUR         0x02
-00066 #define DS3232_DAY_OF_WEEK  0x03
-00067 #define DS3232_DATE         0x04
-00068 #define DS3232_MONTH        0x05
-00069 #define DS3232_YEAR         0x06
-00070 #define DS3232_ALARM1_SEC   0x07
-00071 #define DS3232_ALARM1_MIN   0x08
-00072 #define DS3232_ALARM1_HOUR  0x09
-00073 #define DS3232_ALARM1_DAY   0x0A
-00074 #define DS3232_ALARM2_MIN   0x0B
-00075 #define DS3232_ALARM2_HOUR  0x0C
-00076 #define DS3232_ALARM2_DAY   0x0D
-00077 #define DS3232_CONTROL      0x0E
-00078 #define DS3232_STATUS       0x0F
-00079 #define DS3232_AGING_OFFSET 0x10
-00080 #define DS3232_TEMP_MSB     0x11
-00081 #define DS3232_TEMP_LSB     0x12
-00082 #define DS3232_RESERVED     0x13
-00083 #define DS3232_NVRAM        0x14
-00084 
-00085 // Bits in the DS3232_CONTROL register.
-00086 #define DS3232_EOSC         0x80
-00087 #define DS3232_BBSQW        0x40
-00088 #define DS3232_CONV         0x20
-00089 #define DS3232_RS_1HZ       0x00
-00090 #define DS3232_RS_1024HZ    0x08
-00091 #define DS3232_RS_4096HZ    0x10
-00092 #define DS3232_RS_8192HZ    0x18
-00093 #define DS3232_INTCN        0x04
-00094 #define DS3232_A2IE         0x02
-00095 #define DS3232_A1IE         0x01
-00096 
-00097 // Bits in the DS3232_STATUS register.
-00098 #define DS3232_OSF          0x80
-00099 #define DS3232_BB32KHZ      0x40
-00100 #define DS3232_CRATE_64     0x00
-00101 #define DS3232_CRATE_128    0x10
-00102 #define DS3232_CRATE_256    0x20
-00103 #define DS3232_CRATE_512    0x30
-00104 #define DS3232_EN32KHZ      0x08
-00105 #define DS3232_BSY          0x04
-00106 #define DS3232_A2F          0x02
-00107 #define DS3232_A1F          0x01
-00108 
-00109 // Alarm storage at the end of the RTC's NVRAM.
-00110 #define DS3232_ALARM_SIZE   3
-00111 #define DS3232_ALARMS       (256 - RTC::ALARM_COUNT * DS3232_ALARM_SIZE - 1)
-00112 #define DS3232_ALARM_MAGIC  255
-00113 
-00126 DS3232RTC::DS3232RTC(I2CMaster &bus, uint8_t oneHzPin)
-00127     : _bus(&bus)
-00128     , _oneHzPin(oneHzPin)
-00129     , prevOneHz(false)
-00130     , _isRealTime(true)
-00131     , alarmInterrupts(false)
-00132 {
-00133     // Probe the device and configure it for our use.
-00134     _bus->startWrite(DS3232_I2C_ADDRESS);
-00135     _bus->write(DS3232_CONTROL);
-00136     if (_bus->startRead(DS3232_I2C_ADDRESS, 1)) {
-00137         uint8_t value = _bus->read() & DS3232_CONV;
-00138         if (oneHzPin != 255)
-00139             value |= DS3232_BBSQW | DS3232_RS_1HZ;
-00140         _bus->startWrite(DS3232_I2C_ADDRESS);
-00141         _bus->write(DS3232_CONTROL);
-00142         _bus->write(value);
-00143         _bus->write(DS3232_CRATE_64);
-00144         _bus->endWrite();
-00145     } else {
-00146         // Did not get an acknowledgement from the RTC chip.
-00147         _isRealTime = false;
-00148     }
-00149 
-00150     // Configure the 1 Hz square wave pin if required.
-00151     if (oneHzPin != 255 && _isRealTime) {
-00152         pinMode(oneHzPin, INPUT);
-00153         digitalWrite(oneHzPin, HIGH);
-00154     }
-00155 
-00156     // Initialize the alarms in the RTC chip's NVRAM.
-00157     if (_isRealTime)
-00158         initAlarms();
-00159 }
-00160 
-00166 bool DS3232RTC::hasUpdates()
-00167 {
-00168     // If not using a 1 Hz pin or there is no RTC chip available,
-00169     // then assume that there is an update available.
-00170     if (_oneHzPin == 255 || !_isRealTime)
-00171         return true;
-00172 
-00173     // The DS3232 updates the internal registers on the falling edge of the
-00174     // 1 Hz clock.  The values should be ready to read on the rising edge.
-00175     bool value = digitalRead(_oneHzPin);
-00176     if (value && !prevOneHz) {
-00177         prevOneHz = value;
-00178         return true;
-00179     } else {
-00180         prevOneHz = value;
-00181         return false;
-00182     }
-00183 }
-00184 
-00185 inline uint8_t fromBCD(uint8_t value)
-00186 {
-00187     return (value >> 4) * 10 + (value & 0x0F);
-00188 }
-00189 
-00190 inline uint8_t fromHourBCD(uint8_t value)
-00191 {
-00192     if ((value & 0x40) != 0) {
-00193         // 12-hour mode.
-00194         uint8_t result = ((value >> 4) & 0x01) * 10 + (value & 0x0F);
-00195         if ((value & 0x20) != 0)
-00196             return (result == 12) ? 12 : (result + 12);     // PM
-00197         else
-00198             return (result == 12) ? 0 : result;             // AM
-00199     } else {
-00200         // 24-hour mode.
-00201         return fromBCD(value);
-00202     }
-00203 }
-00204 
-00205 void DS3232RTC::readTime(RTCTime *value)
-00206 {
-00207     if (_isRealTime) {
-00208         _bus->startWrite(DS3232_I2C_ADDRESS);
-00209         _bus->write(DS3232_SECOND);
-00210         if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
-00211             value->second = fromBCD(_bus->read());
-00212             value->minute = fromBCD(_bus->read());
-00213             value->hour = fromHourBCD(_bus->read());
-00214         } else {
-00215             // RTC chip is not responding.
-00216             value->second = 0;
-00217             value->minute = 0;
-00218             value->hour = 0;
-00219         }
-00220     } else {
-00221         RTC::readTime(value);
-00222     }
-00223 }
-00224 
-00225 void DS3232RTC::readDate(RTCDate *value)
-00226 {
-00227     if (!_isRealTime) {
-00228         RTC::readDate(value);
-00229         return;
-00230     }
-00231     _bus->startWrite(DS3232_I2C_ADDRESS);
-00232     _bus->write(DS3232_DATE);
-00233     if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
-00234         value->day = fromBCD(_bus->read());
-00235         value->month = fromBCD(_bus->read() & 0x7F); // Strip century bit.
-00236         value->year = fromBCD(_bus->read()) + 2000;
-00237     } else {
-00238         // RTC chip is not responding.
-00239         value->day = 1;
-00240         value->month = 1;
-00241         value->year = 2000;
-00242     }
-00243 }
-00244 
-00245 inline uint8_t toBCD(uint8_t value)
-00246 {
-00247     return ((value / 10) << 4) + (value % 10);
-00248 }
-00249 
-00250 void DS3232RTC::writeTime(const RTCTime *value)
-00251 {
-00252     if (_isRealTime) {
-00253         _bus->startWrite(DS3232_I2C_ADDRESS);
-00254         _bus->write(DS3232_SECOND);
-00255         _bus->write(toBCD(value->second));
-00256         _bus->write(toBCD(value->minute));
-00257         _bus->write(toBCD(value->hour));    // Changes mode to 24-hour clock.
-00258         _bus->endWrite();
-00259     } else {
-00260         RTC::writeTime(value);
-00261     }
-00262 }
-00263 
-00264 void DS3232RTC::writeDate(const RTCDate *value)
-00265 {
-00266     if (_isRealTime) {
-00267         _bus->startWrite(DS3232_I2C_ADDRESS);
-00268         _bus->write(DS3232_DATE);
-00269         _bus->write(toBCD(value->day));
-00270         _bus->write(toBCD(value->month));
-00271         _bus->write(toBCD(value->year % 100));
-00272         _bus->endWrite();
-00273     } else {
-00274         RTC::writeDate(value);
-00275     }
-00276 }
-00277 
-00278 void DS3232RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
-00279 {
-00280     if (_isRealTime) {
-00281         _bus->startWrite(DS3232_I2C_ADDRESS);
-00282         _bus->write(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
-00283         if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
-00284             value->hour = fromBCD(_bus->read());
-00285             value->minute = fromBCD(_bus->read());
-00286             value->flags = _bus->read();
-00287         } else {
-00288             // RTC chip is not responding.
-00289             value->hour = 0;
-00290             value->minute = 0;
-00291             value->flags = 0;
-00292         }
-00293     } else {
-00294         RTC::readAlarm(alarmNum, value);
-00295     }
-00296 }
-00297 
-00298 void DS3232RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
-00299 {
-00300     if (_isRealTime) {
-00301         // Write the alarm details to NVRAM.
-00302         _bus->startWrite(DS3232_I2C_ADDRESS);
-00303         _bus->write(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
-00304         _bus->write(toBCD(value->hour));
-00305         _bus->write(toBCD(value->minute));
-00306         _bus->write(value->flags);
-00307         _bus->endWrite();
-00308 
-00309         // Keep the DS3232's built-in alarms in sync with the first two alarms.
-00310         if (alarmNum == 0) {
-00311             _bus->startWrite(DS3232_I2C_ADDRESS);
-00312             _bus->write(DS3232_ALARM1_SEC);
-00313             _bus->write(0);
-00314             _bus->write(toBCD(value->minute));
-00315             _bus->write(toBCD(value->hour));
-00316             _bus->write(0x81);  // Match hours, mins, secs; day = 1
-00317             _bus->endWrite();
-00318             if (alarmInterrupts)
-00319                 updateAlarmInterrupts();
-00320         } else if (alarmNum == 1) {
-00321             _bus->startWrite(DS3232_I2C_ADDRESS);
-00322             _bus->write(DS3232_ALARM2_MIN);
-00323             _bus->write(toBCD(value->minute));
-00324             _bus->write(toBCD(value->hour));
-00325             _bus->write(0x81);  // Match hours, mins; day = 1
-00326             _bus->endWrite();
-00327             if (alarmInterrupts)
-00328                 updateAlarmInterrupts();
-00329         }
-00330     } else {
-00331         RTC::writeAlarm(alarmNum, value);
-00332     }
-00333 }
-00334 
-00335 int DS3232RTC::byteCount() const
-00336 {
-00337     return DS3232_ALARMS - DS3232_NVRAM;
-00338 }
-00339 
-00340 uint8_t DS3232RTC::readByte(uint8_t offset)
-00341 {
-00342     if (_isRealTime)
-00343         return readRegister(DS3232_NVRAM + offset);
-00344     else
-00345         return RTC::readByte(offset);
-00346 }
-00347 
-00348 void DS3232RTC::writeByte(uint8_t offset, uint8_t value)
-00349 {
-00350     if (_isRealTime)
-00351         writeRegister(DS3232_NVRAM + offset, value);
-00352     else
-00353         RTC::writeByte(offset, value);
-00354 }
-00355 
-00356 int DS3232RTC::readTemperature()
-00357 {
-00358     if (_isRealTime) {
-00359         return (((int)(signed char)readRegister(DS3232_TEMP_MSB)) << 2) |
-00360                (readRegister(DS3232_TEMP_LSB) >> 6);
-00361     } else {
-00362         return NO_TEMPERATURE;
-00363     }
-00364 }
-00365 
-00380 void DS3232RTC::enableAlarmInterrupts()
-00381 {
-00382     if (_oneHzPin == 255 && _isRealTime) {
-00383         updateAlarmInterrupts();
-00384         alarmInterrupts = true;
-00385     }
-00386 }
-00387 
-00393 void DS3232RTC::disableAlarmInterrupts()
-00394 {
-00395     if (alarmInterrupts) {
-00396         uint8_t value = readRegister(DS3232_CONTROL);
-00397         value &= ~(DS3232_INTCN | DS3232_A2IE | DS3232_A1IE);
-00398         writeRegister(DS3232_CONTROL, value);
-00399         alarmInterrupts = false;
-00400     }
-00401 }
-00402 
-00416 int DS3232RTC::firedAlarm()
-00417 {
-00418     if (!_isRealTime)
-00419         return -1;
-00420     uint8_t value = readRegister(DS3232_STATUS);
-00421     int alarm;
-00422     if (value & DS3232_A1F) {
-00423         if (value & DS3232_A2F)
-00424             alarm = 2;
-00425         else
-00426             alarm = 0;
-00427     } else if (value & DS3232_A2F) {
-00428         alarm = 1;
-00429     } else {
-00430         alarm = -1;
-00431     }
-00432     if (alarm != -1) {
-00433         value &= ~(DS3232_A1F | DS3232_A2F);
-00434         writeRegister(DS3232_STATUS, value);
-00435     }
-00436     return alarm;
-00437 }
-00438 
-00444 void DS3232RTC::enable32kHzOutput()
-00445 {
-00446     if (_isRealTime) {
-00447         uint8_t value = readRegister(DS3232_STATUS);
-00448         value |= DS3232_BB32KHZ | DS3232_EN32KHZ;
-00449         writeRegister(DS3232_STATUS, value);
-00450     }
-00451 }
-00452 
-00458 void DS3232RTC::disable32kHzOutput()
-00459 {
-00460     if (_isRealTime) {
-00461         uint8_t value = readRegister(DS3232_STATUS);
-00462         value &= ~(DS3232_BB32KHZ | DS3232_EN32KHZ);
-00463         writeRegister(DS3232_STATUS, value);
-00464     }
-00465 }
-00466 
-00467 void DS3232RTC::initAlarms()
-00468 {
-00469     uint8_t value = readRegister(DS3232_ALARM_MAGIC);
-00470     if (value != (0xB0 + ALARM_COUNT)) {
-00471         // This is the first time we have used this clock chip,
-00472         // so initialize all alarms to their default state.
-00473         RTCAlarm alarm;
-00474         alarm.hour = 6;         // Default to 6am for alarms.
-00475         alarm.minute = 0;
-00476         alarm.flags = 0;
-00477         for (uint8_t index = 0; index < ALARM_COUNT; ++index)
-00478             writeAlarm(index, &alarm);
-00479         writeRegister(DS3232_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
-00480 
-00481         // Also clear the rest of NVRAM so that it is in a known state.
-00482         // Otherwise we'll have whatever garbage was present at power-on.
-00483         _bus->startWrite(DS3232_I2C_ADDRESS);
-00484         _bus->write(DS3232_NVRAM);
-00485         for (uint8_t index = DS3232_NVRAM; index < DS3232_ALARMS; ++index)
-00486             _bus->write(0);
-00487         _bus->endWrite();
-00488     }
-00489 }
-00490 
-00491 uint8_t DS3232RTC::readRegister(uint8_t reg)
-00492 {
-00493     _bus->startWrite(DS3232_I2C_ADDRESS);
-00494     _bus->write(reg);
-00495     if (!_bus->startRead(DS3232_I2C_ADDRESS, 1))
-00496         return 0;   // RTC chip is not responding.
-00497     return _bus->read();
-00498 }
-00499 
-00500 bool DS3232RTC::writeRegister(uint8_t reg, uint8_t value)
-00501 {
-00502     _bus->startWrite(DS3232_I2C_ADDRESS);
-00503     _bus->write(reg);
-00504     _bus->write(value);
-00505     return _bus->endWrite();
-00506 }
-00507 
-00508 #define DS3232_ALARM1_FLAGS (DS3232_ALARMS + 2)
-00509 #define DS3232_ALARM2_FLAGS (DS3232_ALARMS + DS3232_ALARM_SIZE + 2)
-00510 
-00511 void DS3232RTC::updateAlarmInterrupts()
-00512 {
-00513     bool alarm1Enabled = ((readRegister(DS3232_ALARM1_FLAGS) & 0x01) != 0);
-00514     bool alarm2Enabled = ((readRegister(DS3232_ALARM2_FLAGS) & 0x01) != 0);
-00515     uint8_t value = readRegister(DS3232_CONTROL);
-00516     value |= DS3232_INTCN;
-00517     if (alarm1Enabled)
-00518         value |= DS3232_A1IE;
-00519     else
-00520         value &= ~DS3232_A1IE;
-00521     if (alarm2Enabled)
-00522         value |= DS3232_A2IE;
-00523     else
-00524         value &= ~DS3232_A2IE;
-00525     writeRegister(DS3232_CONTROL, value);
-00526 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -515,8 +77,461 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DS3232RTC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "DS3232RTC.h"
+
24 #include "../I2C/I2CMaster.h"
+
25 #if defined(ARDUINO) && ARDUINO >= 100
+
26 #include <Arduino.h>
+
27 #else
+
28 #include <WProgram.h>
+
29 #endif
+
30 
+
59 // I2C address of the RTC chip (7-bit).
+
60 #define DS3232_I2C_ADDRESS 0x68
+
61 
+
62 // Registers.
+
63 #define DS3232_SECOND 0x00
+
64 #define DS3232_MINUTE 0x01
+
65 #define DS3232_HOUR 0x02
+
66 #define DS3232_DAY_OF_WEEK 0x03
+
67 #define DS3232_DATE 0x04
+
68 #define DS3232_MONTH 0x05
+
69 #define DS3232_YEAR 0x06
+
70 #define DS3232_ALARM1_SEC 0x07
+
71 #define DS3232_ALARM1_MIN 0x08
+
72 #define DS3232_ALARM1_HOUR 0x09
+
73 #define DS3232_ALARM1_DAY 0x0A
+
74 #define DS3232_ALARM2_MIN 0x0B
+
75 #define DS3232_ALARM2_HOUR 0x0C
+
76 #define DS3232_ALARM2_DAY 0x0D
+
77 #define DS3232_CONTROL 0x0E
+
78 #define DS3232_STATUS 0x0F
+
79 #define DS3232_AGING_OFFSET 0x10
+
80 #define DS3232_TEMP_MSB 0x11
+
81 #define DS3232_TEMP_LSB 0x12
+
82 #define DS3232_RESERVED 0x13
+
83 #define DS3232_NVRAM 0x14
+
84 
+
85 // Bits in the DS3232_CONTROL register.
+
86 #define DS3232_EOSC 0x80
+
87 #define DS3232_BBSQW 0x40
+
88 #define DS3232_CONV 0x20
+
89 #define DS3232_RS_1HZ 0x00
+
90 #define DS3232_RS_1024HZ 0x08
+
91 #define DS3232_RS_4096HZ 0x10
+
92 #define DS3232_RS_8192HZ 0x18
+
93 #define DS3232_INTCN 0x04
+
94 #define DS3232_A2IE 0x02
+
95 #define DS3232_A1IE 0x01
+
96 
+
97 // Bits in the DS3232_STATUS register.
+
98 #define DS3232_OSF 0x80
+
99 #define DS3232_BB32KHZ 0x40
+
100 #define DS3232_CRATE_64 0x00
+
101 #define DS3232_CRATE_128 0x10
+
102 #define DS3232_CRATE_256 0x20
+
103 #define DS3232_CRATE_512 0x30
+
104 #define DS3232_EN32KHZ 0x08
+
105 #define DS3232_BSY 0x04
+
106 #define DS3232_A2F 0x02
+
107 #define DS3232_A1F 0x01
+
108 
+
109 // Alarm storage at the end of the RTC's NVRAM.
+
110 #define DS3232_ALARM_SIZE 3
+
111 #define DS3232_ALARMS (256 - RTC::ALARM_COUNT * DS3232_ALARM_SIZE - 1)
+
112 #define DS3232_ALARM_MAGIC 255
+
113 
+
126 DS3232RTC::DS3232RTC(I2CMaster &bus, uint8_t oneHzPin)
+
127  : _bus(&bus)
+
128  , _oneHzPin(oneHzPin)
+
129  , prevOneHz(false)
+
130  , _isRealTime(true)
+
131  , alarmInterrupts(false)
+
132 {
+
133  // Probe the device and configure it for our use.
+
134  _bus->startWrite(DS3232_I2C_ADDRESS);
+
135  _bus->write(DS3232_CONTROL);
+
136  if (_bus->startRead(DS3232_I2C_ADDRESS, 1)) {
+
137  uint8_t value = _bus->read() & DS3232_CONV;
+
138  if (oneHzPin != 255)
+
139  value |= DS3232_BBSQW | DS3232_RS_1HZ;
+
140  _bus->startWrite(DS3232_I2C_ADDRESS);
+
141  _bus->write(DS3232_CONTROL);
+
142  _bus->write(value);
+
143  _bus->write(DS3232_CRATE_64);
+
144  _bus->endWrite();
+
145  } else {
+
146  // Did not get an acknowledgement from the RTC chip.
+
147  _isRealTime = false;
+
148  }
+
149 
+
150  // Configure the 1 Hz square wave pin if required.
+
151  if (oneHzPin != 255 && _isRealTime) {
+
152  pinMode(oneHzPin, INPUT);
+
153  digitalWrite(oneHzPin, HIGH);
+
154  }
+
155 
+
156  // Initialize the alarms in the RTC chip's NVRAM.
+
157  if (_isRealTime)
+
158  initAlarms();
+
159 }
+
160 
+ +
167 {
+
168  // If not using a 1 Hz pin or there is no RTC chip available,
+
169  // then assume that there is an update available.
+
170  if (_oneHzPin == 255 || !_isRealTime)
+
171  return true;
+
172 
+
173  // The DS3232 updates the internal registers on the falling edge of the
+
174  // 1 Hz clock. The values should be ready to read on the rising edge.
+
175  bool value = digitalRead(_oneHzPin);
+
176  if (value && !prevOneHz) {
+
177  prevOneHz = value;
+
178  return true;
+
179  } else {
+
180  prevOneHz = value;
+
181  return false;
+
182  }
+
183 }
+
184 
+
185 inline uint8_t fromBCD(uint8_t value)
+
186 {
+
187  return (value >> 4) * 10 + (value & 0x0F);
+
188 }
+
189 
+
190 inline uint8_t fromHourBCD(uint8_t value)
+
191 {
+
192  if ((value & 0x40) != 0) {
+
193  // 12-hour mode.
+
194  uint8_t result = ((value >> 4) & 0x01) * 10 + (value & 0x0F);
+
195  if ((value & 0x20) != 0)
+
196  return (result == 12) ? 12 : (result + 12); // PM
+
197  else
+
198  return (result == 12) ? 0 : result; // AM
+
199  } else {
+
200  // 24-hour mode.
+
201  return fromBCD(value);
+
202  }
+
203 }
+
204 
+ +
206 {
+
207  if (_isRealTime) {
+
208  _bus->startWrite(DS3232_I2C_ADDRESS);
+
209  _bus->write(DS3232_SECOND);
+
210  if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
+
211  value->second = fromBCD(_bus->read());
+
212  value->minute = fromBCD(_bus->read());
+
213  value->hour = fromHourBCD(_bus->read());
+
214  } else {
+
215  // RTC chip is not responding.
+
216  value->second = 0;
+
217  value->minute = 0;
+
218  value->hour = 0;
+
219  }
+
220  } else {
+
221  RTC::readTime(value);
+
222  }
+
223 }
+
224 
+ +
226 {
+
227  if (!_isRealTime) {
+
228  RTC::readDate(value);
+
229  return;
+
230  }
+
231  _bus->startWrite(DS3232_I2C_ADDRESS);
+
232  _bus->write(DS3232_DATE);
+
233  if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
+
234  value->day = fromBCD(_bus->read());
+
235  value->month = fromBCD(_bus->read() & 0x7F); // Strip century bit.
+
236  value->year = fromBCD(_bus->read()) + 2000;
+
237  } else {
+
238  // RTC chip is not responding.
+
239  value->day = 1;
+
240  value->month = 1;
+
241  value->year = 2000;
+
242  }
+
243 }
+
244 
+
245 inline uint8_t toBCD(uint8_t value)
+
246 {
+
247  return ((value / 10) << 4) + (value % 10);
+
248 }
+
249 
+
250 void DS3232RTC::writeTime(const RTCTime *value)
+
251 {
+
252  if (_isRealTime) {
+
253  _bus->startWrite(DS3232_I2C_ADDRESS);
+
254  _bus->write(DS3232_SECOND);
+
255  _bus->write(toBCD(value->second));
+
256  _bus->write(toBCD(value->minute));
+
257  _bus->write(toBCD(value->hour)); // Changes mode to 24-hour clock.
+
258  _bus->endWrite();
+
259  } else {
+
260  RTC::writeTime(value);
+
261  }
+
262 }
+
263 
+
264 void DS3232RTC::writeDate(const RTCDate *value)
+
265 {
+
266  if (_isRealTime) {
+
267  _bus->startWrite(DS3232_I2C_ADDRESS);
+
268  _bus->write(DS3232_DATE);
+
269  _bus->write(toBCD(value->day));
+
270  _bus->write(toBCD(value->month));
+
271  _bus->write(toBCD(value->year % 100));
+
272  _bus->endWrite();
+
273  } else {
+
274  RTC::writeDate(value);
+
275  }
+
276 }
+
277 
+
278 void DS3232RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
+
279 {
+
280  if (_isRealTime) {
+
281  _bus->startWrite(DS3232_I2C_ADDRESS);
+
282  _bus->write(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
+
283  if (_bus->startRead(DS3232_I2C_ADDRESS, 3)) {
+
284  value->hour = fromBCD(_bus->read());
+
285  value->minute = fromBCD(_bus->read());
+
286  value->flags = _bus->read();
+
287  } else {
+
288  // RTC chip is not responding.
+
289  value->hour = 0;
+
290  value->minute = 0;
+
291  value->flags = 0;
+
292  }
+
293  } else {
+
294  RTC::readAlarm(alarmNum, value);
+
295  }
+
296 }
+
297 
+
298 void DS3232RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
+
299 {
+
300  if (_isRealTime) {
+
301  // Write the alarm details to NVRAM.
+
302  _bus->startWrite(DS3232_I2C_ADDRESS);
+
303  _bus->write(DS3232_ALARMS + alarmNum * DS3232_ALARM_SIZE);
+
304  _bus->write(toBCD(value->hour));
+
305  _bus->write(toBCD(value->minute));
+
306  _bus->write(value->flags);
+
307  _bus->endWrite();
+
308 
+
309  // Keep the DS3232's built-in alarms in sync with the first two alarms.
+
310  if (alarmNum == 0) {
+
311  _bus->startWrite(DS3232_I2C_ADDRESS);
+
312  _bus->write(DS3232_ALARM1_SEC);
+
313  _bus->write(0);
+
314  _bus->write(toBCD(value->minute));
+
315  _bus->write(toBCD(value->hour));
+
316  _bus->write(0x81); // Match hours, mins, secs; day = 1
+
317  _bus->endWrite();
+
318  if (alarmInterrupts)
+
319  updateAlarmInterrupts();
+
320  } else if (alarmNum == 1) {
+
321  _bus->startWrite(DS3232_I2C_ADDRESS);
+
322  _bus->write(DS3232_ALARM2_MIN);
+
323  _bus->write(toBCD(value->minute));
+
324  _bus->write(toBCD(value->hour));
+
325  _bus->write(0x81); // Match hours, mins; day = 1
+
326  _bus->endWrite();
+
327  if (alarmInterrupts)
+
328  updateAlarmInterrupts();
+
329  }
+
330  } else {
+
331  RTC::writeAlarm(alarmNum, value);
+
332  }
+
333 }
+
334 
+ +
336 {
+
337  return DS3232_ALARMS - DS3232_NVRAM;
+
338 }
+
339 
+
340 uint8_t DS3232RTC::readByte(uint8_t offset)
+
341 {
+
342  if (_isRealTime)
+
343  return readRegister(DS3232_NVRAM + offset);
+
344  else
+
345  return RTC::readByte(offset);
+
346 }
+
347 
+
348 void DS3232RTC::writeByte(uint8_t offset, uint8_t value)
+
349 {
+
350  if (_isRealTime)
+
351  writeRegister(DS3232_NVRAM + offset, value);
+
352  else
+
353  RTC::writeByte(offset, value);
+
354 }
+
355 
+ +
357 {
+
358  if (_isRealTime) {
+
359  return (((int)(signed char)readRegister(DS3232_TEMP_MSB)) << 2) |
+
360  (readRegister(DS3232_TEMP_LSB) >> 6);
+
361  } else {
+
362  return NO_TEMPERATURE;
+
363  }
+
364 }
+
365 
+ +
381 {
+
382  if (_oneHzPin == 255 && _isRealTime) {
+
383  updateAlarmInterrupts();
+
384  alarmInterrupts = true;
+
385  }
+
386 }
+
387 
+ +
394 {
+
395  if (alarmInterrupts) {
+
396  uint8_t value = readRegister(DS3232_CONTROL);
+
397  value &= ~(DS3232_INTCN | DS3232_A2IE | DS3232_A1IE);
+
398  writeRegister(DS3232_CONTROL, value);
+
399  alarmInterrupts = false;
+
400  }
+
401 }
+
402 
+ +
417 {
+
418  if (!_isRealTime)
+
419  return -1;
+
420  uint8_t value = readRegister(DS3232_STATUS);
+
421  int alarm;
+
422  if (value & DS3232_A1F) {
+
423  if (value & DS3232_A2F)
+
424  alarm = 2;
+
425  else
+
426  alarm = 0;
+
427  } else if (value & DS3232_A2F) {
+
428  alarm = 1;
+
429  } else {
+
430  alarm = -1;
+
431  }
+
432  if (alarm != -1) {
+
433  value &= ~(DS3232_A1F | DS3232_A2F);
+
434  writeRegister(DS3232_STATUS, value);
+
435  }
+
436  return alarm;
+
437 }
+
438 
+ +
445 {
+
446  if (_isRealTime) {
+
447  uint8_t value = readRegister(DS3232_STATUS);
+
448  value |= DS3232_BB32KHZ | DS3232_EN32KHZ;
+
449  writeRegister(DS3232_STATUS, value);
+
450  }
+
451 }
+
452 
+ +
459 {
+
460  if (_isRealTime) {
+
461  uint8_t value = readRegister(DS3232_STATUS);
+
462  value &= ~(DS3232_BB32KHZ | DS3232_EN32KHZ);
+
463  writeRegister(DS3232_STATUS, value);
+
464  }
+
465 }
+
466 
+
467 void DS3232RTC::initAlarms()
+
468 {
+
469  uint8_t value = readRegister(DS3232_ALARM_MAGIC);
+
470  if (value != (0xB0 + ALARM_COUNT)) {
+
471  // This is the first time we have used this clock chip,
+
472  // so initialize all alarms to their default state.
+
473  RTCAlarm alarm;
+
474  alarm.hour = 6; // Default to 6am for alarms.
+
475  alarm.minute = 0;
+
476  alarm.flags = 0;
+
477  for (uint8_t index = 0; index < ALARM_COUNT; ++index)
+
478  writeAlarm(index, &alarm);
+
479  writeRegister(DS3232_ALARM_MAGIC, 0xB0 + ALARM_COUNT);
+
480 
+
481  // Also clear the rest of NVRAM so that it is in a known state.
+
482  // Otherwise we'll have whatever garbage was present at power-on.
+
483  _bus->startWrite(DS3232_I2C_ADDRESS);
+
484  _bus->write(DS3232_NVRAM);
+
485  for (uint8_t index = DS3232_NVRAM; index < DS3232_ALARMS; ++index)
+
486  _bus->write(0);
+
487  _bus->endWrite();
+
488  }
+
489 }
+
490 
+
491 uint8_t DS3232RTC::readRegister(uint8_t reg)
+
492 {
+
493  _bus->startWrite(DS3232_I2C_ADDRESS);
+
494  _bus->write(reg);
+
495  if (!_bus->startRead(DS3232_I2C_ADDRESS, 1))
+
496  return 0; // RTC chip is not responding.
+
497  return _bus->read();
+
498 }
+
499 
+
500 bool DS3232RTC::writeRegister(uint8_t reg, uint8_t value)
+
501 {
+
502  _bus->startWrite(DS3232_I2C_ADDRESS);
+
503  _bus->write(reg);
+
504  _bus->write(value);
+
505  return _bus->endWrite();
+
506 }
+
507 
+
508 #define DS3232_ALARM1_FLAGS (DS3232_ALARMS + 2)
+
509 #define DS3232_ALARM2_FLAGS (DS3232_ALARMS + DS3232_ALARM_SIZE + 2)
+
510 
+
511 void DS3232RTC::updateAlarmInterrupts()
+
512 {
+
513  bool alarm1Enabled = ((readRegister(DS3232_ALARM1_FLAGS) & 0x01) != 0);
+
514  bool alarm2Enabled = ((readRegister(DS3232_ALARM2_FLAGS) & 0x01) != 0);
+
515  uint8_t value = readRegister(DS3232_CONTROL);
+
516  value |= DS3232_INTCN;
+
517  if (alarm1Enabled)
+
518  value |= DS3232_A1IE;
+
519  else
+
520  value &= ~DS3232_A1IE;
+
521  if (alarm2Enabled)
+
522  value |= DS3232_A2IE;
+
523  else
+
524  value &= ~DS3232_A2IE;
+
525  writeRegister(DS3232_CONTROL, value);
+
526 }
+
+ + diff --git a/DS3232RTC_8h_source.html b/DS3232RTC_8h_source.html index a3f580dc..09bbe9ea 100644 --- a/DS3232RTC_8h_source.html +++ b/DS3232RTC_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DS3232RTC.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DS3232RTC.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef DS3232RTC_h
-00024 #define DS3232RTC_h
-00025 
-00026 #include "RTC.h"
-00027 
-00028 class I2CMaster;
-00029 
-00030 class DS3232RTC : public RTC {
-00031 public:
-00032     DS3232RTC(I2CMaster &bus, uint8_t oneHzPin = 255);
-00033 
-00034     bool isRealTime() const { return _isRealTime; }
-00035 
-00036     bool hasUpdates();
-00037 
-00038     void readTime(RTCTime *value);
-00039     void readDate(RTCDate *value);
-00040 
-00041     void writeTime(const RTCTime *value);
-00042     void writeDate(const RTCDate *value);
-00043 
-00044     void readAlarm(uint8_t alarmNum, RTCAlarm *value);
-00045     void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
-00046 
-00047     int byteCount() const;
-00048     uint8_t readByte(uint8_t offset);
-00049     void writeByte(uint8_t offset, uint8_t value);
-00050 
-00051     int readTemperature();
-00052 
-00053     void enableAlarmInterrupts();
-00054     void disableAlarmInterrupts();
-00055     int firedAlarm();
-00056 
-00057     void enable32kHzOutput();
-00058     void disable32kHzOutput();
-00059 
-00060 private:
-00061     I2CMaster *_bus;
-00062     uint8_t _oneHzPin;
-00063     bool prevOneHz;
-00064     bool _isRealTime;
-00065     bool alarmInterrupts;
-00066 
-00067     void initAlarms();
-00068 
-00069     uint8_t readRegister(uint8_t reg);
-00070     bool writeRegister(uint8_t reg, uint8_t value);
-00071 
-00072     void updateAlarmInterrupts();
-00073 };
-00074 
-00075 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -151,8 +77,97 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DS3232RTC.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef DS3232RTC_h
+
24 #define DS3232RTC_h
+
25 
+
26 #include "RTC.h"
+
27 
+
28 class I2CMaster;
+
29 
+
30 class DS3232RTC : public RTC {
+
31 public:
+
32  DS3232RTC(I2CMaster &bus, uint8_t oneHzPin = 255);
+
33 
+
34  bool isRealTime() const { return _isRealTime; }
+
35 
+
36  bool hasUpdates();
+
37 
+
38  void readTime(RTCTime *value);
+
39  void readDate(RTCDate *value);
+
40 
+
41  void writeTime(const RTCTime *value);
+
42  void writeDate(const RTCDate *value);
+
43 
+
44  void readAlarm(uint8_t alarmNum, RTCAlarm *value);
+
45  void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
+
46 
+
47  int byteCount() const;
+
48  uint8_t readByte(uint8_t offset);
+
49  void writeByte(uint8_t offset, uint8_t value);
+
50 
+
51  int readTemperature();
+
52 
+
53  void enableAlarmInterrupts();
+ +
55  int firedAlarm();
+
56 
+
57  void enable32kHzOutput();
+
58  void disable32kHzOutput();
+
59 
+
60 private:
+
61  I2CMaster *_bus;
+
62  uint8_t _oneHzPin;
+
63  bool prevOneHz;
+
64  bool _isRealTime;
+
65  bool alarmInterrupts;
+
66 
+
67  void initAlarms();
+
68 
+
69  uint8_t readRegister(uint8_t reg);
+
70  bool writeRegister(uint8_t reg, uint8_t value);
+
71 
+
72  void updateAlarmInterrupts();
+
73 };
+
74 
+
75 #endif
+
+ + diff --git a/DejaVuSans9_8h_source.html b/DejaVuSans9_8h_source.html index b7265c44..42f07a01 100644 --- a/DejaVuSans9_8h_source.html +++ b/DejaVuSans9_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DejaVuSans9.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DejaVuSans9.h
-
-
-
00001 
-00002 
-00003 /*
-00004  *
-00005  * DejaVuSans9
-00006  *
-00007  * created with FontCreator
-00008  * written by F. Maximilian Thiele
-00009  *
-00010  * http://www.apetech.de/fontCreator
-00011  * me@apetech.de
-00012  *
-00013  * File Name           : DejaVuSans9.h
-00014  * Date                : 28.05.2012
-00015  * Font size in bytes  : 3962
-00016  * Font width          : 10
-00017  * Font height         : 10
-00018  * Font first char     : 32
-00019  * Font last char      : 128
-00020  * Font used chars     : 96
-00021  *
-00022  * The font data are defined as
-00023  *
-00024  * struct _FONT_ {
-00025  *     uint16_t   font_Size_in_Bytes_over_all_included_Size_it_self;
-00026  *     uint8_t    font_Width_in_Pixel_for_fixed_drawing;
-00027  *     uint8_t    font_Height_in_Pixel_for_all_characters;
-00028  *     unit8_t    font_First_Char;
-00029  *     uint8_t    font_Char_Count;
-00030  *
-00031  *     uint8_t    font_Char_Widths[font_Last_Char - font_First_Char +1];
-00032  *                  // for each character the separate width in pixels,
-00033  *                  // characters < 128 have an implicit virtual right empty row
-00034  *
-00035  *     uint8_t    font_data[];
-00036  *                  // bit field of all characters
-00037  */
-00038 
-00039 #include <inttypes.h>
-00040 #include <avr/pgmspace.h>
-00041 
-00042 #ifndef DEJAVUSANS9_H
-00043 #define DEJAVUSANS9_H
-00044 
-00045 #define DEJAVUSANS9_WIDTH 10
-00046 #define DEJAVUSANS9_HEIGHT 10
-00047 
-00048 static uint8_t DejaVuSans9[] PROGMEM = {
-00049     0x0F, 0x7A, // size
-00050     0x0A, // width
-00051     0x0A, // height
-00052     0x20, // first char
-00053     0x60, // char count
-00054     
-00055     // char widths
-00056     0x00, 0x01, 0x03, 0x06, 0x05, 0x08, 0x06, 0x01, 0x02, 0x02, 
-00057     0x05, 0x05, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x04, 
-00058     0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x01, 0x01, 0x06, 0x06, 
-00059     0x06, 0x04, 0x08, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x05, 
-00060     0x05, 0x01, 0x02, 0x05, 0x04, 0x06, 0x05, 0x05, 0x04, 0x05, 
-00061     0x05, 0x05, 0x05, 0x05, 0x06, 0x07, 0x06, 0x05, 0x05, 0x02, 
-00062     0x03, 0x02, 0x04, 0x05, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04, 
-00063     0x03, 0x04, 0x04, 0x01, 0x02, 0x04, 0x01, 0x07, 0x04, 0x04, 
-00064     0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x05, 0x07, 0x05, 0x05, 
-00065     0x04, 0x03, 0x01, 0x03, 0x06, 0x05, 
-00066     
-00067     // font data
-00068     0xBE, 0x00, // 33
-00069     0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
-00070     0x28, 0xE8, 0x3E, 0xE8, 0x3E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
-00071     0x98, 0x94, 0xFE, 0xA4, 0x64, 0x00, 0x00, 0x40, 0x00, 0x00, // 36
-00072     0x1E, 0x12, 0xDE, 0x30, 0x18, 0xF6, 0x90, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
-00073     0x60, 0x9C, 0x92, 0x62, 0xC4, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
-00074     0x06, 0x00, // 39
-00075     0x7E, 0x81, 0x00, 0x00, // 40
-00076     0xC3, 0x3C, 0x00, 0x00, // 41
-00077     0x12, 0x0C, 0x1E, 0x0C, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
-00078     0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
-00079     0x80, 0x40, // 44
-00080     0x20, 0x20, 0x00, 0x00, // 45
-00081     0x80, 0x00, // 46
-00082     0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 47
-00083     0x7C, 0x82, 0x82, 0x7C, 0x00, 0x00, 0x00, 0x00, // 48
-00084     0x82, 0xFE, 0x80, 0x00, 0x00, 0x00, // 49
-00085     0xC4, 0xA2, 0x92, 0x8C, 0x00, 0x00, 0x00, 0x00, // 50
-00086     0x84, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, // 51
-00087     0x60, 0x58, 0x44, 0xFE, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
-00088     0x9E, 0x92, 0x92, 0x62, 0x00, 0x00, 0x00, 0x00, // 53
-00089     0x7C, 0x96, 0x92, 0x62, 0x00, 0x00, 0x00, 0x00, // 54
-00090     0x02, 0xC2, 0x3A, 0x06, 0x00, 0x00, 0x00, 0x00, // 55
-00091     0x6C, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, // 56
-00092     0x9C, 0x92, 0xD2, 0x7C, 0x00, 0x00, 0x00, 0x00, // 57
-00093     0x88, 0x00, // 58
-00094     0x88, 0x40, // 59
-00095     0x20, 0x20, 0x50, 0x50, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
-00096     0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
-00097     0x88, 0x50, 0x50, 0x50, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
-00098     0x02, 0xB2, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, // 63
-00099     0x78, 0x84, 0x32, 0x4A, 0x4A, 0xFA, 0x44, 0x38, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 64
-00100     0xC0, 0x38, 0x26, 0x26, 0x38, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
-00101     0xFE, 0x92, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
-00102     0x7C, 0xC6, 0x82, 0x82, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
-00103     0xFE, 0x82, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
-00104     0xFE, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, // 69
-00105     0xFE, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, // 70
-00106     0x7C, 0xC6, 0x82, 0x92, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
-00107     0xFE, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
-00108     0xFE, 0x00, // 73
-00109     0x00, 0xFE, 0x80, 0x40, // 74
-00110     0xFE, 0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
-00111     0xFE, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, // 76
-00112     0xFE, 0x0C, 0x30, 0x30, 0x0C, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
-00113     0xFE, 0x0C, 0x10, 0x60, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
-00114     0x7C, 0xC6, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
-00115     0xFE, 0x12, 0x12, 0x0C, 0x00, 0x00, 0x00, 0x00, // 80
-00116     0x7C, 0xC6, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x40, 0x00, // 81
-00117     0xFE, 0x12, 0x32, 0x4E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
-00118     0x4C, 0x92, 0x92, 0x92, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
-00119     0x02, 0x02, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
-00120     0x7E, 0x80, 0x80, 0x80, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
-00121     0x06, 0x38, 0xC0, 0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
-00122     0x06, 0x38, 0xE0, 0x1E, 0xE0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
-00123     0x82, 0x46, 0x38, 0x38, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
-00124     0x02, 0x0C, 0xF0, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
-00125     0xC2, 0xA2, 0x92, 0x8A, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
-00126     0xFE, 0x02, 0x40, 0x40, // 91
-00127     0x06, 0x38, 0xC0, 0x00, 0x00, 0x00, // 92
-00128     0x02, 0xFE, 0x40, 0x40, // 93
-00129     0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
-00130     0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
-00131     0x01, 0x02, 0x00, 0x00, // 96
-00132     0xE0, 0xA8, 0xA8, 0xF8, 0x00, 0x00, 0x00, 0x00, // 97
-00133     0xFF, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, // 98
-00134     0x70, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 99
-00135     0x70, 0x88, 0x88, 0xFF, 0x00, 0x00, 0x00, 0x00, // 100
-00136     0x70, 0xA8, 0xA8, 0xB0, 0x00, 0x00, 0x00, 0x00, // 101
-00137     0x08, 0xFF, 0x09, 0x00, 0x00, 0x00, // 102
-00138     0x70, 0x88, 0x88, 0xF8, 0x00, 0x80, 0x80, 0x40, // 103
-00139     0xFF, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, // 104
-00140     0xFA, 0x00, // 105
-00141     0x00, 0xFA, 0x80, 0xC0, // 106
-00142     0xFF, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, // 107
-00143     0xFF, 0x00, // 108
-00144     0xF8, 0x08, 0x08, 0xF8, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
-00145     0xF8, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, // 110
-00146     0x70, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, // 111
-00147     0xF8, 0x88, 0x88, 0x70, 0xC0, 0x00, 0x00, 0x00, // 112
-00148     0x70, 0x88, 0x88, 0xF8, 0x00, 0x00, 0x00, 0xC0, // 113
-00149     0xF8, 0x08, 0x08, 0x00, 0x00, 0x00, // 114
-00150     0x98, 0xA8, 0xE8, 0x00, 0x00, 0x00, // 115
-00151     0x08, 0xFC, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 116
-00152     0xF8, 0x80, 0x80, 0xF8, 0x00, 0x00, 0x00, 0x00, // 117
-00153     0x18, 0x60, 0x80, 0x60, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
-00154     0x38, 0xC0, 0x30, 0x08, 0x30, 0xC0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
-00155     0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
-00156     0x18, 0x60, 0x80, 0x60, 0x18, 0x80, 0x80, 0x40, 0x00, 0x00, // 121
-00157     0x88, 0xC8, 0xA8, 0x98, 0x00, 0x00, 0x00, 0x00, // 122
-00158     0x10, 0xEE, 0x02, 0x00, 0x40, 0x40, // 123
-00159     0xFE, 0xC0, // 124
-00160     0x02, 0xEE, 0x10, 0x40, 0x40, 0x00, // 125
-00161     0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
-00162     0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
-00163     
-00164 };
-00165 
-00166 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -242,8 +77,188 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DejaVuSans9.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * DejaVuSans9
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : DejaVuSans9.h
+
14  * Date : 28.05.2012
+
15  * Font size in bytes : 3962
+
16  * Font width : 10
+
17  * Font height : 10
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef DEJAVUSANS9_H
+
43 #define DEJAVUSANS9_H
+
44 
+
45 #define DEJAVUSANS9_WIDTH 10
+
46 #define DEJAVUSANS9_HEIGHT 10
+
47 
+
48 static uint8_t const DejaVuSans9[] PROGMEM = {
+
49  0x0F, 0x7A, // size
+
50  0x0A, // width
+
51  0x0A, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // char widths
+
56  0x00, 0x01, 0x03, 0x06, 0x05, 0x08, 0x06, 0x01, 0x02, 0x02,
+
57  0x05, 0x05, 0x01, 0x02, 0x01, 0x03, 0x04, 0x03, 0x04, 0x04,
+
58  0x05, 0x04, 0x04, 0x04, 0x04, 0x04, 0x01, 0x01, 0x06, 0x06,
+
59  0x06, 0x04, 0x08, 0x06, 0x05, 0x05, 0x05, 0x04, 0x04, 0x05,
+
60  0x05, 0x01, 0x02, 0x05, 0x04, 0x06, 0x05, 0x05, 0x04, 0x05,
+
61  0x05, 0x05, 0x05, 0x05, 0x06, 0x07, 0x06, 0x05, 0x05, 0x02,
+
62  0x03, 0x02, 0x04, 0x05, 0x02, 0x04, 0x04, 0x04, 0x04, 0x04,
+
63  0x03, 0x04, 0x04, 0x01, 0x02, 0x04, 0x01, 0x07, 0x04, 0x04,
+
64  0x04, 0x04, 0x03, 0x03, 0x04, 0x04, 0x05, 0x07, 0x05, 0x05,
+
65  0x04, 0x03, 0x01, 0x03, 0x06, 0x05,
+
66 
+
67  // font data
+
68  0xBE, 0x00, // 33
+
69  0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
+
70  0x28, 0xE8, 0x3E, 0xE8, 0x3E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
+
71  0x98, 0x94, 0xFE, 0xA4, 0x64, 0x00, 0x00, 0x40, 0x00, 0x00, // 36
+
72  0x1E, 0x12, 0xDE, 0x30, 0x18, 0xF6, 0x90, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
+
73  0x60, 0x9C, 0x92, 0x62, 0xC4, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
+
74  0x06, 0x00, // 39
+
75  0x7E, 0x81, 0x00, 0x00, // 40
+
76  0xC3, 0x3C, 0x00, 0x00, // 41
+
77  0x12, 0x0C, 0x1E, 0x0C, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
+
78  0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
+
79  0x80, 0x40, // 44
+
80  0x20, 0x20, 0x00, 0x00, // 45
+
81  0x80, 0x00, // 46
+
82  0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 47
+
83  0x7C, 0x82, 0x82, 0x7C, 0x00, 0x00, 0x00, 0x00, // 48
+
84  0x82, 0xFE, 0x80, 0x00, 0x00, 0x00, // 49
+
85  0xC4, 0xA2, 0x92, 0x8C, 0x00, 0x00, 0x00, 0x00, // 50
+
86  0x84, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, // 51
+
87  0x60, 0x58, 0x44, 0xFE, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
+
88  0x9E, 0x92, 0x92, 0x62, 0x00, 0x00, 0x00, 0x00, // 53
+
89  0x7C, 0x96, 0x92, 0x62, 0x00, 0x00, 0x00, 0x00, // 54
+
90  0x02, 0xC2, 0x3A, 0x06, 0x00, 0x00, 0x00, 0x00, // 55
+
91  0x6C, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, // 56
+
92  0x9C, 0x92, 0xD2, 0x7C, 0x00, 0x00, 0x00, 0x00, // 57
+
93  0x88, 0x00, // 58
+
94  0x88, 0x40, // 59
+
95  0x20, 0x20, 0x50, 0x50, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
+
96  0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
+
97  0x88, 0x50, 0x50, 0x50, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
+
98  0x02, 0xB2, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, // 63
+
99  0x78, 0x84, 0x32, 0x4A, 0x4A, 0xFA, 0x44, 0x38, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 64
+
100  0xC0, 0x38, 0x26, 0x26, 0x38, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
+
101  0xFE, 0x92, 0x92, 0x92, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
+
102  0x7C, 0xC6, 0x82, 0x82, 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
+
103  0xFE, 0x82, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
+
104  0xFE, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, // 69
+
105  0xFE, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, // 70
+
106  0x7C, 0xC6, 0x82, 0x92, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
+
107  0xFE, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
+
108  0xFE, 0x00, // 73
+
109  0x00, 0xFE, 0x80, 0x40, // 74
+
110  0xFE, 0x10, 0x28, 0x44, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
+
111  0xFE, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, // 76
+
112  0xFE, 0x0C, 0x30, 0x30, 0x0C, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
+
113  0xFE, 0x0C, 0x10, 0x60, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
+
114  0x7C, 0xC6, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
+
115  0xFE, 0x12, 0x12, 0x0C, 0x00, 0x00, 0x00, 0x00, // 80
+
116  0x7C, 0xC6, 0x82, 0xC6, 0x7C, 0x00, 0x00, 0x00, 0x40, 0x00, // 81
+
117  0xFE, 0x12, 0x32, 0x4E, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
+
118  0x4C, 0x92, 0x92, 0x92, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
+
119  0x02, 0x02, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
+
120  0x7E, 0x80, 0x80, 0x80, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
+
121  0x06, 0x38, 0xC0, 0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
+
122  0x06, 0x38, 0xE0, 0x1E, 0xE0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
+
123  0x82, 0x46, 0x38, 0x38, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
+
124  0x02, 0x0C, 0xF0, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
+
125  0xC2, 0xA2, 0x92, 0x8A, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
+
126  0xFE, 0x02, 0x40, 0x40, // 91
+
127  0x06, 0x38, 0xC0, 0x00, 0x00, 0x00, // 92
+
128  0x02, 0xFE, 0x40, 0x40, // 93
+
129  0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
+
130  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
+
131  0x01, 0x02, 0x00, 0x00, // 96
+
132  0xE0, 0xA8, 0xA8, 0xF8, 0x00, 0x00, 0x00, 0x00, // 97
+
133  0xFF, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, // 98
+
134  0x70, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 99
+
135  0x70, 0x88, 0x88, 0xFF, 0x00, 0x00, 0x00, 0x00, // 100
+
136  0x70, 0xA8, 0xA8, 0xB0, 0x00, 0x00, 0x00, 0x00, // 101
+
137  0x08, 0xFF, 0x09, 0x00, 0x00, 0x00, // 102
+
138  0x70, 0x88, 0x88, 0xF8, 0x00, 0x80, 0x80, 0x40, // 103
+
139  0xFF, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, // 104
+
140  0xFA, 0x00, // 105
+
141  0x00, 0xFA, 0x80, 0xC0, // 106
+
142  0xFF, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, // 107
+
143  0xFF, 0x00, // 108
+
144  0xF8, 0x08, 0x08, 0xF8, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
+
145  0xF8, 0x08, 0x08, 0xF8, 0x00, 0x00, 0x00, 0x00, // 110
+
146  0x70, 0x88, 0x88, 0x70, 0x00, 0x00, 0x00, 0x00, // 111
+
147  0xF8, 0x88, 0x88, 0x70, 0xC0, 0x00, 0x00, 0x00, // 112
+
148  0x70, 0x88, 0x88, 0xF8, 0x00, 0x00, 0x00, 0xC0, // 113
+
149  0xF8, 0x08, 0x08, 0x00, 0x00, 0x00, // 114
+
150  0x98, 0xA8, 0xE8, 0x00, 0x00, 0x00, // 115
+
151  0x08, 0xFC, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 116
+
152  0xF8, 0x80, 0x80, 0xF8, 0x00, 0x00, 0x00, 0x00, // 117
+
153  0x18, 0x60, 0x80, 0x60, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
+
154  0x38, 0xC0, 0x30, 0x08, 0x30, 0xC0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
+
155  0x88, 0x50, 0x20, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
+
156  0x18, 0x60, 0x80, 0x60, 0x18, 0x80, 0x80, 0x40, 0x00, 0x00, // 121
+
157  0x88, 0xC8, 0xA8, 0x98, 0x00, 0x00, 0x00, 0x00, // 122
+
158  0x10, 0xEE, 0x02, 0x00, 0x40, 0x40, // 123
+
159  0xFE, 0xC0, // 124
+
160  0x02, 0xEE, 0x10, 0x40, 0x40, 0x00, // 125
+
161  0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
+
162  0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
+
163 
+
164 };
+
165 
+
166 #endif
+
+ + diff --git a/DejaVuSansBold9_8h_source.html b/DejaVuSansBold9_8h_source.html index f5068543..ee8c9f9c 100644 --- a/DejaVuSansBold9_8h_source.html +++ b/DejaVuSansBold9_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DejaVuSansBold9.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DejaVuSansBold9.h
-
-
-
00001 
-00002 
-00003 /*
-00004  *
-00005  * DejaVuSansBold9
-00006  *
-00007  * created with FontCreator
-00008  * written by F. Maximilian Thiele
-00009  *
-00010  * http://www.apetech.de/fontCreator
-00011  * me@apetech.de
-00012  *
-00013  * File Name           : DejaVuSansBold9.h
-00014  * Date                : 28.05.2012
-00015  * Font size in bytes  : 4662
-00016  * Font width          : 10
-00017  * Font height         : 10
-00018  * Font first char     : 32
-00019  * Font last char      : 128
-00020  * Font used chars     : 96
-00021  *
-00022  * The font data are defined as
-00023  *
-00024  * struct _FONT_ {
-00025  *     uint16_t   font_Size_in_Bytes_over_all_included_Size_it_self;
-00026  *     uint8_t    font_Width_in_Pixel_for_fixed_drawing;
-00027  *     uint8_t    font_Height_in_Pixel_for_all_characters;
-00028  *     unit8_t    font_First_Char;
-00029  *     uint8_t    font_Char_Count;
-00030  *
-00031  *     uint8_t    font_Char_Widths[font_Last_Char - font_First_Char +1];
-00032  *                  // for each character the separate width in pixels,
-00033  *                  // characters < 128 have an implicit virtual right empty row
-00034  *
-00035  *     uint8_t    font_data[];
-00036  *                  // bit field of all characters
-00037  */
-00038 
-00039 #include <inttypes.h>
-00040 #include <avr/pgmspace.h>
-00041 
-00042 #ifndef DEJAVUSANSBOLD9_H
-00043 #define DEJAVUSANSBOLD9_H
-00044 
-00045 #define DEJAVUSANSBOLD9_WIDTH 10
-00046 #define DEJAVUSANSBOLD9_HEIGHT 10
-00047 
-00048 static uint8_t DejaVuSansBold9[] PROGMEM = {
-00049     0x12, 0x36, // size
-00050     0x0A, // width
-00051     0x0A, // height
-00052     0x20, // first char
-00053     0x60, // char count
-00054     
-00055     // char widths
-00056     0x00, 0x02, 0x03, 0x06, 0x05, 0x08, 0x07, 0x01, 0x03, 0x03, 
-00057     0x05, 0x05, 0x02, 0x03, 0x02, 0x03, 0x05, 0x05, 0x05, 0x05, 
-00058     0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x02, 0x02, 0x06, 0x06, 
-00059     0x06, 0x04, 0x08, 0x07, 0x05, 0x06, 0x06, 0x05, 0x05, 0x06, 
-00060     0x07, 0x02, 0x03, 0x06, 0x05, 0x07, 0x06, 0x06, 0x05, 0x06, 
-00061     0x06, 0x05, 0x06, 0x06, 0x07, 0x09, 0x07, 0x06, 0x06, 0x03, 
-00062     0x03, 0x03, 0x04, 0x05, 0x02, 0x05, 0x05, 0x04, 0x05, 0x05, 
-00063     0x04, 0x05, 0x05, 0x02, 0x03, 0x05, 0x02, 0x08, 0x05, 0x05, 
-00064     0x05, 0x05, 0x03, 0x04, 0x03, 0x05, 0x06, 0x08, 0x06, 0x06, 
-00065     0x04, 0x04, 0x01, 0x04, 0x06, 0x05, 
-00066     
-00067     // font data
-00068     0xDE, 0xDE, 0x00, 0x00, // 33
-00069     0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
-00070     0x28, 0xF8, 0x2E, 0xF8, 0x2E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
-00071     0x98, 0xB4, 0xFE, 0xB4, 0x64, 0x00, 0x00, 0x40, 0x00, 0x00, // 36
-00072     0x0C, 0x12, 0xD2, 0x7C, 0x78, 0x96, 0x90, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
-00073     0x60, 0xFC, 0x9E, 0xB2, 0x62, 0xE0, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
-00074     0x06, 0x00, // 39
-00075     0x3C, 0xFF, 0x81, 0x00, 0x00, 0x00, // 40
-00076     0x81, 0xFF, 0x3C, 0x00, 0x00, 0x00, // 41
-00077     0x14, 0x18, 0x3E, 0x18, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
-00078     0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
-00079     0xC0, 0xC0, 0x40, 0x00, // 44
-00080     0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 45
-00081     0xC0, 0xC0, 0x00, 0x00, // 46
-00082     0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 47
-00083     0x7C, 0xFE, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 48
-00084     0x82, 0x82, 0xFE, 0xFE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 49
-00085     0xC2, 0xE2, 0xB2, 0x9E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, // 50
-00086     0x82, 0x92, 0x92, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 51
-00087     0x60, 0x58, 0x44, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
-00088     0x9E, 0x9E, 0x92, 0xF2, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, // 53
-00089     0x7C, 0xFE, 0x96, 0xF2, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, // 54
-00090     0x82, 0xE2, 0x7A, 0x1E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, // 55
-00091     0x6C, 0xEE, 0x92, 0xEE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 56
-00092     0x8C, 0x9E, 0xD2, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 57
-00093     0xD8, 0xD8, 0x00, 0x00, // 58
-00094     0xD8, 0xD8, 0x40, 0x00, // 59
-00095     0x20, 0x50, 0x50, 0x50, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
-00096     0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
-00097     0x88, 0xD8, 0x50, 0x50, 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
-00098     0x02, 0xDA, 0xDE, 0x0E, 0x00, 0x00, 0x00, 0x00, // 63
-00099     0x78, 0x84, 0x32, 0x4A, 0x4A, 0xFA, 0x44, 0x38, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 64
-00100     0x80, 0xF0, 0x7E, 0x4E, 0x7E, 0xF0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
-00101     0xFE, 0xFE, 0x92, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
-00102     0x38, 0x7C, 0xC6, 0x82, 0x82, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
-00103     0xFE, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
-00104     0xFE, 0xFE, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, // 69
-00105     0xFE, 0xFE, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 70
-00106     0x78, 0xFC, 0x86, 0x92, 0xF2, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
-00107     0xFE, 0xFE, 0x10, 0x10, 0x10, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
-00108     0xFE, 0xFE, 0x00, 0x00, // 73
-00109     0x00, 0xFE, 0xFE, 0x80, 0xC0, 0x40, // 74
-00110     0xFE, 0xFE, 0x38, 0x6C, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
-00111     0xFE, 0xFE, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 76
-00112     0xFE, 0xFE, 0x0C, 0x30, 0x0C, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
-00113     0xFE, 0xFE, 0x0C, 0x30, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
-00114     0x7C, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
-00115     0xFE, 0xFE, 0x12, 0x1E, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 80
-00116     0x7C, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, // 81
-00117     0xFE, 0xFE, 0x12, 0x7E, 0xEC, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
-00118     0xCC, 0x9E, 0x92, 0xF2, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
-00119     0x02, 0x02, 0xFE, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
-00120     0x7E, 0xFE, 0x80, 0x80, 0xFE, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
-00121     0x02, 0x1E, 0xF8, 0xC0, 0xF8, 0x1E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
-00122     0x0E, 0xFE, 0xE0, 0x3C, 0x06, 0x3C, 0xE0, 0xFE, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
-00123     0x82, 0xC6, 0x7C, 0x10, 0x7C, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
-00124     0x06, 0x0E, 0xF8, 0xF8, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
-00125     0xC2, 0xE2, 0xB2, 0x9A, 0x8E, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
-00126     0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, // 91
-00127     0x06, 0x38, 0xC0, 0x00, 0x00, 0x00, // 92
-00128     0x81, 0xFF, 0xFF, 0x00, 0x00, 0x00, // 93
-00129     0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
-00130     0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
-00131     0x01, 0x02, 0x00, 0x00, // 96
-00132     0xE8, 0xE8, 0xA8, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, // 97
-00133     0xFF, 0xFF, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 98
-00134     0x70, 0xF8, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 99
-00135     0x70, 0xF8, 0x88, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 100
-00136     0x70, 0xF8, 0xA8, 0xB8, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, // 101
-00137     0x08, 0xFE, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, // 102
-00138     0x70, 0xF8, 0x88, 0xF8, 0xF8, 0x00, 0x80, 0x80, 0xC0, 0x40, // 103
-00139     0xFF, 0xFF, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 104
-00140     0xFB, 0xFB, 0x00, 0x00, // 105
-00141     0x00, 0xFB, 0xFB, 0x80, 0xC0, 0x40, // 106
-00142     0xFF, 0xFF, 0x70, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 107
-00143     0xFF, 0xFF, 0x00, 0x00, // 108
-00144     0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
-00145     0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 110
-00146     0x70, 0xF8, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 111
-00147     0xF8, 0xF8, 0x88, 0xF8, 0x70, 0xC0, 0xC0, 0x00, 0x00, 0x00, // 112
-00148     0x70, 0xF8, 0x88, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0xC0, 0xC0, // 113
-00149     0xF8, 0xF8, 0x08, 0x00, 0x00, 0x00, // 114
-00150     0xB0, 0xB8, 0xE8, 0x68, 0x00, 0x00, 0x00, 0x00, // 115
-00151     0xFC, 0xFC, 0x88, 0x00, 0x00, 0x00, // 116
-00152     0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
-00153     0x18, 0x78, 0xC0, 0xC0, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
-00154     0x18, 0xF8, 0xE0, 0x38, 0x38, 0xE0, 0xF8, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
-00155     0x88, 0xD8, 0x70, 0x70, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
-00156     0x08, 0x38, 0xE0, 0xE0, 0x38, 0x08, 0x00, 0x80, 0xC0, 0x00, 0x00, 0x00, // 121
-00157     0xC8, 0xE8, 0xB8, 0x98, 0x00, 0x00, 0x00, 0x00, // 122
-00158     0x08, 0xFF, 0xF7, 0x81, 0x00, 0x00, 0x00, 0x00, // 123
-00159     0xFE, 0xC0, // 124
-00160     0x81, 0xF7, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, // 125
-00161     0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
-00162     0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
-00163     
-00164 };
-00165 
-00166 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -242,8 +77,188 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DejaVuSansBold9.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * DejaVuSansBold9
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : DejaVuSansBold9.h
+
14  * Date : 28.05.2012
+
15  * Font size in bytes : 4662
+
16  * Font width : 10
+
17  * Font height : 10
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef DEJAVUSANSBOLD9_H
+
43 #define DEJAVUSANSBOLD9_H
+
44 
+
45 #define DEJAVUSANSBOLD9_WIDTH 10
+
46 #define DEJAVUSANSBOLD9_HEIGHT 10
+
47 
+
48 static uint8_t const DejaVuSansBold9[] PROGMEM = {
+
49  0x12, 0x36, // size
+
50  0x0A, // width
+
51  0x0A, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // char widths
+
56  0x00, 0x02, 0x03, 0x06, 0x05, 0x08, 0x07, 0x01, 0x03, 0x03,
+
57  0x05, 0x05, 0x02, 0x03, 0x02, 0x03, 0x05, 0x05, 0x05, 0x05,
+
58  0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x02, 0x02, 0x06, 0x06,
+
59  0x06, 0x04, 0x08, 0x07, 0x05, 0x06, 0x06, 0x05, 0x05, 0x06,
+
60  0x07, 0x02, 0x03, 0x06, 0x05, 0x07, 0x06, 0x06, 0x05, 0x06,
+
61  0x06, 0x05, 0x06, 0x06, 0x07, 0x09, 0x07, 0x06, 0x06, 0x03,
+
62  0x03, 0x03, 0x04, 0x05, 0x02, 0x05, 0x05, 0x04, 0x05, 0x05,
+
63  0x04, 0x05, 0x05, 0x02, 0x03, 0x05, 0x02, 0x08, 0x05, 0x05,
+
64  0x05, 0x05, 0x03, 0x04, 0x03, 0x05, 0x06, 0x08, 0x06, 0x06,
+
65  0x04, 0x04, 0x01, 0x04, 0x06, 0x05,
+
66 
+
67  // font data
+
68  0xDE, 0xDE, 0x00, 0x00, // 33
+
69  0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
+
70  0x28, 0xF8, 0x2E, 0xF8, 0x2E, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
+
71  0x98, 0xB4, 0xFE, 0xB4, 0x64, 0x00, 0x00, 0x40, 0x00, 0x00, // 36
+
72  0x0C, 0x12, 0xD2, 0x7C, 0x78, 0x96, 0x90, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
+
73  0x60, 0xFC, 0x9E, 0xB2, 0x62, 0xE0, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
+
74  0x06, 0x00, // 39
+
75  0x3C, 0xFF, 0x81, 0x00, 0x00, 0x00, // 40
+
76  0x81, 0xFF, 0x3C, 0x00, 0x00, 0x00, // 41
+
77  0x14, 0x18, 0x3E, 0x18, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
+
78  0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
+
79  0xC0, 0xC0, 0x40, 0x00, // 44
+
80  0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 45
+
81  0xC0, 0xC0, 0x00, 0x00, // 46
+
82  0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 47
+
83  0x7C, 0xFE, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 48
+
84  0x82, 0x82, 0xFE, 0xFE, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 49
+
85  0xC2, 0xE2, 0xB2, 0x9E, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, // 50
+
86  0x82, 0x92, 0x92, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 51
+
87  0x60, 0x58, 0x44, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
+
88  0x9E, 0x9E, 0x92, 0xF2, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, // 53
+
89  0x7C, 0xFE, 0x96, 0xF2, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, // 54
+
90  0x82, 0xE2, 0x7A, 0x1E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, // 55
+
91  0x6C, 0xEE, 0x92, 0xEE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 56
+
92  0x8C, 0x9E, 0xD2, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, // 57
+
93  0xD8, 0xD8, 0x00, 0x00, // 58
+
94  0xD8, 0xD8, 0x40, 0x00, // 59
+
95  0x20, 0x50, 0x50, 0x50, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
+
96  0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
+
97  0x88, 0xD8, 0x50, 0x50, 0x50, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
+
98  0x02, 0xDA, 0xDE, 0x0E, 0x00, 0x00, 0x00, 0x00, // 63
+
99  0x78, 0x84, 0x32, 0x4A, 0x4A, 0xFA, 0x44, 0x38, 0x00, 0x00, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, // 64
+
100  0x80, 0xF0, 0x7E, 0x4E, 0x7E, 0xF0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
+
101  0xFE, 0xFE, 0x92, 0xFE, 0x6C, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
+
102  0x38, 0x7C, 0xC6, 0x82, 0x82, 0xC6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
+
103  0xFE, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
+
104  0xFE, 0xFE, 0x92, 0x92, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, // 69
+
105  0xFE, 0xFE, 0x12, 0x12, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 70
+
106  0x78, 0xFC, 0x86, 0x92, 0xF2, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
+
107  0xFE, 0xFE, 0x10, 0x10, 0x10, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
+
108  0xFE, 0xFE, 0x00, 0x00, // 73
+
109  0x00, 0xFE, 0xFE, 0x80, 0xC0, 0x40, // 74
+
110  0xFE, 0xFE, 0x38, 0x6C, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
+
111  0xFE, 0xFE, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, // 76
+
112  0xFE, 0xFE, 0x0C, 0x30, 0x0C, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
+
113  0xFE, 0xFE, 0x0C, 0x30, 0xFE, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
+
114  0x7C, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
+
115  0xFE, 0xFE, 0x12, 0x1E, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 80
+
116  0x7C, 0xFE, 0x82, 0x82, 0xFE, 0x7C, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, // 81
+
117  0xFE, 0xFE, 0x12, 0x7E, 0xEC, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
+
118  0xCC, 0x9E, 0x92, 0xF2, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
+
119  0x02, 0x02, 0xFE, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
+
120  0x7E, 0xFE, 0x80, 0x80, 0xFE, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
+
121  0x02, 0x1E, 0xF8, 0xC0, 0xF8, 0x1E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
+
122  0x0E, 0xFE, 0xE0, 0x3C, 0x06, 0x3C, 0xE0, 0xFE, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
+
123  0x82, 0xC6, 0x7C, 0x10, 0x7C, 0xC6, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
+
124  0x06, 0x0E, 0xF8, 0xF8, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
+
125  0xC2, 0xE2, 0xB2, 0x9A, 0x8E, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
+
126  0xFF, 0xFF, 0x81, 0x00, 0x00, 0x00, // 91
+
127  0x06, 0x38, 0xC0, 0x00, 0x00, 0x00, // 92
+
128  0x81, 0xFF, 0xFF, 0x00, 0x00, 0x00, // 93
+
129  0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
+
130  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
+
131  0x01, 0x02, 0x00, 0x00, // 96
+
132  0xE8, 0xE8, 0xA8, 0xF8, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, // 97
+
133  0xFF, 0xFF, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 98
+
134  0x70, 0xF8, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, // 99
+
135  0x70, 0xF8, 0x88, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, // 100
+
136  0x70, 0xF8, 0xA8, 0xB8, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x00, // 101
+
137  0x08, 0xFE, 0xFF, 0x09, 0x00, 0x00, 0x00, 0x00, // 102
+
138  0x70, 0xF8, 0x88, 0xF8, 0xF8, 0x00, 0x80, 0x80, 0xC0, 0x40, // 103
+
139  0xFF, 0xFF, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 104
+
140  0xFB, 0xFB, 0x00, 0x00, // 105
+
141  0x00, 0xFB, 0xFB, 0x80, 0xC0, 0x40, // 106
+
142  0xFF, 0xFF, 0x70, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 107
+
143  0xFF, 0xFF, 0x00, 0x00, // 108
+
144  0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
+
145  0xF8, 0xF8, 0x08, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 110
+
146  0x70, 0xF8, 0x88, 0xF8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 111
+
147  0xF8, 0xF8, 0x88, 0xF8, 0x70, 0xC0, 0xC0, 0x00, 0x00, 0x00, // 112
+
148  0x70, 0xF8, 0x88, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0xC0, 0xC0, // 113
+
149  0xF8, 0xF8, 0x08, 0x00, 0x00, 0x00, // 114
+
150  0xB0, 0xB8, 0xE8, 0x68, 0x00, 0x00, 0x00, 0x00, // 115
+
151  0xFC, 0xFC, 0x88, 0x00, 0x00, 0x00, // 116
+
152  0xF8, 0xF8, 0x80, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
+
153  0x18, 0x78, 0xC0, 0xC0, 0x78, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
+
154  0x18, 0xF8, 0xE0, 0x38, 0x38, 0xE0, 0xF8, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
+
155  0x88, 0xD8, 0x70, 0x70, 0xD8, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
+
156  0x08, 0x38, 0xE0, 0xE0, 0x38, 0x08, 0x00, 0x80, 0xC0, 0x00, 0x00, 0x00, // 121
+
157  0xC8, 0xE8, 0xB8, 0x98, 0x00, 0x00, 0x00, 0x00, // 122
+
158  0x08, 0xFF, 0xF7, 0x81, 0x00, 0x00, 0x00, 0x00, // 123
+
159  0xFE, 0xC0, // 124
+
160  0x81, 0xF7, 0xFF, 0x08, 0x00, 0x00, 0x00, 0x00, // 125
+
161  0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
+
162  0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
+
163 
+
164 };
+
165 
+
166 #endif
+
+ + diff --git a/DejaVuSansItalic9_8h_source.html b/DejaVuSansItalic9_8h_source.html index bfa42954..a68321d4 100644 --- a/DejaVuSansItalic9_8h_source.html +++ b/DejaVuSansItalic9_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: DejaVuSansItalic9.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
DejaVuSansItalic9.h
-
-
-
00001 
-00002 
-00003 /*
-00004  *
-00005  * DejaVuSansItalic9
-00006  *
-00007  * created with FontCreator
-00008  * written by F. Maximilian Thiele
-00009  *
-00010  * http://www.apetech.de/fontCreator
-00011  * me@apetech.de
-00012  *
-00013  * File Name           : DejaVuSansItalic9.h
-00014  * Date                : 28.05.2012
-00015  * Font size in bytes  : 4572
-00016  * Font width          : 10
-00017  * Font height         : 10
-00018  * Font first char     : 32
-00019  * Font last char      : 128
-00020  * Font used chars     : 96
-00021  *
-00022  * The font data are defined as
-00023  *
-00024  * struct _FONT_ {
-00025  *     uint16_t   font_Size_in_Bytes_over_all_included_Size_it_self;
-00026  *     uint8_t    font_Width_in_Pixel_for_fixed_drawing;
-00027  *     uint8_t    font_Height_in_Pixel_for_all_characters;
-00028  *     unit8_t    font_First_Char;
-00029  *     uint8_t    font_Char_Count;
-00030  *
-00031  *     uint8_t    font_Char_Widths[font_Last_Char - font_First_Char +1];
-00032  *                  // for each character the separate width in pixels,
-00033  *                  // characters < 128 have an implicit virtual right empty row
-00034  *
-00035  *     uint8_t    font_data[];
-00036  *                  // bit field of all characters
-00037  */
-00038 
-00039 #include <inttypes.h>
-00040 #include <avr/pgmspace.h>
-00041 
-00042 #ifndef DEJAVUSANSITALIC9_H
-00043 #define DEJAVUSANSITALIC9_H
-00044 
-00045 #define DEJAVUSANSITALIC9_WIDTH 10
-00046 #define DEJAVUSANSITALIC9_HEIGHT 10
-00047 
-00048 static uint8_t DejaVuSansItalic9[] PROGMEM = {
-00049     0x11, 0xDC, // size
-00050     0x0A, // width
-00051     0x0A, // height
-00052     0x20, // first char
-00053     0x60, // char count
-00054     
-00055     // char widths
-00056     0x00, 0x03, 0x03, 0x06, 0x04, 0x07, 0x06, 0x01, 0x03, 0x03, 
-00057     0x05, 0x05, 0x01, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x05, 
-00058     0x05, 0x05, 0x04, 0x05, 0x05, 0x05, 0x02, 0x02, 0x06, 0x06, 
-00059     0x06, 0x04, 0x08, 0x06, 0x05, 0x06, 0x06, 0x05, 0x05, 0x06, 
-00060     0x07, 0x03, 0x03, 0x06, 0x04, 0x08, 0x07, 0x06, 0x05, 0x06, 
-00061     0x05, 0x06, 0x05, 0x06, 0x05, 0x08, 0x06, 0x05, 0x06, 0x04, 
-00062     0x02, 0x04, 0x04, 0x05, 0x02, 0x05, 0x05, 0x04, 0x06, 0x05, 
-00063     0x03, 0x05, 0x05, 0x03, 0x03, 0x05, 0x03, 0x08, 0x05, 0x05, 
-00064     0x05, 0x05, 0x04, 0x04, 0x03, 0x05, 0x05, 0x07, 0x05, 0x05, 
-00065     0x05, 0x04, 0x01, 0x05, 0x06, 0x05, 
-00066     
-00067     // font data
-00068     0x80, 0x38, 0x06, 0x00, 0x00, 0x00, // 33
-00069     0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
-00070     0x20, 0xF8, 0x2E, 0xF8, 0x2E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
-00071     0x98, 0xDC, 0xA6, 0x64, 0x00, 0x40, 0x00, 0x00, // 36
-00072     0x1C, 0xD2, 0x2E, 0x10, 0xEC, 0x92, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
-00073     0x60, 0x9C, 0x92, 0xA2, 0x64, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
-00074     0x06, 0x00, // 39
-00075     0xF8, 0x06, 0x01, 0x00, 0x00, 0x00, // 40
-00076     0x80, 0x61, 0x1E, 0x00, 0x00, 0x00, // 41
-00077     0x12, 0x0C, 0x1E, 0x0C, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
-00078     0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
-00079     0x80, 0x00, // 44
-00080     0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 45
-00081     0x80, 0x00, // 46
-00082     0x60, 0x30, 0x0C, 0x00, 0x00, 0x00, // 47
-00083     0x78, 0x84, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, // 48
-00084     0x80, 0x82, 0xF2, 0x8E, 0x00, 0x00, 0x00, 0x00, // 49
-00085     0x80, 0xC4, 0xA2, 0x92, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 50
-00086     0x40, 0x84, 0x92, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 51
-00087     0x40, 0x70, 0xC8, 0x7C, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
-00088     0x80, 0x9C, 0x92, 0x92, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, // 53
-00089     0x78, 0x94, 0x92, 0x72, 0x00, 0x00, 0x00, 0x00, // 54
-00090     0x82, 0x42, 0x32, 0x0E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 55
-00091     0x60, 0xAC, 0x92, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 56
-00092     0x80, 0x9C, 0x92, 0x72, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, // 57
-00093     0x80, 0x08, 0x00, 0x00, // 58
-00094     0x80, 0x08, 0x00, 0x00, // 59
-00095     0x20, 0x20, 0x50, 0x50, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
-00096     0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
-00097     0x88, 0x50, 0x50, 0x50, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
-00098     0x82, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, // 63
-00099     0xE0, 0x18, 0xE8, 0x94, 0x94, 0xF4, 0xCC, 0x78, 0x40, 0xC0, 0x80, 0x80, 0x80, 0x40, 0x00, 0x00, // 64
-00100     0x80, 0x60, 0x38, 0x24, 0x3E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
-00101     0xC0, 0xB8, 0x96, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
-00102     0x78, 0x84, 0x82, 0x82, 0x82, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
-00103     0xC0, 0xB8, 0x86, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
-00104     0xC0, 0xB8, 0x96, 0x92, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 69
-00105     0xC0, 0x38, 0x16, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 70
-00106     0x78, 0x84, 0x82, 0x82, 0x92, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
-00107     0xC0, 0x38, 0x16, 0x10, 0xD0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
-00108     0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 73
-00109     0x00, 0xF0, 0x0E, 0xC0, 0x00, 0x00, // 74
-00110     0xC0, 0x38, 0x16, 0x68, 0x84, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
-00111     0xC0, 0xB8, 0x86, 0x80, 0x00, 0x00, 0x00, 0x00, // 76
-00112     0xC0, 0x38, 0x06, 0x38, 0x10, 0xC8, 0x3C, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
-00113     0xC0, 0x38, 0x06, 0x38, 0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
-00114     0x78, 0x84, 0x82, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
-00115     0xC0, 0x38, 0x16, 0x12, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, // 80
-00116     0x78, 0x84, 0x82, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // 81
-00117     0xC0, 0x38, 0x16, 0x72, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
-00118     0x40, 0x8C, 0x92, 0x92, 0x62, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
-00119     0x02, 0xC2, 0x3A, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
-00120     0x78, 0x86, 0x80, 0x80, 0x78, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
-00121     0x0E, 0xF0, 0x40, 0x30, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
-00122     0xFE, 0x60, 0x1C, 0x02, 0xFE, 0x60, 0x1C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
-00123     0x80, 0x42, 0x2C, 0x10, 0x6C, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
-00124     0x02, 0xCC, 0x30, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
-00125     0x80, 0xC2, 0xA2, 0x92, 0x8A, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
-00126     0xC0, 0xBC, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, // 91
-00127     0x1E, 0xE0, 0x00, 0x00, // 92
-00128     0x80, 0xC0, 0x3D, 0x03, 0x00, 0x00, 0x00, 0x00, // 93
-00129     0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
-00130     0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
-00131     0x01, 0x02, 0x00, 0x00, // 96
-00132     0xC0, 0xA8, 0xA8, 0xE8, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 97
-00133     0xC0, 0x7C, 0x93, 0x88, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 98
-00134     0xF0, 0x98, 0x88, 0x08, 0x00, 0x00, 0x00, 0x00, // 99
-00135     0xF0, 0x98, 0x88, 0xC8, 0x3C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 100
-00136     0x70, 0xB8, 0xA8, 0xA8, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // 101
-00137     0xC8, 0x3E, 0x09, 0x00, 0x00, 0x00, // 102
-00138     0xF0, 0x98, 0x88, 0xC8, 0x38, 0x80, 0x80, 0x80, 0x40, 0x00, // 103
-00139     0xC0, 0x3C, 0x13, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 104
-00140     0xE0, 0x38, 0x01, 0x00, 0x00, 0x00, // 105
-00141     0xC0, 0x38, 0x01, 0xC0, 0x00, 0x00, // 106
-00142     0xC0, 0x3C, 0x23, 0xD0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 107
-00143     0xC0, 0x3C, 0x03, 0x00, 0x00, 0x00, // 108
-00144     0xE0, 0x18, 0x08, 0xC8, 0x78, 0x10, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
-00145     0xE0, 0x38, 0x08, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 110
-00146     0x70, 0x98, 0x88, 0xC8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 111
-00147     0xE0, 0x98, 0x88, 0xC8, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 112
-00148     0xF0, 0x88, 0x88, 0xF0, 0x18, 0x00, 0x00, 0xC0, 0x00, 0x00, // 113
-00149     0xE0, 0x38, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, // 114
-00150     0x80, 0xB8, 0xA8, 0xE8, 0x00, 0x00, 0x00, 0x00, // 115
-00151     0xF8, 0x8C, 0x08, 0x00, 0x00, 0x00, // 116
-00152     0xE0, 0x98, 0x80, 0xE0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
-00153     0x38, 0xC0, 0x60, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
-00154     0xF8, 0x60, 0x10, 0xF8, 0x40, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
-00155     0x80, 0x48, 0x30, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
-00156     0x00, 0xF8, 0x60, 0x10, 0x08, 0x80, 0x40, 0x00, 0x00, 0x00, // 121
-00157     0x80, 0xC8, 0xA8, 0x98, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 122
-00158     0x08, 0xF8, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, // 123
-00159     0xFE, 0xC0, // 124
-00160     0x80, 0x80, 0x71, 0x0F, 0x08, 0x00, 0x00, 0x40, 0x00, 0x00, // 125
-00161     0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
-00162     0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
-00163     
-00164 };
-00165 
-00166 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -242,8 +77,188 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
DejaVuSansItalic9.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * DejaVuSansItalic9
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : DejaVuSansItalic9.h
+
14  * Date : 28.05.2012
+
15  * Font size in bytes : 4572
+
16  * Font width : 10
+
17  * Font height : 10
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef DEJAVUSANSITALIC9_H
+
43 #define DEJAVUSANSITALIC9_H
+
44 
+
45 #define DEJAVUSANSITALIC9_WIDTH 10
+
46 #define DEJAVUSANSITALIC9_HEIGHT 10
+
47 
+
48 static uint8_t const DejaVuSansItalic9[] PROGMEM = {
+
49  0x11, 0xDC, // size
+
50  0x0A, // width
+
51  0x0A, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // char widths
+
56  0x00, 0x03, 0x03, 0x06, 0x04, 0x07, 0x06, 0x01, 0x03, 0x03,
+
57  0x05, 0x05, 0x01, 0x03, 0x01, 0x03, 0x05, 0x04, 0x05, 0x05,
+
58  0x05, 0x05, 0x04, 0x05, 0x05, 0x05, 0x02, 0x02, 0x06, 0x06,
+
59  0x06, 0x04, 0x08, 0x06, 0x05, 0x06, 0x06, 0x05, 0x05, 0x06,
+
60  0x07, 0x03, 0x03, 0x06, 0x04, 0x08, 0x07, 0x06, 0x05, 0x06,
+
61  0x05, 0x06, 0x05, 0x06, 0x05, 0x08, 0x06, 0x05, 0x06, 0x04,
+
62  0x02, 0x04, 0x04, 0x05, 0x02, 0x05, 0x05, 0x04, 0x06, 0x05,
+
63  0x03, 0x05, 0x05, 0x03, 0x03, 0x05, 0x03, 0x08, 0x05, 0x05,
+
64  0x05, 0x05, 0x04, 0x04, 0x03, 0x05, 0x05, 0x07, 0x05, 0x05,
+
65  0x05, 0x04, 0x01, 0x05, 0x06, 0x05,
+
66 
+
67  // font data
+
68  0x80, 0x38, 0x06, 0x00, 0x00, 0x00, // 33
+
69  0x06, 0x00, 0x06, 0x00, 0x00, 0x00, // 34
+
70  0x20, 0xF8, 0x2E, 0xF8, 0x2E, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 35
+
71  0x98, 0xDC, 0xA6, 0x64, 0x00, 0x40, 0x00, 0x00, // 36
+
72  0x1C, 0xD2, 0x2E, 0x10, 0xEC, 0x92, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 37
+
73  0x60, 0x9C, 0x92, 0xA2, 0x64, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 38
+
74  0x06, 0x00, // 39
+
75  0xF8, 0x06, 0x01, 0x00, 0x00, 0x00, // 40
+
76  0x80, 0x61, 0x1E, 0x00, 0x00, 0x00, // 41
+
77  0x12, 0x0C, 0x1E, 0x0C, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, // 42
+
78  0x20, 0x20, 0xF8, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, // 43
+
79  0x80, 0x00, // 44
+
80  0x20, 0x20, 0x20, 0x00, 0x00, 0x00, // 45
+
81  0x80, 0x00, // 46
+
82  0x60, 0x30, 0x0C, 0x00, 0x00, 0x00, // 47
+
83  0x78, 0x84, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, // 48
+
84  0x80, 0x82, 0xF2, 0x8E, 0x00, 0x00, 0x00, 0x00, // 49
+
85  0x80, 0xC4, 0xA2, 0x92, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 50
+
86  0x40, 0x84, 0x92, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 51
+
87  0x40, 0x70, 0xC8, 0x7C, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, // 52
+
88  0x80, 0x9C, 0x92, 0x92, 0x72, 0x00, 0x00, 0x00, 0x00, 0x00, // 53
+
89  0x78, 0x94, 0x92, 0x72, 0x00, 0x00, 0x00, 0x00, // 54
+
90  0x82, 0x42, 0x32, 0x0E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 55
+
91  0x60, 0xAC, 0x92, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 56
+
92  0x80, 0x9C, 0x92, 0x72, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, // 57
+
93  0x80, 0x08, 0x00, 0x00, // 58
+
94  0x80, 0x08, 0x00, 0x00, // 59
+
95  0x20, 0x20, 0x50, 0x50, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 60
+
96  0x50, 0x50, 0x50, 0x50, 0x50, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 61
+
97  0x88, 0x50, 0x50, 0x50, 0x20, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 62
+
98  0x82, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, // 63
+
99  0xE0, 0x18, 0xE8, 0x94, 0x94, 0xF4, 0xCC, 0x78, 0x40, 0xC0, 0x80, 0x80, 0x80, 0x40, 0x00, 0x00, // 64
+
100  0x80, 0x60, 0x38, 0x24, 0x3E, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 65
+
101  0xC0, 0xB8, 0x96, 0x92, 0x6E, 0x00, 0x00, 0x00, 0x00, 0x00, // 66
+
102  0x78, 0x84, 0x82, 0x82, 0x82, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 67
+
103  0xC0, 0xB8, 0x86, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 68
+
104  0xC0, 0xB8, 0x96, 0x92, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 69
+
105  0xC0, 0x38, 0x16, 0x12, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 70
+
106  0x78, 0x84, 0x82, 0x82, 0x92, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 71
+
107  0xC0, 0x38, 0x16, 0x10, 0xD0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 72
+
108  0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, // 73
+
109  0x00, 0xF0, 0x0E, 0xC0, 0x00, 0x00, // 74
+
110  0xC0, 0x38, 0x16, 0x68, 0x84, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 75
+
111  0xC0, 0xB8, 0x86, 0x80, 0x00, 0x00, 0x00, 0x00, // 76
+
112  0xC0, 0x38, 0x06, 0x38, 0x10, 0xC8, 0x3C, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 77
+
113  0xC0, 0x38, 0x06, 0x38, 0xC0, 0x38, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 78
+
114  0x78, 0x84, 0x82, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 79
+
115  0xC0, 0x38, 0x16, 0x12, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, // 80
+
116  0x78, 0x84, 0x82, 0x82, 0x42, 0x3C, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, // 81
+
117  0xC0, 0x38, 0x16, 0x72, 0x8E, 0x00, 0x00, 0x00, 0x00, 0x00, // 82
+
118  0x40, 0x8C, 0x92, 0x92, 0x62, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 83
+
119  0x02, 0xC2, 0x3A, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 84
+
120  0x78, 0x86, 0x80, 0x80, 0x78, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 85
+
121  0x0E, 0xF0, 0x40, 0x30, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, // 86
+
122  0xFE, 0x60, 0x1C, 0x02, 0xFE, 0x60, 0x1C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 87
+
123  0x80, 0x42, 0x2C, 0x10, 0x6C, 0x82, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 88
+
124  0x02, 0xCC, 0x30, 0x0C, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, // 89
+
125  0x80, 0xC2, 0xA2, 0x92, 0x8A, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 90
+
126  0xC0, 0xBC, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, // 91
+
127  0x1E, 0xE0, 0x00, 0x00, // 92
+
128  0x80, 0xC0, 0x3D, 0x03, 0x00, 0x00, 0x00, 0x00, // 93
+
129  0x04, 0x02, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, // 94
+
130  0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, // 95
+
131  0x01, 0x02, 0x00, 0x00, // 96
+
132  0xC0, 0xA8, 0xA8, 0xE8, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 97
+
133  0xC0, 0x7C, 0x93, 0x88, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 98
+
134  0xF0, 0x98, 0x88, 0x08, 0x00, 0x00, 0x00, 0x00, // 99
+
135  0xF0, 0x98, 0x88, 0xC8, 0x3C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 100
+
136  0x70, 0xB8, 0xA8, 0xA8, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, // 101
+
137  0xC8, 0x3E, 0x09, 0x00, 0x00, 0x00, // 102
+
138  0xF0, 0x98, 0x88, 0xC8, 0x38, 0x80, 0x80, 0x80, 0x40, 0x00, // 103
+
139  0xC0, 0x3C, 0x13, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 104
+
140  0xE0, 0x38, 0x01, 0x00, 0x00, 0x00, // 105
+
141  0xC0, 0x38, 0x01, 0xC0, 0x00, 0x00, // 106
+
142  0xC0, 0x3C, 0x23, 0xD0, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 107
+
143  0xC0, 0x3C, 0x03, 0x00, 0x00, 0x00, // 108
+
144  0xE0, 0x18, 0x08, 0xC8, 0x78, 0x10, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 109
+
145  0xE0, 0x38, 0x08, 0xC8, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 110
+
146  0x70, 0x98, 0x88, 0xC8, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, // 111
+
147  0xE0, 0x98, 0x88, 0xC8, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, // 112
+
148  0xF0, 0x88, 0x88, 0xF0, 0x18, 0x00, 0x00, 0xC0, 0x00, 0x00, // 113
+
149  0xE0, 0x38, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, // 114
+
150  0x80, 0xB8, 0xA8, 0xE8, 0x00, 0x00, 0x00, 0x00, // 115
+
151  0xF8, 0x8C, 0x08, 0x00, 0x00, 0x00, // 116
+
152  0xE0, 0x98, 0x80, 0xE0, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, // 117
+
153  0x38, 0xC0, 0x60, 0x10, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 118
+
154  0xF8, 0x60, 0x10, 0xF8, 0x40, 0x30, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 119
+
155  0x80, 0x48, 0x30, 0x50, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, // 120
+
156  0x00, 0xF8, 0x60, 0x10, 0x08, 0x80, 0x40, 0x00, 0x00, 0x00, // 121
+
157  0x80, 0xC8, 0xA8, 0x98, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, // 122
+
158  0x08, 0xF8, 0x87, 0x01, 0x00, 0x00, 0x00, 0x00, // 123
+
159  0xFE, 0xC0, // 124
+
160  0x80, 0x80, 0x71, 0x0F, 0x08, 0x00, 0x00, 0x40, 0x00, 0x00, // 125
+
161  0x20, 0x10, 0x10, 0x20, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // 126
+
162  0xFC, 0x04, 0x04, 0x04, 0xFC, 0xC0, 0x80, 0x80, 0x80, 0xC0 // 127
+
163 
+
164 };
+
165 
+
166 #endif
+
+ + diff --git a/EEPROM24_8cpp_source.html b/EEPROM24_8cpp_source.html index fc9ae73f..ffece55d 100644 --- a/EEPROM24_8cpp_source.html +++ b/EEPROM24_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: EEPROM24.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
EEPROM24.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "EEPROM24.h"
-00024 #include "I2CMaster.h"
-00025 
-00095 EEPROM24::EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank)
-00096     : _bus(&bus)
-00097     , _size((type & 0xFFFF) * ((type >> 16) & 0x0FFF))
-00098     , _pageSize((type >> 16) & 0x0FFF)
-00099     , _mode((uint8_t)((type >> 28) & 0x0F))
-00100     , i2cAddress(0x50)
-00101 {
-00102     // Adjust the I2C address for the memory bank of the chip.
-00103     switch (_mode) {
-00104     case EE_BSEL_NONE:
-00105         i2cAddress += (bank & 0x07);
-00106         break;
-00107     case EE_BSEL_8BIT_ADDR: {
-00108         uint8_t addrBits = 8;
-00109         unsigned long size = 0x0100;
-00110         while (size < _size) {
-00111             ++addrBits;
-00112             size <<= 1;
-00113         }
-00114         if (addrBits < 11)
-00115             i2cAddress += ((bank << (addrBits - 8)) & 0x07);
-00116         break; }
-00117     case EE_BSEL_17BIT_ADDR:
-00118         i2cAddress += ((bank << 1) & 0x06);
-00119         break;
-00120     case EE_BSEL_17BIT_ADDR_ALT:
-00121         i2cAddress += bank & 0x03;
-00122         break;
-00123     }
-00124 }
-00125 
-00152 bool EEPROM24::available()
-00153 {
-00154     // Perform a "Current Address Read" on the EEPROM.  We don't care about
-00155     // the returned byte.  We only care if the read request was ACK'ed or not.
-00156     if (!_bus->startRead(i2cAddress, 1))
-00157         return false;
-00158     _bus->read();
-00159     return true;
-00160 }
-00161 
-00167 uint8_t EEPROM24::read(unsigned long address)
-00168 {
-00169     if (address >= _size)
-00170         return 0;
-00171     writeAddress(address);
-00172     if (!_bus->startRead(i2cAddress, 1))
-00173         return 0;
-00174     return _bus->read();
-00175 }
-00176 
-00187 size_t EEPROM24::read(unsigned long address, void *data, size_t length)
-00188 {
-00189     if (address >= _size || !length)
-00190         return 0;
-00191     if ((address + length) > _size)
-00192         length = (size_t)(_size - address);
-00193     writeAddress(address);
-00194     if (!_bus->startRead(i2cAddress, length))
-00195         return 0;
-00196     uint8_t *d = (uint8_t *)data;
-00197     unsigned int count = 0;
-00198     while (_bus->available()) {
-00199         *d++ = _bus->read();
-00200         ++count;
-00201     }
-00202     return count;
-00203 }
-00204 
-00213 bool EEPROM24::write(unsigned long address, uint8_t value)
-00214 {
-00215     if (address >= _size)
-00216         return false;
-00217     writeAddress(address);
-00218     _bus->write(value);
-00219     return waitForWrite();
-00220 }
-00221 
-00235 size_t EEPROM24::write(unsigned long address, const void *data, size_t length)
-00236 {
-00237     if (address >= _size)
-00238         return 0;
-00239     if ((address + length) > _size)
-00240         length = (size_t)(_size - address);
-00241     bool needAddress = true;
-00242     size_t result = 0;
-00243     size_t page = 0;
-00244     const uint8_t *d = (const uint8_t *)data;
-00245     while (length > 0) {
-00246         if (needAddress) {
-00247             writeAddress(address);
-00248             needAddress = false;
-00249         }
-00250         _bus->write(*d++);
-00251         ++address;
-00252         ++page;
-00253         if ((address & (_pageSize - 1)) == 0) {
-00254             // At the end of a page, so perform a flush.
-00255             if (!waitForWrite())
-00256                 return result;  // Could not write this page.
-00257             needAddress = true;
-00258             result += page;
-00259             page = 0;
-00260         }
-00261         --length;
-00262     }
-00263     if (!needAddress) {
-00264         if (!waitForWrite())
-00265             return result;  // Could not write the final page.
-00266     }
-00267     return result + page;
-00268 }
-00269 
-00270 void EEPROM24::writeAddress(unsigned long address)
-00271 {
-00272     switch (_mode) {
-00273     case EE_BSEL_NONE:
-00274         _bus->startWrite(i2cAddress);
-00275         _bus->write((uint8_t)(address >> 8));
-00276         _bus->write((uint8_t)address);
-00277         break;
-00278     case EE_BSEL_8BIT_ADDR:
-00279         _bus->startWrite(i2cAddress | (((uint8_t)(address >> 8)) & 0x07));
-00280         _bus->write((uint8_t)address);
-00281         break;
-00282     case EE_BSEL_17BIT_ADDR:
-00283         _bus->startWrite(i2cAddress | (((uint8_t)(address >> 16)) & 0x01));
-00284         _bus->write((uint8_t)(address >> 8));
-00285         _bus->write((uint8_t)address);
-00286         break;
-00287     case EE_BSEL_17BIT_ADDR_ALT:
-00288         _bus->startWrite(i2cAddress | (((uint8_t)(address >> 14)) & 0x04));
-00289         _bus->write((uint8_t)(address >> 8));
-00290         _bus->write((uint8_t)address);
-00291         break;
-00292     }
-00293 }
-00294 
-00295 bool EEPROM24::waitForWrite()
-00296 {
-00297     // 1000 iterations is going to be approximately 100ms when the I2C
-00298     // clock is 100 kHz.  If there has been no response in that time
-00299     // then we assume that the write has failed and timeout.
-00300     if (!_bus->endWrite())
-00301         return false;
-00302     unsigned count = 1000;
-00303     while (count > 0) {
-00304         _bus->startWrite(i2cAddress);
-00305         if (_bus->endWrite())
-00306             return true;
-00307         --count;
-00308     }
-00309     return false;
-00310 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -255,8 +77,201 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
EEPROM24.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "EEPROM24.h"
+
24 #include "I2CMaster.h"
+
25 
+
95 EEPROM24::EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank)
+
96  : _bus(&bus)
+
97  , _size((type & 0xFFFF) * ((type >> 16) & 0x0FFF))
+
98  , _pageSize((type >> 16) & 0x0FFF)
+
99  , _mode((uint8_t)((type >> 28) & 0x0F))
+
100  , i2cAddress(0x50)
+
101 {
+
102  // Adjust the I2C address for the memory bank of the chip.
+
103  switch (_mode) {
+
104  case EE_BSEL_NONE:
+
105  i2cAddress += (bank & 0x07);
+
106  break;
+
107  case EE_BSEL_8BIT_ADDR: {
+
108  uint8_t addrBits = 8;
+
109  unsigned long size = 0x0100;
+
110  while (size < _size) {
+
111  ++addrBits;
+
112  size <<= 1;
+
113  }
+
114  if (addrBits < 11)
+
115  i2cAddress += ((bank << (addrBits - 8)) & 0x07);
+
116  break; }
+
117  case EE_BSEL_17BIT_ADDR:
+
118  i2cAddress += ((bank << 1) & 0x06);
+
119  break;
+
120  case EE_BSEL_17BIT_ADDR_ALT:
+
121  i2cAddress += bank & 0x03;
+
122  break;
+
123  }
+
124 }
+
125 
+ +
153 {
+
154  // Perform a "Current Address Read" on the EEPROM. We don't care about
+
155  // the returned byte. We only care if the read request was ACK'ed or not.
+
156  if (!_bus->startRead(i2cAddress, 1))
+
157  return false;
+
158  _bus->read();
+
159  return true;
+
160 }
+
161 
+
167 uint8_t EEPROM24::read(unsigned long address)
+
168 {
+
169  if (address >= _size)
+
170  return 0;
+
171  writeAddress(address);
+
172  if (!_bus->startRead(i2cAddress, 1))
+
173  return 0;
+
174  return _bus->read();
+
175 }
+
176 
+
187 size_t EEPROM24::read(unsigned long address, void *data, size_t length)
+
188 {
+
189  if (address >= _size || !length)
+
190  return 0;
+
191  if ((address + length) > _size)
+
192  length = (size_t)(_size - address);
+
193  writeAddress(address);
+
194  if (!_bus->startRead(i2cAddress, length))
+
195  return 0;
+
196  uint8_t *d = (uint8_t *)data;
+
197  unsigned int count = 0;
+
198  while (_bus->available()) {
+
199  *d++ = _bus->read();
+
200  ++count;
+
201  }
+
202  return count;
+
203 }
+
204 
+
213 bool EEPROM24::write(unsigned long address, uint8_t value)
+
214 {
+
215  if (address >= _size)
+
216  return false;
+
217  writeAddress(address);
+
218  _bus->write(value);
+
219  return waitForWrite();
+
220 }
+
221 
+
235 size_t EEPROM24::write(unsigned long address, const void *data, size_t length)
+
236 {
+
237  if (address >= _size)
+
238  return 0;
+
239  if ((address + length) > _size)
+
240  length = (size_t)(_size - address);
+
241  bool needAddress = true;
+
242  size_t result = 0;
+
243  size_t page = 0;
+
244  const uint8_t *d = (const uint8_t *)data;
+
245  while (length > 0) {
+
246  if (needAddress) {
+
247  writeAddress(address);
+
248  needAddress = false;
+
249  }
+
250  _bus->write(*d++);
+
251  ++address;
+
252  ++page;
+
253  if ((address & (_pageSize - 1)) == 0) {
+
254  // At the end of a page, so perform a flush.
+
255  if (!waitForWrite())
+
256  return result; // Could not write this page.
+
257  needAddress = true;
+
258  result += page;
+
259  page = 0;
+
260  }
+
261  --length;
+
262  }
+
263  if (!needAddress) {
+
264  if (!waitForWrite())
+
265  return result; // Could not write the final page.
+
266  }
+
267  return result + page;
+
268 }
+
269 
+
270 void EEPROM24::writeAddress(unsigned long address)
+
271 {
+
272  switch (_mode) {
+
273  case EE_BSEL_NONE:
+
274  _bus->startWrite(i2cAddress);
+
275  _bus->write((uint8_t)(address >> 8));
+
276  _bus->write((uint8_t)address);
+
277  break;
+
278  case EE_BSEL_8BIT_ADDR:
+
279  _bus->startWrite(i2cAddress | (((uint8_t)(address >> 8)) & 0x07));
+
280  _bus->write((uint8_t)address);
+
281  break;
+
282  case EE_BSEL_17BIT_ADDR:
+
283  _bus->startWrite(i2cAddress | (((uint8_t)(address >> 16)) & 0x01));
+
284  _bus->write((uint8_t)(address >> 8));
+
285  _bus->write((uint8_t)address);
+
286  break;
+
287  case EE_BSEL_17BIT_ADDR_ALT:
+
288  _bus->startWrite(i2cAddress | (((uint8_t)(address >> 14)) & 0x04));
+
289  _bus->write((uint8_t)(address >> 8));
+
290  _bus->write((uint8_t)address);
+
291  break;
+
292  }
+
293 }
+
294 
+
295 bool EEPROM24::waitForWrite()
+
296 {
+
297  // 1000 iterations is going to be approximately 100ms when the I2C
+
298  // clock is 100 kHz. If there has been no response in that time
+
299  // then we assume that the write has failed and timeout.
+
300  if (!_bus->endWrite())
+
301  return false;
+
302  unsigned count = 1000;
+
303  while (count > 0) {
+
304  _bus->startWrite(i2cAddress);
+
305  if (_bus->endWrite())
+
306  return true;
+
307  --count;
+
308  }
+
309  return false;
+
310 }
+
+ + diff --git a/EEPROM24_8h_source.html b/EEPROM24_8h_source.html index cfd7ca97..eb43a109 100644 --- a/EEPROM24_8h_source.html +++ b/EEPROM24_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: EEPROM24.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
EEPROM24.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef EEPROM24_h
-00024 #define EEPROM24_h
-00025 
-00026 #include <inttypes.h>
-00027 #include <stddef.h>
-00028 
-00029 class I2CMaster;
-00030 
-00031 // Block select modes.
-00032 #define EE_BSEL_NONE            0
-00033 #define EE_BSEL_8BIT_ADDR       1
-00034 #define EE_BSEL_17BIT_ADDR      2
-00035 #define EE_BSEL_17BIT_ADDR_ALT  3
-00036 
-00037 // Create an EEPROM descriptor from byte size, page size, and block select mode.
-00038 #define _EE24(byteSize, pageSize, mode) \
-00039     (((byteSize) / (pageSize)) | (((unsigned long)(pageSize)) << 16) | \
-00040      (((unsigned long)(mode)) << 28))
-00041 
-00042 // Type descriptors for the 24LCXX range of EEPROM's.
-00043 #define EEPROM_24LC00   _EE24(16UL, 1, EE_BSEL_8BIT_ADDR)
-00044 #define EEPROM_24LC01   _EE24(128UL, 8, EE_BSEL_8BIT_ADDR)
-00045 #define EEPROM_24LC014  _EE24(128UL, 16, EE_BSEL_8BIT_ADDR)
-00046 #define EEPROM_24LC02   _EE24(256UL, 8, EE_BSEL_8BIT_ADDR)
-00047 #define EEPROM_24LC024  _EE24(256UL, 16, EE_BSEL_8BIT_ADDR)
-00048 #define EEPROM_24LC025  _EE24(256UL, 16, EE_BSEL_8BIT_ADDR)
-00049 #define EEPROM_24LC04   _EE24(512UL, 16, EE_BSEL_8BIT_ADDR)
-00050 #define EEPROM_24LC08   _EE24(1024UL, 16, EE_BSEL_8BIT_ADDR)
-00051 #define EEPROM_24LC16   _EE24(2048UL, 16, EE_BSEL_8BIT_ADDR)
-00052 #define EEPROM_24LC32   _EE24(4096UL, 32, EE_BSEL_NONE)
-00053 #define EEPROM_24LC64   _EE24(8192UL, 32, EE_BSEL_NONE)
-00054 #define EEPROM_24LC128  _EE24(16384UL, 32, EE_BSEL_NONE)
-00055 #define EEPROM_24LC256  _EE24(32768UL, 64, EE_BSEL_NONE)
-00056 #define EEPROM_24LC512  _EE24(65536UL, 128, EE_BSEL_NONE)
-00057 #define EEPROM_24LC1025 _EE24(131072UL, 128, EE_BSEL_17BIT_ADDR_ALT)
-00058 #define EEPROM_24LC1026 _EE24(131072UL, 128, EE_BSEL_17BIT_ADDR)
-00059 
-00060 class EEPROM24
-00061 {
-00062 public:
-00063     EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank = 0);
-00064 
-00065     unsigned long size() const { return _size; }
-00066     unsigned long pageSize() const { return _pageSize; }
-00067 
-00068     bool available();
-00069 
-00070     uint8_t read(unsigned long address);
-00071     size_t read(unsigned long address, void *data, size_t length);
-00072 
-00073     bool write(unsigned long address, uint8_t value);
-00074     size_t write(unsigned long address, const void *data, size_t length);
-00075 
-00076 private:
-00077     I2CMaster *_bus;
-00078     unsigned long _size;
-00079     unsigned long _pageSize;
-00080     uint8_t _mode;
-00081     uint8_t i2cAddress;
-00082 
-00083     void writeAddress(unsigned long address);
-00084     bool waitForWrite();
-00085 };
-00086 
-00087 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -163,8 +77,109 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
EEPROM24.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef EEPROM24_h
+
24 #define EEPROM24_h
+
25 
+
26 #include <inttypes.h>
+
27 #include <stddef.h>
+
28 
+
29 class I2CMaster;
+
30 
+
31 // Block select modes.
+
32 #define EE_BSEL_NONE 0
+
33 #define EE_BSEL_8BIT_ADDR 1
+
34 #define EE_BSEL_17BIT_ADDR 2
+
35 #define EE_BSEL_17BIT_ADDR_ALT 3
+
36 
+
37 // Create an EEPROM descriptor from byte size, page size, and block select mode.
+
38 #define _EE24(byteSize, pageSize, mode) \
+
39  (((byteSize) / (pageSize)) | (((unsigned long)(pageSize)) << 16) | \
+
40  (((unsigned long)(mode)) << 28))
+
41 
+
42 // Type descriptors for the 24LCXX range of EEPROM's.
+
43 #define EEPROM_24LC00 _EE24(16UL, 1, EE_BSEL_8BIT_ADDR)
+
44 #define EEPROM_24LC01 _EE24(128UL, 8, EE_BSEL_8BIT_ADDR)
+
45 #define EEPROM_24LC014 _EE24(128UL, 16, EE_BSEL_8BIT_ADDR)
+
46 #define EEPROM_24LC02 _EE24(256UL, 8, EE_BSEL_8BIT_ADDR)
+
47 #define EEPROM_24LC024 _EE24(256UL, 16, EE_BSEL_8BIT_ADDR)
+
48 #define EEPROM_24LC025 _EE24(256UL, 16, EE_BSEL_8BIT_ADDR)
+
49 #define EEPROM_24LC04 _EE24(512UL, 16, EE_BSEL_8BIT_ADDR)
+
50 #define EEPROM_24LC08 _EE24(1024UL, 16, EE_BSEL_8BIT_ADDR)
+
51 #define EEPROM_24LC16 _EE24(2048UL, 16, EE_BSEL_8BIT_ADDR)
+
52 #define EEPROM_24LC32 _EE24(4096UL, 32, EE_BSEL_NONE)
+
53 #define EEPROM_24LC64 _EE24(8192UL, 32, EE_BSEL_NONE)
+
54 #define EEPROM_24LC128 _EE24(16384UL, 32, EE_BSEL_NONE)
+
55 #define EEPROM_24LC256 _EE24(32768UL, 64, EE_BSEL_NONE)
+
56 #define EEPROM_24LC512 _EE24(65536UL, 128, EE_BSEL_NONE)
+
57 #define EEPROM_24LC1025 _EE24(131072UL, 128, EE_BSEL_17BIT_ADDR_ALT)
+
58 #define EEPROM_24LC1026 _EE24(131072UL, 128, EE_BSEL_17BIT_ADDR)
+
59 
+
60 class EEPROM24
+
61 {
+
62 public:
+
63  EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank = 0);
+
64 
+
65  unsigned long size() const { return _size; }
+
66  unsigned long pageSize() const { return _pageSize; }
+
67 
+
68  bool available();
+
69 
+
70  uint8_t read(unsigned long address);
+
71  size_t read(unsigned long address, void *data, size_t length);
+
72 
+
73  bool write(unsigned long address, uint8_t value);
+
74  size_t write(unsigned long address, const void *data, size_t length);
+
75 
+
76 private:
+
77  I2CMaster *_bus;
+
78  unsigned long _size;
+
79  unsigned long _pageSize;
+
80  uint8_t _mode;
+
81  uint8_t i2cAddress;
+
82 
+
83  void writeAddress(unsigned long address);
+
84  bool waitForWrite();
+
85 };
+
86 
+
87 #endif
+
+ + diff --git a/Field_8cpp_source.html b/Field_8cpp_source.html index 16372f79..26a53c1d 100644 --- a/Field_8cpp_source.html +++ b/Field_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Field.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Field.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "Field.h"
-00024 
-00040 Field::Field(const String &label)
-00041     : _label(label)
-00042     , _form(0)
-00043     , next(0)
-00044     , prev(0)
-00045 {
-00046 }
-00047 
-00052 Field::Field(Form &form, const String &label)
-00053     : _label(label)
-00054     , _form(0)
-00055     , next(0)
-00056     , prev(0)
-00057 {
-00058     form.addField(this);
-00059 }
-00060 
-00066 Field::~Field()
-00067 {
-00068     if (_form)
-00069         _form->removeField(this);
-00070 }
-00071 
-00096 int Field::dispatch(int event)
-00097 {
-00098     // Nothing to do here.
-00099     return -1;
-00100 }
-00101 
-00116 void Field::enterField(bool reverse)
-00117 {
-00118     lcd()->print(_label);
-00119 }
-00120 
-00129 void Field::exitField()
-00130 {
-00131     // Nothing to do here.
-00132 }
-00133 
-00146 void Field::setLabel(const String &label)
-00147 {
-00148     if (isCurrent()) {
-00149         unsigned int prevLen = _label.length();
-00150         unsigned int newLen = label.length();
-00151         _label = label;
-00152         lcd()->setCursor(0, 0);
-00153         lcd()->print(label);
-00154         while (newLen++ < prevLen)
-00155             lcd()->write(' ');
-00156         updateCursor();
-00157     } else {
-00158         _label = label;
-00159     }
-00160 }
-00161 
-00169 bool Field::isCurrent() const
-00170 {
-00171     if (!_form->isVisible())
-00172         return false;
-00173     return _form->currentField() == this;
-00174 }
-00175 
-00191 void Field::updateCursor()
-00192 {
-00193     // Nothing to do here.
-00194 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -166,8 +77,112 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Field.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Field.h"
+
24 
+
40 Field::Field(const String &label)
+
41  : _label(label)
+
42  , _form(0)
+
43  , next(0)
+
44  , prev(0)
+
45 {
+
46 }
+
47 
+
52 Field::Field(Form &form, const String &label)
+
53  : _label(label)
+
54  , _form(0)
+
55  , next(0)
+
56  , prev(0)
+
57 {
+
58  form.addField(this);
+
59 }
+
60 
+ +
67 {
+
68  if (_form)
+
69  _form->removeField(this);
+
70 }
+
71 
+
96 int Field::dispatch(int event)
+
97 {
+
98  // Nothing to do here.
+
99  return -1;
+
100 }
+
101 
+
116 void Field::enterField(bool reverse)
+
117 {
+
118  lcd()->print(_label);
+
119 }
+
120 
+ +
130 {
+
131  // Nothing to do here.
+
132 }
+
133 
+
146 void Field::setLabel(const String &label)
+
147 {
+
148  if (isCurrent()) {
+
149  unsigned int prevLen = _label.length();
+
150  unsigned int newLen = label.length();
+
151  _label = label;
+
152  lcd()->setCursor(0, 0);
+
153  lcd()->print(label);
+
154  while (newLen++ < prevLen)
+
155  lcd()->write(' ');
+
156  updateCursor();
+
157  } else {
+
158  _label = label;
+
159  }
+
160 }
+
161 
+
169 bool Field::isCurrent() const
+
170 {
+
171  if (!_form->isVisible())
+
172  return false;
+
173  return _form->currentField() == this;
+
174 }
+
175 
+ +
192 {
+
193  // Nothing to do here.
+
194 }
+
+ + diff --git a/Field_8h_source.html b/Field_8h_source.html index 45c2de0c..6207e134 100644 --- a/Field_8h_source.html +++ b/Field_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Field.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Field.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef Field_h
-00024 #define Field_h
-00025 
-00026 #include "Form.h"
-00027 
-00028 class Field {
-00029 public:
-00030     explicit Field(const String &label);
-00031     Field(Form &form, const String &label);
-00032     ~Field();
-00033 
-00034     Form *form() const { return _form; }
-00035 
-00036     virtual int dispatch(int event);
-00037 
-00038     virtual void enterField(bool reverse);
-00039     virtual void exitField();
-00040 
-00041     const String &label() const { return _label; }
-00042     void setLabel(const String &label);
-00043 
-00044     bool isCurrent() const;
-00045 
-00046 protected:
-00047     LiquidCrystal *lcd() const { return _form->_lcd; }
-00048 
-00049     virtual void updateCursor();
-00050 
-00051 private:
-00052     String _label;
-00053     Form *_form;
-00054     Field *next;
-00055     Field *prev;
-00056 
-00057     friend class Form;
-00058 };
-00059 
-00060 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -136,8 +77,82 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Field.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Field_h
+
24 #define Field_h
+
25 
+
26 #include "Form.h"
+
27 
+
28 class Field {
+
29 public:
+
30  explicit Field(const String &label);
+
31  Field(Form &form, const String &label);
+
32  ~Field();
+
33 
+
34  Form *form() const { return _form; }
+
35 
+
36  virtual int dispatch(int event);
+
37 
+
38  virtual void enterField(bool reverse);
+
39  virtual void exitField();
+
40 
+
41  const String &label() const { return _label; }
+
42  void setLabel(const String &label);
+
43 
+
44  bool isCurrent() const;
+
45 
+
46 protected:
+
47  LiquidCrystal *lcd() const { return _form->_lcd; }
+
48 
+
49  virtual void updateCursor();
+
50 
+
51 private:
+
52  String _label;
+
53  Form *_form;
+
54  Field *next;
+
55  Field *prev;
+
56 
+
57  friend class Form;
+
58 };
+
59 
+
60 #endif
+
+ + diff --git a/Form_8cpp_source.html b/Form_8cpp_source.html index 61a15855..9f9f0dcf 100644 --- a/Form_8cpp_source.html +++ b/Form_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Form.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Form.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "Form.h"
-00024 #include "Field.h"
-00025 
-00047 Form::Form(LiquidCrystal &lcd)
-00048     : _lcd(&lcd)
-00049     , first(0)
-00050     , last(0)
-00051     , current(0)
-00052 {
-00053 }
-00054 
-00058 Form::~Form()
-00059 {
-00060     Field *field = first;
-00061     Field *next;
-00062     while (field != 0) {
-00063         next = field->next;
-00064         field->_form = 0;
-00065         field->next = 0;
-00066         field->prev = 0;
-00067         field = next;
-00068     }
-00069 }
-00070 
-00099 int Form::dispatch(int event)
-00100 {
-00101     if (current) {
-00102         int exitval = current->dispatch(event);
-00103         if (exitval >= 0)
-00104             return exitval;
-00105     }
-00106     if (event == LCD_BUTTON_LEFT)
-00107         prevField();
-00108     else if (event == LCD_BUTTON_RIGHT)
-00109         nextField();
-00110     return 0;
-00111 }
-00112 
-00118 void Form::nextField()
-00119 {
-00120     Field *field = current;
-00121     if (!field)
-00122         field = first;
-00123     if (field && field->next)
-00124         field = field->next;
-00125     else
-00126         field = first;
-00127     setCurrentField(field);
-00128 }
-00129 
-00135 void Form::prevField()
-00136 {
-00137     Field *field = current;
-00138     if (!field)
-00139         field = last;
-00140     if (field && field->prev)
-00141         field = field->prev;
-00142     else
-00143         field = last;
-00144     setCurrentField(field);
-00145 }
-00146 
-00152 void Form::defaultField()
-00153 {
-00154     setCurrentField(first);
-00155 }
-00156 
-00165 void Form::addField(Field *field)
-00166 {
-00167     if (field->_form)
-00168         return; // Already added to a form.
-00169     field->_form = this;
-00170     field->next = 0;
-00171     field->prev = last;
-00172     if (last)
-00173         last->next = field;
-00174     else
-00175         first = field;
-00176     last = field;
-00177 }
-00178 
-00187 void Form::removeField(Field *field)
-00188 {
-00189     if (field->_form != this)
-00190         return; // Not a member of this form.
-00191     if (current == field) {
-00192         if (field->next)
-00193             setCurrentField(field->next);
-00194         else if (field->prev)
-00195             setCurrentField(field->prev);
-00196         else
-00197             setCurrentField(0);
-00198     }
-00199     if (field->next)
-00200         field->next->prev = field->prev;
-00201     else
-00202         last = field->prev;
-00203     if (field->prev)
-00204         field->prev->next = field->next;
-00205     else
-00206         first = field->next;
-00207     field->_form = 0;
-00208     field->next = 0;
-00209     field->prev = 0;
-00210 }
-00211 
-00230 void Form::setCurrentField(Field *field)
-00231 {
-00232     if (field && field->_form != this)
-00233         return;     // Wrong form.
-00234     if (visible) {
-00235         bool reverse = false;
-00236         if (current) {
-00237             current->exitField();
-00238             if (field->next == current)
-00239                 reverse = true;
-00240             else if (!field->next && current == first)
-00241                 reverse = true;
-00242         }
-00243         current = field;
-00244         _lcd->clear();
-00245         if (current)
-00246             current->enterField(reverse);
-00247     } else {
-00248         current = field;
-00249     }
-00250 }
-00251 
-00274 void Form::show()
-00275 {
-00276     if (!visible) {
-00277         if (!current)
-00278             current = first;
-00279         visible = true;
-00280         _lcd->clear();
-00281         if (current)
-00282             current->enterField(false);
-00283     }
-00284 }
-00285 
-00293 void Form::hide()
-00294 {
-00295     if (visible) {
-00296         if (current)
-00297             current->exitField();
-00298         visible = false;
-00299         _lcd->clear();
-00300     }
-00301 }
-00302 
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -248,8 +77,194 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Form.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Form.h"
+
24 #include "Field.h"
+
25 
+
47 Form::Form(LiquidCrystal &lcd)
+
48  : _lcd(&lcd)
+
49  , first(0)
+
50  , last(0)
+
51  , current(0)
+
52 {
+
53 }
+
54 
+ +
59 {
+
60  Field *field = first;
+
61  Field *next;
+
62  while (field != 0) {
+
63  next = field->next;
+
64  field->_form = 0;
+
65  field->next = 0;
+
66  field->prev = 0;
+
67  field = next;
+
68  }
+
69 }
+
70 
+
99 int Form::dispatch(int event)
+
100 {
+
101  if (current) {
+
102  int exitval = current->dispatch(event);
+
103  if (exitval >= 0)
+
104  return exitval;
+
105  }
+
106  if (event == LCD_BUTTON_LEFT)
+
107  prevField();
+
108  else if (event == LCD_BUTTON_RIGHT)
+
109  nextField();
+
110  return 0;
+
111 }
+
112 
+ +
119 {
+
120  Field *field = current;
+
121  if (!field)
+
122  field = first;
+
123  if (field && field->next)
+
124  field = field->next;
+
125  else
+
126  field = first;
+
127  setCurrentField(field);
+
128 }
+
129 
+ +
136 {
+
137  Field *field = current;
+
138  if (!field)
+
139  field = last;
+
140  if (field && field->prev)
+
141  field = field->prev;
+
142  else
+
143  field = last;
+
144  setCurrentField(field);
+
145 }
+
146 
+ +
153 {
+
154  setCurrentField(first);
+
155 }
+
156 
+
165 void Form::addField(Field *field)
+
166 {
+
167  if (field->_form)
+
168  return; // Already added to a form.
+
169  field->_form = this;
+
170  field->next = 0;
+
171  field->prev = last;
+
172  if (last)
+
173  last->next = field;
+
174  else
+
175  first = field;
+
176  last = field;
+
177 }
+
178 
+ +
188 {
+
189  if (field->_form != this)
+
190  return; // Not a member of this form.
+
191  if (current == field) {
+
192  if (field->next)
+
193  setCurrentField(field->next);
+
194  else if (field->prev)
+
195  setCurrentField(field->prev);
+
196  else
+
197  setCurrentField(0);
+
198  }
+
199  if (field->next)
+
200  field->next->prev = field->prev;
+
201  else
+
202  last = field->prev;
+
203  if (field->prev)
+
204  field->prev->next = field->next;
+
205  else
+
206  first = field->next;
+
207  field->_form = 0;
+
208  field->next = 0;
+
209  field->prev = 0;
+
210 }
+
211 
+ +
231 {
+
232  if (field && field->_form != this)
+
233  return; // Wrong form.
+
234  if (visible) {
+
235  bool reverse = false;
+
236  if (current) {
+
237  current->exitField();
+
238  if (field->next == current)
+
239  reverse = true;
+
240  else if (!field->next && current == first)
+
241  reverse = true;
+
242  }
+
243  current = field;
+
244  _lcd->clear();
+
245  if (current)
+
246  current->enterField(reverse);
+
247  } else {
+
248  current = field;
+
249  }
+
250 }
+
251 
+ +
275 {
+
276  if (!visible) {
+
277  if (!current)
+
278  current = first;
+
279  visible = true;
+
280  _lcd->clear();
+
281  if (current)
+
282  current->enterField(false);
+
283  }
+
284 }
+
285 
+ +
294 {
+
295  if (visible) {
+
296  if (current)
+
297  current->exitField();
+
298  visible = false;
+
299  _lcd->clear();
+
300  }
+
301 }
+
302 
+
+ + diff --git a/Form_8h_source.html b/Form_8h_source.html index 79896eee..34c45736 100644 --- a/Form_8h_source.html +++ b/Form_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Form.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Form.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef Form_h
-00024 #define Form_h
-00025 
-00026 #include "LCD.h"
-00027 
-00028 class Field;
-00029 
-00030 #define FORM_CHANGED    1
-00031 
-00032 class Form {
-00033 public:
-00034     explicit Form(LiquidCrystal &lcd);
-00035     ~Form();
-00036 
-00037     int dispatch(int event);
-00038 
-00039     void nextField();
-00040     void prevField();
-00041     void defaultField();
-00042 
-00043     void addField(Field *field);
-00044     void removeField(Field *field);
-00045 
-00046     Field *currentField() const { return current; }
-00047     void setCurrentField(Field *field);
-00048 
-00049     bool isCurrent(Field &field) const { return current == &field; }
-00050 
-00051     void show();
-00052     void hide();
-00053     bool isVisible() const { return visible; }
-00054 
-00055 private:
-00056     LiquidCrystal *_lcd;
-00057     Field *first;
-00058     Field *last;
-00059     Field *current;
-00060     bool visible;
-00061 
-00062     friend class Field;
-00063 };
-00064 
-00065 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -141,8 +77,87 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Form.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Form_h
+
24 #define Form_h
+
25 
+
26 #include "LCD.h"
+
27 
+
28 class Field;
+
29 
+
30 #define FORM_CHANGED 1
+
31 
+
32 class Form {
+
33 public:
+
34  explicit Form(LiquidCrystal &lcd);
+
35  ~Form();
+
36 
+
37  int dispatch(int event);
+
38 
+
39  void nextField();
+
40  void prevField();
+
41  void defaultField();
+
42 
+
43  void addField(Field *field);
+
44  void removeField(Field *field);
+
45 
+
46  Field *currentField() const { return current; }
+
47  void setCurrentField(Field *field);
+
48 
+
49  bool isCurrent(Field &field) const { return current == &field; }
+
50 
+
51  void show();
+
52  void hide();
+
53  bool isVisible() const { return visible; }
+
54 
+
55 private:
+
56  LiquidCrystal *_lcd;
+
57  Field *first;
+
58  Field *last;
+
59  Field *current;
+
60  bool visible;
+
61 
+
62  friend class Field;
+
63 };
+
64 
+
65 #endif
+
+ + diff --git a/I2CMaster_8cpp_source.html b/I2CMaster_8cpp_source.html index 423ada04..10dd972f 100644 --- a/I2CMaster_8cpp_source.html +++ b/I2CMaster_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: I2CMaster.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
I2CMaster.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "I2CMaster.h"
-00024 
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -100,8 +77,46 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
I2CMaster.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "I2CMaster.h"
+
24 
+
+ + diff --git a/I2CMaster_8h_source.html b/I2CMaster_8h_source.html index 9224a1b2..d3dfd3d0 100644 --- a/I2CMaster_8h_source.html +++ b/I2CMaster_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: I2CMaster.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
I2CMaster.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef I2CMaster_h
-00024 #define I2CMaster_h
-00025 
-00026 #include <inttypes.h>
-00027 
-00028 class I2CMaster {
-00029 public:
-00030     virtual unsigned int maxTransferSize() const = 0;
-00031 
-00032     virtual void startWrite(unsigned int address);
-00033     virtual void write(uint8_t value) = 0;
-00034     virtual bool endWrite() = 0;
-00035 
-00036     virtual bool startRead(unsigned int address, unsigned int count) = 0;
-00037     virtual unsigned int available() = 0;
-00038     virtual uint8_t read() = 0;
-00039 };
-00040 
-00041 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -117,8 +77,63 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
I2CMaster.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef I2CMaster_h
+
24 #define I2CMaster_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 class I2CMaster {
+
29 public:
+
30  virtual unsigned int maxTransferSize() const = 0;
+
31 
+
32  virtual void startWrite(unsigned int address);
+
33  virtual void write(uint8_t value) = 0;
+
34  virtual bool endWrite() = 0;
+
35 
+
36  virtual bool startRead(unsigned int address, unsigned int count) = 0;
+
37  virtual unsigned int available() = 0;
+
38  virtual uint8_t read() = 0;
+
39 };
+
40 
+
41 #endif
+
+ + diff --git a/IRreceiver_8cpp_source.html b/IRreceiver_8cpp_source.html index bad78d7d..fb521c22 100644 --- a/IRreceiver_8cpp_source.html +++ b/IRreceiver_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: IRreceiver.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
IRreceiver.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "IRreceiver.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 
-00159 static IRreceiver *receiver = 0;
-00160 
-00161 void _IR_receive_interrupt(void)
-00162 {
-00163     receiver->handleInterrupt();
-00164 }
-00165 
-00176 IRreceiver::IRreceiver(int interruptNumber)
-00177     : _system(0)
-00178     , _systemFilter(-1)
-00179     , started(false)
-00180     , halfChange(false)
-00181     , lastChange(0)
-00182     , bits(0)
-00183     , bitCount(0)
-00184     , buffer(0)
-00185     , lastBuffer(0)
-00186 {
-00187     switch (interruptNumber) {
-00188     case 0: default:    pin = 2; break;
-00189     case 1:             pin = 3; break;
-00190     case 2:             pin = 21; break;    // Arduino Mega only
-00191     case 3:             pin = 20; break;    // Arduino Mega only
-00192     case 4:             pin = 19; break;    // Arduino Mega only
-00193     case 5:             pin = 18; break;    // Arduino Mega only
-00194     }
-00195     receiver = this;
-00196     attachInterrupt(interruptNumber, _IR_receive_interrupt, CHANGE);
-00197 }
-00198 
-00220 int IRreceiver::command()
-00221 {
-00222     unsigned buf;
-00223 
-00224     // Read the last-delivered sequence from the buffer and clear it.
-00225     cli();
-00226     buf = buffer;
-00227     buffer = 0;
-00228     sei();
-00229 
-00230     // Bail out if no sequence or it is not for us.
-00231     if (!buf) {
-00232         _system = -1;
-00233         return -1;
-00234     }
-00235     if (_systemFilter != -1) {
-00236         if (((buf >> 6) & 0x1F) != _systemFilter) {
-00237             _system = -1;
-00238             return -1;
-00239         }
-00240     }
-00241 
-00242     // Extract the command.
-00243     int cmd = buf & 0x3F;
-00244     if ((buf & 0x1000) == 0)
-00245         cmd += 64;
-00246 
-00247     // Is this a new command or an auto-repeat of the previous command?
-00248     // Bit 11 will toggle whenever a new button press is started.
-00249     if (lastBuffer == buf)
-00250         cmd += AUTO_REPEAT;
-00251     else
-00252         lastBuffer = buf;
-00253     _system = (buf >> 6) & 0x1F;
-00254     return cmd;
-00255 }
-00256 
-00304 // Number of microseconds that the signal is HIGH or LOW for
-00305 // indicating a bit.  A 1 bit is transmitted as LOW for 889us
-00306 // followed by HIGH for 889us.  A 0 bit is HIGH, then LOW.
-00307 #define IR_BIT_TIME 889
-00308 
-00309 // Number of microseconds to detect a long gap in the coding
-00310 // corresponding to 2 time units HIGH or LOW.  We actually check
-00311 // for at least 1.5 time units to allow for slight variations
-00312 // in timing on different remote controls.
-00313 #define IR_LONG_BIT_TIME (889 * 6 / 4)
-00314 
-00315 // Maximum timeout for a single bit.  If we don't see a rising edge
-00316 // within this time, then we have lost sync and need to restart.
-00317 #define IR_MAX_TIME (IR_BIT_TIME * 4)
-00318 
-00319 // Protocol details from http://en.wikipedia.org/wiki/RC-5
-00320 void IRreceiver::handleInterrupt()
-00321 {
-00322     bool value = digitalRead(pin);
-00323     unsigned long currentTime = micros();
-00324     if (!value) {
-00325         // Rising edge (input is active-LOW)
-00326         if (started && (currentTime - lastChange) > IR_MAX_TIME) {
-00327             // Too long since the last received bit, so restart the process.
-00328             started = false;
-00329         }
-00330         if (started) {
-00331             // We recognize bits on the falling edges, so merely
-00332             // adjust the "changed at last half-cycle" flag.
-00333             if ((currentTime - lastChange) > IR_LONG_BIT_TIME) {
-00334                 // Long time since last falling edge indicates that the
-00335                 // next bit will definitely be a 1.
-00336                 halfChange = true;
-00337             } else {
-00338                 halfChange = !halfChange;
-00339             }
-00340             lastChange = currentTime;
-00341         } else {
-00342             // Encountered the start bit - start receiving up to 14 bits.
-00343             lastChange = currentTime;
-00344             started = true;
-00345             halfChange = true;
-00346             bits = 0;
-00347             bitCount = 14;
-00348         }
-00349     } else if (started) {
-00350         // Falling edge
-00351         if ((currentTime - lastChange) > IR_LONG_BIT_TIME) {
-00352             // Long time since last rise indicates 1 followed by 0.
-00353             bits = (bits << 2) | 0x02;
-00354             --bitCount;
-00355             halfChange = true;
-00356         } else if (halfChange) {
-00357             // Rise was halfway through, so falling edge indicates a 1.
-00358             bits = (bits << 1) | 0x01;
-00359             halfChange = false;
-00360         } else {
-00361             // Rise was at the start, so falling edge indicates a 0.
-00362             bits <<= 1;
-00363             halfChange = true;
-00364         }
-00365         lastChange = currentTime;
-00366         --bitCount;
-00367         if (bitCount <= 0) {
-00368             // All 14 bits have been received, so deliver the value.
-00369             started = false;
-00370             buffer = bits;
-00371         }
-00372     }
-00373 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -242,8 +77,188 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
IRreceiver.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "IRreceiver.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
159 static IRreceiver *receiver = 0;
+
160 
+
161 void _IR_receive_interrupt(void)
+
162 {
+
163  receiver->handleInterrupt();
+
164 }
+
165 
+
176 IRreceiver::IRreceiver(int interruptNumber)
+
177  : _system(0)
+
178  , _systemFilter(-1)
+
179  , started(false)
+
180  , halfChange(false)
+
181  , lastChange(0)
+
182  , bits(0)
+
183  , bitCount(0)
+
184  , buffer(0)
+
185  , lastBuffer(0)
+
186 {
+
187  switch (interruptNumber) {
+
188  case 0: default: pin = 2; break;
+
189  case 1: pin = 3; break;
+
190  case 2: pin = 21; break; // Arduino Mega only
+
191  case 3: pin = 20; break; // Arduino Mega only
+
192  case 4: pin = 19; break; // Arduino Mega only
+
193  case 5: pin = 18; break; // Arduino Mega only
+
194  }
+
195  receiver = this;
+
196  attachInterrupt(interruptNumber, _IR_receive_interrupt, CHANGE);
+
197 }
+
198 
+ +
221 {
+
222  unsigned buf;
+
223 
+
224  // Read the last-delivered sequence from the buffer and clear it.
+
225  cli();
+
226  buf = buffer;
+
227  buffer = 0;
+
228  sei();
+
229 
+
230  // Bail out if no sequence or it is not for us.
+
231  if (!buf) {
+
232  _system = -1;
+
233  return -1;
+
234  }
+
235  if (_systemFilter != -1) {
+
236  if (((buf >> 6) & 0x1F) != _systemFilter) {
+
237  _system = -1;
+
238  return -1;
+
239  }
+
240  }
+
241 
+
242  // Extract the command.
+
243  int cmd = buf & 0x3F;
+
244  if ((buf & 0x1000) == 0)
+
245  cmd += 64;
+
246 
+
247  // Is this a new command or an auto-repeat of the previous command?
+
248  // Bit 11 will toggle whenever a new button press is started.
+
249  if (lastBuffer == buf)
+
250  cmd += AUTO_REPEAT;
+
251  else
+
252  lastBuffer = buf;
+
253  _system = (buf >> 6) & 0x1F;
+
254  return cmd;
+
255 }
+
256 
+
304 // Number of microseconds that the signal is HIGH or LOW for
+
305 // indicating a bit. A 1 bit is transmitted as LOW for 889us
+
306 // followed by HIGH for 889us. A 0 bit is HIGH, then LOW.
+
307 #define IR_BIT_TIME 889
+
308 
+
309 // Number of microseconds to detect a long gap in the coding
+
310 // corresponding to 2 time units HIGH or LOW. We actually check
+
311 // for at least 1.5 time units to allow for slight variations
+
312 // in timing on different remote controls.
+
313 #define IR_LONG_BIT_TIME (889 * 6 / 4)
+
314 
+
315 // Maximum timeout for a single bit. If we don't see a rising edge
+
316 // within this time, then we have lost sync and need to restart.
+
317 #define IR_MAX_TIME (IR_BIT_TIME * 4)
+
318 
+
319 // Protocol details from http://en.wikipedia.org/wiki/RC-5
+
320 void IRreceiver::handleInterrupt()
+
321 {
+
322  bool value = digitalRead(pin);
+
323  unsigned long currentTime = micros();
+
324  if (!value) {
+
325  // Rising edge (input is active-LOW)
+
326  if (started && (currentTime - lastChange) > IR_MAX_TIME) {
+
327  // Too long since the last received bit, so restart the process.
+
328  started = false;
+
329  }
+
330  if (started) {
+
331  // We recognize bits on the falling edges, so merely
+
332  // adjust the "changed at last half-cycle" flag.
+
333  if ((currentTime - lastChange) > IR_LONG_BIT_TIME) {
+
334  // Long time since last falling edge indicates that the
+
335  // next bit will definitely be a 1.
+
336  halfChange = true;
+
337  } else {
+
338  halfChange = !halfChange;
+
339  }
+
340  lastChange = currentTime;
+
341  } else {
+
342  // Encountered the start bit - start receiving up to 14 bits.
+
343  lastChange = currentTime;
+
344  started = true;
+
345  halfChange = true;
+
346  bits = 0;
+
347  bitCount = 14;
+
348  }
+
349  } else if (started) {
+
350  // Falling edge
+
351  if ((currentTime - lastChange) > IR_LONG_BIT_TIME) {
+
352  // Long time since last rise indicates 1 followed by 0.
+
353  bits = (bits << 2) | 0x02;
+
354  --bitCount;
+
355  halfChange = true;
+
356  } else if (halfChange) {
+
357  // Rise was halfway through, so falling edge indicates a 1.
+
358  bits = (bits << 1) | 0x01;
+
359  halfChange = false;
+
360  } else {
+
361  // Rise was at the start, so falling edge indicates a 0.
+
362  bits <<= 1;
+
363  halfChange = true;
+
364  }
+
365  lastChange = currentTime;
+
366  --bitCount;
+
367  if (bitCount <= 0) {
+
368  // All 14 bits have been received, so deliver the value.
+
369  started = false;
+
370  buffer = bits;
+
371  }
+
372  }
+
373 }
+
+ + diff --git a/IRreceiver_8h_source.html b/IRreceiver_8h_source.html index 06500af7..36a817cd 100644 --- a/IRreceiver_8h_source.html +++ b/IRreceiver_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: IRreceiver.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
IRreceiver.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef IRreceiver_h
-00024 #define IRreceiver_h
-00025 
-00026 #include <inttypes.h>
-00027 #include "RC5.h"
-00028 
-00029 class IRreceiver
-00030 {
-00031 public:
-00032     explicit IRreceiver(int interruptNumber = 0);
-00033 
-00034     static const int AUTO_REPEAT = 128;
-00035 
-00036     int command();
-00037     int system() const { return _system; }
-00038 
-00039     int systemFilter() const { return _systemFilter; }
-00040     void setSystemFilter(int system) { _systemFilter = system; }
-00041 
-00042 private:
-00043     int _system;
-00044     int _systemFilter;
-00045     uint8_t pin;
-00046     bool started;
-00047     bool halfChange;    // Value last changed half-way through bit cycle time.
-00048     unsigned long lastChange;
-00049     unsigned bits;
-00050     int8_t bitCount;
-00051     volatile unsigned buffer;
-00052     unsigned lastBuffer;
-00053 
-00054     void handleInterrupt();
-00055 
-00056     friend void _IR_receive_interrupt(void);
-00057 };
-00058 
-00059 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -135,8 +77,81 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
IRreceiver.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef IRreceiver_h
+
24 #define IRreceiver_h
+
25 
+
26 #include <inttypes.h>
+
27 #include "RC5.h"
+
28 
+ +
30 {
+
31 public:
+
32  explicit IRreceiver(int interruptNumber = 0);
+
33 
+
34  static const int AUTO_REPEAT = 128;
+
35 
+
36  int command();
+
37  int system() const { return _system; }
+
38 
+
39  int systemFilter() const { return _systemFilter; }
+
40  void setSystemFilter(int system) { _systemFilter = system; }
+
41 
+
42 private:
+
43  int _system;
+
44  int _systemFilter;
+
45  uint8_t pin;
+
46  bool started;
+
47  bool halfChange; // Value last changed half-way through bit cycle time.
+
48  unsigned long lastChange;
+
49  unsigned bits;
+
50  int8_t bitCount;
+
51  volatile unsigned buffer;
+
52  unsigned lastBuffer;
+
53 
+
54  void handleInterrupt();
+
55 
+
56  friend void _IR_receive_interrupt(void);
+
57 };
+
58 
+
59 #endif
+
+ + diff --git a/IntField_8cpp_source.html b/IntField_8cpp_source.html index 73cffc82..f2806a0f 100644 --- a/IntField_8cpp_source.html +++ b/IntField_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: IntField.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
IntField.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "IntField.h"
-00024 
-00071 IntField::IntField(const String &label)
-00072     : Field(label)
-00073     , _minValue(0)
-00074     , _maxValue(100)
-00075     , _stepValue(1)
-00076     , _value(0)
-00077     , _printLen(0)
-00078 {
-00079 }
-00080 
-00088 IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)
-00089     : Field(form, label)
-00090     , _minValue(minValue)
-00091     , _maxValue(maxValue)
-00092     , _stepValue(stepValue)
-00093     , _value(value)
-00094     , _printLen(0)
-00095 {
-00096 }
-00097 
-00103 IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)
-00104     : Field(form, label)
-00105     , _minValue(minValue)
-00106     , _maxValue(maxValue)
-00107     , _stepValue(stepValue)
-00108     , _value(value)
-00109     , _printLen(0)
-00110     , _suffix(suffix)
-00111 {
-00112 }
-00113 
-00114 int IntField::dispatch(int event)
-00115 {
-00116     if (event == LCD_BUTTON_UP) {
-00117         setValue(_value + _stepValue);
-00118         return FORM_CHANGED;
-00119     } else if (event == LCD_BUTTON_DOWN) {
-00120         setValue(_value - _stepValue);
-00121         return FORM_CHANGED;
-00122     }
-00123     return -1;
-00124 }
-00125 
-00126 void IntField::enterField(bool reverse)
-00127 {
-00128     Field::enterField(reverse);
-00129     printValue();
-00130 }
-00131 
-00198 void IntField::setValue(int value)
-00199 {
-00200     if (value < _minValue)
-00201         value = _minValue;
-00202     else if (value > _maxValue)
-00203         value = _maxValue;
-00204     if (value != _value) {
-00205         _value = value;
-00206         if (isCurrent())
-00207             printValue();
-00208     }
-00209 }
-00210 
-00231 void IntField::setSuffix(const String &suffix)
-00232 {
-00233     _suffix = suffix;
-00234     if (isCurrent())
-00235         printValue();
-00236 }
-00237 
-00238 void IntField::printValue()
-00239 {
-00240     String str(_value);
-00241     if (_suffix.length())
-00242         str += _suffix;
-00243     lcd()->setCursor(0, 1);
-00244     lcd()->print(str);
-00245     unsigned int len = str.length();
-00246     while (len++ < _printLen)
-00247         lcd()->write(' ');
-00248     _printLen = str.length();
-00249 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -181,8 +77,127 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
IntField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "IntField.h"
+
24 
+
71 IntField::IntField(const String &label)
+
72  : Field(label)
+
73  , _minValue(0)
+
74  , _maxValue(100)
+
75  , _stepValue(1)
+
76  , _value(0)
+
77  , _printLen(0)
+
78 {
+
79 }
+
80 
+
88 IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)
+
89  : Field(form, label)
+
90  , _minValue(minValue)
+
91  , _maxValue(maxValue)
+
92  , _stepValue(stepValue)
+
93  , _value(value)
+
94  , _printLen(0)
+
95 {
+
96 }
+
97 
+
103 IntField::IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)
+
104  : Field(form, label)
+
105  , _minValue(minValue)
+
106  , _maxValue(maxValue)
+
107  , _stepValue(stepValue)
+
108  , _value(value)
+
109  , _printLen(0)
+
110  , _suffix(suffix)
+
111 {
+
112 }
+
113 
+
114 int IntField::dispatch(int event)
+
115 {
+
116  if (event == LCD_BUTTON_UP) {
+
117  setValue(_value + _stepValue);
+
118  return FORM_CHANGED;
+
119  } else if (event == LCD_BUTTON_DOWN) {
+
120  setValue(_value - _stepValue);
+
121  return FORM_CHANGED;
+
122  }
+
123  return -1;
+
124 }
+
125 
+
126 void IntField::enterField(bool reverse)
+
127 {
+
128  Field::enterField(reverse);
+
129  printValue();
+
130 }
+
131 
+
198 void IntField::setValue(int value)
+
199 {
+
200  if (value < _minValue)
+
201  value = _minValue;
+
202  else if (value > _maxValue)
+
203  value = _maxValue;
+
204  if (value != _value) {
+
205  _value = value;
+
206  if (isCurrent())
+
207  printValue();
+
208  }
+
209 }
+
210 
+
231 void IntField::setSuffix(const String &suffix)
+
232 {
+
233  _suffix = suffix;
+
234  if (isCurrent())
+
235  printValue();
+
236 }
+
237 
+
238 void IntField::printValue()
+
239 {
+
240  String str(_value);
+
241  if (_suffix.length())
+
242  str += _suffix;
+
243  lcd()->setCursor(0, 1);
+
244  lcd()->print(str);
+
245  unsigned int len = str.length();
+
246  while (len++ < _printLen)
+
247  lcd()->write(' ');
+
248  _printLen = str.length();
+
249 }
+
+ + diff --git a/IntField_8h_source.html b/IntField_8h_source.html index 8c6757f5..a21a09cd 100644 --- a/IntField_8h_source.html +++ b/IntField_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: IntField.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
IntField.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef IntField_h
-00024 #define IntField_h
-00025 
-00026 #include "Field.h"
-00027 
-00028 class IntField : public Field {
-00029 public:
-00030     explicit IntField(const String &label);
-00031     IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value);
-00032     IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix);
-00033 
-00034     int dispatch(int event);
-00035 
-00036     void enterField(bool reverse);
-00037 
-00038     int minValue() const { return _minValue; }
-00039     void setMinValue(int value) { _minValue = value; }
-00040 
-00041     int maxValue() const { return _maxValue; }
-00042     void setMaxValue(int value) { _maxValue = value; }
-00043 
-00044     int stepValue() const { return _stepValue; }
-00045     void setStepValue(int value) { _stepValue = value; }
-00046 
-00047     int value() const { return _value; }
-00048     void setValue(int value);
-00049 
-00050     const String &suffix() const { return _suffix; }
-00051     void setSuffix(const String &suffix);
-00052 
-00053 private:
-00054     int _minValue;
-00055     int _maxValue;
-00056     int _stepValue;
-00057     int _value;
-00058     int _printLen;
-00059     String _suffix;
-00060 
-00061     void printValue();
-00062 };
-00063 
-00064 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -140,8 +77,86 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
IntField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef IntField_h
+
24 #define IntField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 class IntField : public Field {
+
29 public:
+
30  explicit IntField(const String &label);
+
31  IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value);
+
32  IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix);
+
33 
+
34  int dispatch(int event);
+
35 
+
36  void enterField(bool reverse);
+
37 
+
38  int minValue() const { return _minValue; }
+
39  void setMinValue(int value) { _minValue = value; }
+
40 
+
41  int maxValue() const { return _maxValue; }
+
42  void setMaxValue(int value) { _maxValue = value; }
+
43 
+
44  int stepValue() const { return _stepValue; }
+
45  void setStepValue(int value) { _stepValue = value; }
+
46 
+
47  int value() const { return _value; }
+
48  void setValue(int value);
+
49 
+
50  const String &suffix() const { return _suffix; }
+
51  void setSuffix(const String &suffix);
+
52 
+
53 private:
+
54  int _minValue;
+
55  int _maxValue;
+
56  int _stepValue;
+
57  int _value;
+
58  int _printLen;
+
59  String _suffix;
+
60 
+
61  void printValue();
+
62 };
+
63 
+
64 #endif
+
+ + diff --git a/LCD_8cpp_source.html b/LCD_8cpp_source.html index 16a2dfef..ec582bd9 100644 --- a/LCD_8cpp_source.html +++ b/LCD_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: LCD.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
LCD.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "LCD.h"
-00024 #include <avr/pgmspace.h>
-00025 #if defined(ARDUINO) && ARDUINO >= 100
-00026 #include <Arduino.h>
-00027 #else
-00028 #include <WProgram.h>
-00029 #endif
-00030 
-00031 #define LCD_BACK_LIGHT          3        // Default LCD backlight is on D3
-00032 #define LCD_BUTTON_PIN          A0       // Button state is on A0
-00033 
-00034 #define DEBOUNCE_DELAY          10      // Delay in ms to debounce buttons
-00035 
-00130 void LCD::init()
-00131 {
-00132     // The Freetronics display is 16x2.
-00133     begin(16, 2);
-00134 
-00135     // Configure the backlight pin, but don't activate it yet in
-00136     // case the application sets it to something else during setup().
-00137     // Initialization will be forced in the first call to getButton().
-00138     _backlightPin = LCD_BACK_LIGHT;
-00139     backlightInit = false;
-00140 
-00141     // Initialise button input.
-00142     pinMode(LCD_BUTTON_PIN, INPUT);
-00143     digitalWrite(LCD_BUTTON_PIN, LOW);
-00144     prevButton = LCD_BUTTON_NONE;
-00145     debounceButton = LCD_BUTTON_NONE;
-00146     lastDebounce = 0;
-00147     eatRelease = false;
-00148 
-00149     // Initialize screen saver.
-00150     timeout = 0;
-00151     lastRestore = millis();
-00152     screenSaved = false;
-00153     mode = DisplayOff;
-00154 }
-00155 
-00182 void LCD::setBacklightPin(uint8_t pin)
-00183 {
-00184     if (_backlightPin != pin) {
-00185         if (backlightInit) {
-00186             // Restore the previous backlight pin to input, floating.
-00187             pinMode(_backlightPin, INPUT);
-00188             digitalWrite(_backlightPin, LOW);
-00189 
-00190             // Need to re-initialize the backlight at the earliest opportunity.
-00191             backlightInit = false;
-00192         }
-00193         _backlightPin = pin;
-00194     }
-00195 }
-00196 
-00206 void LCD::display()
-00207 {
-00208     LiquidCrystal::display();
-00209     pinMode(_backlightPin, OUTPUT);
-00210     digitalWrite(_backlightPin, HIGH);
-00211     screenSaved = false;
-00212     backlightInit = true;
-00213     lastRestore = millis();
-00214 }
-00215 
-00223 void LCD::noDisplay()
-00224 {
-00225     if (mode == DisplayOff)
-00226         LiquidCrystal::noDisplay();
-00227     pinMode(_backlightPin, OUTPUT);
-00228     digitalWrite(_backlightPin, LOW);
-00229     screenSaved = true;
-00230     backlightInit = true;
-00231 }
-00232 
-00268 void LCD::setScreenSaverMode(ScreenSaverMode mode)
-00269 {
-00270     if (this->mode != mode) {
-00271         this->mode = mode;
-00272         if (screenSaved)
-00273             noDisplay();
-00274         else
-00275             display();
-00276     }
-00277 }
-00278 
-00294 void LCD::enableScreenSaver(int timeoutSecs)
-00295 {
-00296     if (timeoutSecs < 0)
-00297         timeout = 0;
-00298     else
-00299         timeout = ((unsigned long)timeoutSecs) * 1000;
-00300     display();
-00301 }
-00302 
-00308 void LCD::disableScreenSaver()
-00309 {
-00310     timeout = 0;
-00311     display();
-00312 }
-00313 
-00321 // Button mapping table generated by genlookup.c
-00322 static prog_uint8_t const buttonMappings[] PROGMEM = {
-00323     2, 0, 0, 0, 3, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 1,
-00324     1, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0
-00325 };
-00326 #define mapButton(value) (pgm_read_byte(&(buttonMappings[(value) >> 5])))
-00327 
-00353 int LCD::getButton()
-00354 {
-00355     // Initialize the backlight for the first time if necessary.
-00356     if (!backlightInit)
-00357         display();
-00358 
-00359     // Read the currently pressed button.
-00360     int button = mapButton(analogRead(LCD_BUTTON_PIN));
-00361 
-00362     // Debounce the button state.
-00363     unsigned long currentTime = millis();
-00364     if (button != debounceButton)
-00365         lastDebounce = currentTime;
-00366     debounceButton = button;
-00367     if ((currentTime - lastDebounce) < DEBOUNCE_DELAY)
-00368         button = prevButton;
-00369 
-00370     // Process the button event if the state has changed.
-00371     if (prevButton == LCD_BUTTON_NONE && button != LCD_BUTTON_NONE) {
-00372         prevButton = button;
-00373         if (screenSaved) {
-00374             // Button pressed when screen saver active.
-00375             if (mode == BacklightOnSelect) {
-00376                 // Turn on the back light only if Select was pressed.
-00377                 if (button == LCD_BUTTON_SELECT) {
-00378                     pinMode(_backlightPin, OUTPUT);
-00379                     digitalWrite(_backlightPin, HIGH);
-00380                     screenSaved = false;
-00381                     backlightInit = true;
-00382                 }
-00383             } else if (mode == DisplayOff) {
-00384                 display();
-00385                 eatRelease = true;
-00386                 return LCD_BUTTON_NONE;
-00387             } else {
-00388                 display();
-00389             }
-00390         } else if (mode == BacklightOnSelect && button != LCD_BUTTON_SELECT) {
-00391             eatRelease = false;
-00392             return button;
-00393         }
-00394         eatRelease = false;
-00395         lastRestore = currentTime;
-00396         return button;
-00397     } else if (prevButton != LCD_BUTTON_NONE && button == LCD_BUTTON_NONE) {
-00398         button = -prevButton;
-00399         prevButton = LCD_BUTTON_NONE;
-00400         lastRestore = currentTime;
-00401         if (eatRelease) {
-00402             eatRelease = false;
-00403             return LCD_BUTTON_NONE;
-00404         }
-00405         return button;
-00406     } else {
-00407         if (!screenSaved && prevButton == LCD_BUTTON_NONE &&
-00408                 timeout != 0 && (currentTime - lastRestore) >= timeout)
-00409             noDisplay();    // Activate screen saver.
-00410         return LCD_BUTTON_NONE;
-00411     }
-00412 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -265,8 +77,211 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
LCD.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "LCD.h"
+
24 #include <avr/pgmspace.h>
+
25 #if defined(ARDUINO) && ARDUINO >= 100
+
26 #include <Arduino.h>
+
27 #else
+
28 #include <WProgram.h>
+
29 #endif
+
30 
+
31 #define LCD_BACK_LIGHT 3 // Default LCD backlight is on D3
+
32 #define LCD_BUTTON_PIN A0 // Button state is on A0
+
33 
+
34 #define DEBOUNCE_DELAY 10 // Delay in ms to debounce buttons
+
35 
+
130 void LCD::init()
+
131 {
+
132  // The Freetronics display is 16x2.
+
133  begin(16, 2);
+
134 
+
135  // Configure the backlight pin, but don't activate it yet in
+
136  // case the application sets it to something else during setup().
+
137  // Initialization will be forced in the first call to getButton().
+
138  _backlightPin = LCD_BACK_LIGHT;
+
139  backlightInit = false;
+
140 
+
141  // Initialise button input.
+
142  pinMode(LCD_BUTTON_PIN, INPUT);
+
143  digitalWrite(LCD_BUTTON_PIN, LOW);
+
144  prevButton = LCD_BUTTON_NONE;
+
145  debounceButton = LCD_BUTTON_NONE;
+
146  lastDebounce = 0;
+
147  eatRelease = false;
+
148 
+
149  // Initialize screen saver.
+
150  timeout = 0;
+
151  lastRestore = millis();
+
152  screenSaved = false;
+
153  mode = DisplayOff;
+
154 }
+
155 
+
182 void LCD::setBacklightPin(uint8_t pin)
+
183 {
+
184  if (_backlightPin != pin) {
+
185  if (backlightInit) {
+
186  // Restore the previous backlight pin to input, floating.
+
187  pinMode(_backlightPin, INPUT);
+
188  digitalWrite(_backlightPin, LOW);
+
189 
+
190  // Need to re-initialize the backlight at the earliest opportunity.
+
191  backlightInit = false;
+
192  }
+
193  _backlightPin = pin;
+
194  }
+
195 }
+
196 
+ +
207 {
+ +
209  pinMode(_backlightPin, OUTPUT);
+
210  digitalWrite(_backlightPin, HIGH);
+
211  screenSaved = false;
+
212  backlightInit = true;
+
213  lastRestore = millis();
+
214 }
+
215 
+ +
224 {
+
225  if (mode == DisplayOff)
+ +
227  pinMode(_backlightPin, OUTPUT);
+
228  digitalWrite(_backlightPin, LOW);
+
229  screenSaved = true;
+
230  backlightInit = true;
+
231 }
+
232 
+ +
269 {
+
270  if (this->mode != mode) {
+
271  this->mode = mode;
+
272  if (screenSaved)
+
273  noDisplay();
+
274  else
+
275  display();
+
276  }
+
277 }
+
278 
+
294 void LCD::enableScreenSaver(int timeoutSecs)
+
295 {
+
296  if (timeoutSecs < 0)
+
297  timeout = 0;
+
298  else
+
299  timeout = ((unsigned long)timeoutSecs) * 1000;
+
300  display();
+
301 }
+
302 
+ +
309 {
+
310  timeout = 0;
+
311  display();
+
312 }
+
313 
+
321 // Button mapping table generated by genlookup.c
+
322 static unsigned char const buttonMappings[] PROGMEM = {
+
323  2, 0, 0, 0, 3, 0, 0, 0, 0, 4, 4, 0, 0, 0, 0, 1,
+
324  1, 0, 0, 0, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0
+
325 };
+
326 #define mapButton(value) (pgm_read_byte(&(buttonMappings[(value) >> 5])))
+
327 
+ +
354 {
+
355  // Initialize the backlight for the first time if necessary.
+
356  if (!backlightInit)
+
357  display();
+
358 
+
359  // Read the currently pressed button.
+
360  int button = mapButton(analogRead(LCD_BUTTON_PIN));
+
361 
+
362  // Debounce the button state.
+
363  unsigned long currentTime = millis();
+
364  if (button != debounceButton)
+
365  lastDebounce = currentTime;
+
366  debounceButton = button;
+
367  if ((currentTime - lastDebounce) < DEBOUNCE_DELAY)
+
368  button = prevButton;
+
369 
+
370  // Process the button event if the state has changed.
+
371  if (prevButton == LCD_BUTTON_NONE && button != LCD_BUTTON_NONE) {
+
372  prevButton = button;
+
373  if (screenSaved) {
+
374  // Button pressed when screen saver active.
+
375  if (mode == BacklightOnSelect) {
+
376  // Turn on the back light only if Select was pressed.
+
377  if (button == LCD_BUTTON_SELECT) {
+
378  pinMode(_backlightPin, OUTPUT);
+
379  digitalWrite(_backlightPin, HIGH);
+
380  screenSaved = false;
+
381  backlightInit = true;
+
382  }
+
383  } else if (mode == DisplayOff) {
+
384  display();
+
385  eatRelease = true;
+
386  return LCD_BUTTON_NONE;
+
387  } else {
+
388  display();
+
389  }
+
390  } else if (mode == BacklightOnSelect && button != LCD_BUTTON_SELECT) {
+
391  eatRelease = false;
+
392  return button;
+
393  }
+
394  eatRelease = false;
+
395  lastRestore = currentTime;
+
396  return button;
+
397  } else if (prevButton != LCD_BUTTON_NONE && button == LCD_BUTTON_NONE) {
+
398  button = -prevButton;
+
399  prevButton = LCD_BUTTON_NONE;
+
400  lastRestore = currentTime;
+
401  if (eatRelease) {
+
402  eatRelease = false;
+
403  return LCD_BUTTON_NONE;
+
404  }
+
405  return button;
+
406  } else {
+
407  if (!screenSaved && prevButton == LCD_BUTTON_NONE &&
+
408  timeout != 0 && (currentTime - lastRestore) >= timeout)
+
409  noDisplay(); // Activate screen saver.
+
410  return LCD_BUTTON_NONE;
+
411  }
+
412 }
+
+ + diff --git a/LCD_8h_source.html b/LCD_8h_source.html index c85a1208..853abd82 100644 --- a/LCD_8h_source.html +++ b/LCD_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: LCD.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
LCD.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef LCD_h
-00024 #define LCD_h
-00025 
-00026 // Extended version of the LiquidCrystal library that works specifically
-00027 // with Freetronics' 16x2 LCD display, including support for the back
-00028 // light and the Up/Down/Left/Right/Select buttons.  More info:
-00029 //
-00030 // http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide
-00031 
-00032 // Include a copy of the standard LiquidCrystal library so we can extend it.
-00033 #include "utility/LiquidCrystal.h"
-00034 
-00035 // Button event codes.
-00036 #define LCD_BUTTON_NONE             0
-00037 #define LCD_BUTTON_LEFT             1
-00038 #define LCD_BUTTON_RIGHT            2
-00039 #define LCD_BUTTON_UP               3
-00040 #define LCD_BUTTON_DOWN             4
-00041 #define LCD_BUTTON_SELECT           5
-00042 #define LCD_BUTTON_LEFT_RELEASED    -1
-00043 #define LCD_BUTTON_RIGHT_RELEASED   -2
-00044 #define LCD_BUTTON_UP_RELEASED      -3
-00045 #define LCD_BUTTON_DOWN_RELEASED    -4
-00046 #define LCD_BUTTON_SELECT_RELEASED  -5
-00047 
-00048 class LCD : public LiquidCrystal {
-00049 public:
-00050     LCD() : LiquidCrystal(8, 9, 4, 5, 6, 7) { init(); }
-00051     LCD(uint8_t pin9) : LiquidCrystal(8, pin9, 4, 5, 6, 7) { init(); }
-00052 
-00053     uint8_t backlightPin() const { return _backlightPin; }
-00054     void setBacklightPin(uint8_t pin);
-00055 
-00056     void display();
-00057     void noDisplay();
-00058 
-00059     enum ScreenSaverMode
-00060     {
-00061         DisplayOff,
-00062         BacklightOff,
-00063         BacklightOnSelect
-00064     };
-00065 
-00066     ScreenSaverMode screenSaverMode() const { return mode; }
-00067     void setScreenSaverMode(ScreenSaverMode mode);
-00068 
-00069     void enableScreenSaver(int timeoutSecs = 10);
-00070     void disableScreenSaver();
-00071     bool isScreenSaved() const { return screenSaved; }
-00072 
-00073     int getButton();
-00074 
-00075 private:
-00076     uint8_t _backlightPin;
-00077     bool backlightInit;
-00078     int prevButton;
-00079     int debounceButton;
-00080     unsigned long timeout;
-00081     unsigned long lastRestore;
-00082     unsigned long lastDebounce;
-00083     bool screenSaved;
-00084     bool eatRelease;
-00085     ScreenSaverMode mode;
-00086 
-00087     void init();
-00088 };
-00089 
-00090 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -166,8 +77,112 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
LCD.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef LCD_h
+
24 #define LCD_h
+
25 
+
26 // Extended version of the LiquidCrystal library that works specifically
+
27 // with Freetronics' 16x2 LCD display, including support for the back
+
28 // light and the Up/Down/Left/Right/Select buttons. More info:
+
29 //
+
30 // http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide
+
31 
+
32 // Include a copy of the standard LiquidCrystal library so we can extend it.
+
33 #include "utility/LiquidCrystal.h"
+
34 
+
35 // Button event codes.
+
36 #define LCD_BUTTON_NONE 0
+
37 #define LCD_BUTTON_LEFT 1
+
38 #define LCD_BUTTON_RIGHT 2
+
39 #define LCD_BUTTON_UP 3
+
40 #define LCD_BUTTON_DOWN 4
+
41 #define LCD_BUTTON_SELECT 5
+
42 #define LCD_BUTTON_LEFT_RELEASED -1
+
43 #define LCD_BUTTON_RIGHT_RELEASED -2
+
44 #define LCD_BUTTON_UP_RELEASED -3
+
45 #define LCD_BUTTON_DOWN_RELEASED -4
+
46 #define LCD_BUTTON_SELECT_RELEASED -5
+
47 
+
48 class LCD : public LiquidCrystal {
+
49 public:
+
50  LCD() : LiquidCrystal(8, 9, 4, 5, 6, 7) { init(); }
+
51  LCD(uint8_t pin9) : LiquidCrystal(8, pin9, 4, 5, 6, 7) { init(); }
+
52 
+
53  uint8_t backlightPin() const { return _backlightPin; }
+
54  void setBacklightPin(uint8_t pin);
+
55 
+
56  void display();
+
57  void noDisplay();
+
58 
+ +
60  {
+ + + +
64  };
+
65 
+
66  ScreenSaverMode screenSaverMode() const { return mode; }
+ +
68 
+
69  void enableScreenSaver(int timeoutSecs = 10);
+
70  void disableScreenSaver();
+
71  bool isScreenSaved() const { return screenSaved; }
+
72 
+
73  int getButton();
+
74 
+
75 private:
+
76  uint8_t _backlightPin;
+
77  bool backlightInit;
+
78  int prevButton;
+
79  int debounceButton;
+
80  unsigned long timeout;
+
81  unsigned long lastRestore;
+
82  unsigned long lastDebounce;
+
83  bool screenSaved;
+
84  bool eatRelease;
+
85  ScreenSaverMode mode;
+
86 
+
87  void init();
+
88 };
+
89 
+
90 #endif
+
+ + diff --git a/ListField_8cpp_source.html b/ListField_8cpp_source.html index 29337149..06c0a33a 100644 --- a/ListField_8cpp_source.html +++ b/ListField_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: ListField.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
ListField.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "ListField.h"
-00024 #include <string.h>
-00025 
-00064 ListField::ListField(const String &label)
-00065     : Field(label)
-00066     , _items(0)
-00067     , _itemCount(0)
-00068     , _value(-1)
-00069     , _printLen(0)
-00070 {
-00071 }
-00072 
-00077 ListField::ListField(Form &form, const String &label, ListItems items, int value)
-00078     : Field(form, label)
-00079     , _items(0)
-00080     , _itemCount(0)
-00081     , _value(value)
-00082     , _printLen(0)
-00083 {
-00084     setItems(items);
-00085 }
-00086 
-00087 int ListField::dispatch(int event)
-00088 {
-00089     if (event == LCD_BUTTON_DOWN) {
-00090         if (_value >= (_itemCount - 1))
-00091             setValue(0);
-00092         else
-00093             setValue(_value + 1);
-00094         return FORM_CHANGED;
-00095     } else if (event == LCD_BUTTON_UP) {
-00096         if (_value <= 0)
-00097             setValue(_itemCount - 1);
-00098         else
-00099             setValue(_value - 1);
-00100         return FORM_CHANGED;
-00101     }
-00102     return -1;
-00103 }
-00104 
-00105 void ListField::enterField(bool reverse)
-00106 {
-00107     Field::enterField(reverse);
-00108     _printLen = 0;
-00109     printValue();
-00110 }
-00111 
-00141 void ListField::setItems(ListItems items)
-00142 {
-00143     _items = items;
-00144     _itemCount = 0;
-00145     if (items) {
-00146         for (;;) {
-00147             ListItem item = (ListItem)pgm_read_word(items);
-00148             if (!item)
-00149                 break;
-00150             ++items;
-00151             ++_itemCount;
-00152         }
-00153     }
-00154     if (_value >= _itemCount)
-00155         _value = _itemCount - 1;
-00156     if (isCurrent())
-00157         printValue();
-00158 }
-00159 
-00178 void ListField::setValue(int value)
-00179 {
-00180     if (_value != value) {
-00181         _value = value;
-00182         if (_value < 0)
-00183             _value = 0;
-00184         if (_value >= _itemCount)
-00185             _value = _itemCount - 1;
-00186         if (isCurrent())
-00187             printValue();
-00188     }
-00189 }
-00190 
-00191 void ListField::printValue()
-00192 {
-00193     lcd()->setCursor(0, 1);
-00194     int len = 0;
-00195     if (_value >= 0) {
-00196         ListItem str = (ListItem)pgm_read_word(&(_items[_value]));
-00197         char ch;
-00198         while ((ch = pgm_read_byte(str)) != 0) {
-00199             lcd()->write(ch);
-00200             ++len;
-00201             ++str;
-00202         }
-00203     }
-00204     while (_printLen-- > len)
-00205         lcd()->write(' ');
-00206     _printLen = len;
-00207 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -194,8 +77,140 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
ListField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "ListField.h"
+
24 #include <string.h>
+
25 
+
64 ListField::ListField(const String &label)
+
65  : Field(label)
+
66  , _items(0)
+
67  , _itemCount(0)
+
68  , _value(-1)
+
69  , _printLen(0)
+
70 {
+
71 }
+
72 
+
77 ListField::ListField(Form &form, const String &label, ListItems items, int value)
+
78  : Field(form, label)
+
79  , _items(0)
+
80  , _itemCount(0)
+
81  , _value(value)
+
82  , _printLen(0)
+
83 {
+
84  setItems(items);
+
85 }
+
86 
+
87 int ListField::dispatch(int event)
+
88 {
+
89  if (event == LCD_BUTTON_DOWN) {
+
90  if (_value >= (_itemCount - 1))
+
91  setValue(0);
+
92  else
+
93  setValue(_value + 1);
+
94  return FORM_CHANGED;
+
95  } else if (event == LCD_BUTTON_UP) {
+
96  if (_value <= 0)
+
97  setValue(_itemCount - 1);
+
98  else
+
99  setValue(_value - 1);
+
100  return FORM_CHANGED;
+
101  }
+
102  return -1;
+
103 }
+
104 
+
105 void ListField::enterField(bool reverse)
+
106 {
+
107  Field::enterField(reverse);
+
108  _printLen = 0;
+
109  printValue();
+
110 }
+
111 
+
141 void ListField::setItems(ListItems items)
+
142 {
+
143  _items = items;
+
144  _itemCount = 0;
+
145  if (items) {
+
146  for (;;) {
+
147  ListItem item = (ListItem)pgm_read_word(items);
+
148  if (!item)
+
149  break;
+
150  ++items;
+
151  ++_itemCount;
+
152  }
+
153  }
+
154  if (_value >= _itemCount)
+
155  _value = _itemCount - 1;
+
156  if (isCurrent())
+
157  printValue();
+
158 }
+
159 
+
178 void ListField::setValue(int value)
+
179 {
+
180  if (_value != value) {
+
181  _value = value;
+
182  if (_value < 0)
+
183  _value = 0;
+
184  if (_value >= _itemCount)
+
185  _value = _itemCount - 1;
+
186  if (isCurrent())
+
187  printValue();
+
188  }
+
189 }
+
190 
+
191 void ListField::printValue()
+
192 {
+
193  lcd()->setCursor(0, 1);
+
194  int len = 0;
+
195  if (_value >= 0) {
+
196  ListItem str = (ListItem)pgm_read_word(&(_items[_value]));
+
197  char ch;
+
198  while ((ch = pgm_read_byte(str)) != 0) {
+
199  lcd()->write(ch);
+
200  ++len;
+
201  ++str;
+
202  }
+
203  }
+
204  while (_printLen-- > len)
+
205  lcd()->write(' ');
+
206  _printLen = len;
+
207 }
+
+ + diff --git a/ListField_8h_source.html b/ListField_8h_source.html index 986468fe..749400ce 100644 --- a/ListField_8h_source.html +++ b/ListField_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: ListField.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
ListField.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef ListField_h
-00024 #define ListField_h
-00025 
-00026 #include "Field.h"
-00027 #include <avr/pgmspace.h>
-00028 
-00029 typedef const prog_char *ListItem;
-00030 typedef const PROGMEM ListItem *ListItems;
-00031 
-00032 class ListField : public Field {
-00033 public:
-00034     explicit ListField(const String &label);
-00035     ListField(Form &form, const String &label, ListItems items, int value = 0);
-00036 
-00037     int dispatch(int event);
-00038 
-00039     void enterField(bool reverse);
-00040 
-00041     ListItems items() const { return _items; }
-00042     void setItems(ListItems items);
-00043 
-00044     int value() const { return _value; }
-00045     void setValue(int value);
-00046 
-00047 private:
-00048     ListItems _items;
-00049     int _itemCount;
-00050     int _value;
-00051     int _printLen;
-00052 
-00053     void printValue();
-00054 };
-00055 
-00056 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -132,8 +77,78 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
ListField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef ListField_h
+
24 #define ListField_h
+
25 
+
26 #include "Field.h"
+
27 #include <avr/pgmspace.h>
+
28 
+
29 typedef PGM_P ListItem;
+
30 typedef const PROGMEM ListItem *ListItems;
+
31 
+
32 class ListField : public Field {
+
33 public:
+
34  explicit ListField(const String &label);
+
35  ListField(Form &form, const String &label, ListItems items, int value = 0);
+
36 
+
37  int dispatch(int event);
+
38 
+
39  void enterField(bool reverse);
+
40 
+
41  ListItems items() const { return _items; }
+
42  void setItems(ListItems items);
+
43 
+
44  int value() const { return _value; }
+
45  void setValue(int value);
+
46 
+
47 private:
+
48  ListItems _items;
+
49  int _itemCount;
+
50  int _value;
+
51  int _printLen;
+
52 
+
53  void printValue();
+
54 };
+
55 
+
56 #endif
+
+ + diff --git a/Melody_8cpp_source.html b/Melody_8cpp_source.html index bc768d02..2784b67b 100644 --- a/Melody_8cpp_source.html +++ b/Melody_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Melody.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Melody.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "Melody.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 
-00085 Melody::Melody(uint8_t pin)
-00086     : _pin(pin)
-00087     , playing(false)
-00088     , _loopCount(0)
-00089     , loopsLeft(0)
-00090     , notes(0)
-00091     , lengths(0)
-00092     , size(0)
-00093     , posn(0)
-00094     , duration(0)
-00095     , startNote(0)
-00096 {
-00097 }
-00098 
-00131 void Melody::setLoopDuration(unsigned long ms)
-00132 {
-00133     unsigned long duration = 0;
-00134     for (unsigned int index = 0; index < size; ++index)
-00135         duration += (1000 / lengths[index]) * 13 / 10;
-00136     _loopCount = (int)(ms / duration);
-00137     if (!_loopCount)
-00138         _loopCount = 1;     // Play the melody at least once.
-00139 }
-00140 
-00146 void Melody::play()
-00147 {
-00148     stop();
-00149     if (size == 0)
-00150         return;         // No melody to play.
-00151     loopsLeft = _loopCount;
-00152     posn = 0;
-00153     playing = true;
-00154     nextNote();
-00155 }
-00156 
-00162 void Melody::playOnce()
-00163 {
-00164     stop();
-00165     if (size == 0)
-00166         return;         // No melody to play.
-00167     loopsLeft = 1;
-00168     posn = 0;
-00169     playing = true;
-00170     nextNote();
-00171 }
-00172 
-00178 void Melody::stop()
-00179 {
-00180     if (!playing)
-00181         return;
-00182     playing = false;
-00183     noTone(_pin);
-00184 }
-00185 
-00199 void Melody::setMelody(const int *notes, const uint8_t *lengths, unsigned int size)
-00200 {
-00201     stop();
-00202     this->notes = notes;
-00203     this->lengths = lengths;
-00204     this->size = size;
-00205 }
-00206 
-00214 void Melody::run()
-00215 {
-00216     if (!playing)
-00217         return;
-00218     if ((millis() - startNote) >= duration) {
-00219         noTone(_pin);
-00220         nextNote();
-00221     }
-00222 }
-00223 
-00224 void Melody::nextNote()
-00225 {
-00226     if (posn >= size) {
-00227         if (loopsLeft != 0 && --loopsLeft <= 0) {
-00228             stop();
-00229             return;
-00230         }
-00231         posn = 0;
-00232     }
-00233     duration = 1000 / lengths[posn];
-00234     if (notes[posn] != NOTE_REST)
-00235         tone(_pin, notes[posn], duration);
-00236     ++posn;
-00237     duration = duration * 13 / 10;      // i.e., duration * 1.3
-00238     startNote = millis();
-00239 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -193,8 +77,139 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Melody.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "Melody.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
85 Melody::Melody(uint8_t pin)
+
86  : _pin(pin)
+
87  , playing(false)
+
88  , _loopCount(0)
+
89  , loopsLeft(0)
+
90  , notes(0)
+
91  , lengths(0)
+
92  , size(0)
+
93  , posn(0)
+
94  , duration(0)
+
95  , startNote(0)
+
96 {
+
97 }
+
98 
+
131 void Melody::setLoopDuration(unsigned long ms)
+
132 {
+
133  unsigned long duration = 0;
+
134  for (unsigned int index = 0; index < size; ++index)
+
135  duration += (1000 / lengths[index]) * 13 / 10;
+
136  _loopCount = (int)(ms / duration);
+
137  if (!_loopCount)
+
138  _loopCount = 1; // Play the melody at least once.
+
139 }
+
140 
+ +
147 {
+
148  stop();
+
149  if (size == 0)
+
150  return; // No melody to play.
+
151  loopsLeft = _loopCount;
+
152  posn = 0;
+
153  playing = true;
+
154  nextNote();
+
155 }
+
156 
+ +
163 {
+
164  stop();
+
165  if (size == 0)
+
166  return; // No melody to play.
+
167  loopsLeft = 1;
+
168  posn = 0;
+
169  playing = true;
+
170  nextNote();
+
171 }
+
172 
+ +
179 {
+
180  if (!playing)
+
181  return;
+
182  playing = false;
+
183  noTone(_pin);
+
184 }
+
185 
+
199 void Melody::setMelody(const int *notes, const uint8_t *lengths, unsigned int size)
+
200 {
+
201  stop();
+
202  this->notes = notes;
+
203  this->lengths = lengths;
+
204  this->size = size;
+
205 }
+
206 
+ +
215 {
+
216  if (!playing)
+
217  return;
+
218  if ((millis() - startNote) >= duration) {
+
219  noTone(_pin);
+
220  nextNote();
+
221  }
+
222 }
+
223 
+
224 void Melody::nextNote()
+
225 {
+
226  if (posn >= size) {
+
227  if (loopsLeft != 0 && --loopsLeft <= 0) {
+
228  stop();
+
229  return;
+
230  }
+
231  posn = 0;
+
232  }
+
233  duration = 1000 / lengths[posn];
+
234  if (notes[posn] != NOTE_REST)
+
235  tone(_pin, notes[posn], duration);
+
236  ++posn;
+
237  duration = duration * 13 / 10; // i.e., duration * 1.3
+
238  startNote = millis();
+
239 }
+
+ + diff --git a/Melody_8h_source.html b/Melody_8h_source.html index ee413cce..ecdb817a 100644 --- a/Melody_8h_source.html +++ b/Melody_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Melody.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Melody.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef Melody_h
-00024 #define Melody_h
-00025 
-00026 #include <inttypes.h>
-00027 
-00028 // Note frequencies from http://arduino.cc/en/Tutorial/Tone
-00029 #define NOTE_B0  31
-00030 #define NOTE_C1  33
-00031 #define NOTE_CS1 35
-00032 #define NOTE_D1  37
-00033 #define NOTE_DS1 39
-00034 #define NOTE_E1  41
-00035 #define NOTE_F1  44
-00036 #define NOTE_FS1 46
-00037 #define NOTE_G1  49
-00038 #define NOTE_GS1 52
-00039 #define NOTE_A1  55
-00040 #define NOTE_AS1 58
-00041 #define NOTE_B1  62
-00042 #define NOTE_C2  65
-00043 #define NOTE_CS2 69
-00044 #define NOTE_D2  73
-00045 #define NOTE_DS2 78
-00046 #define NOTE_E2  82
-00047 #define NOTE_F2  87
-00048 #define NOTE_FS2 93
-00049 #define NOTE_G2  98
-00050 #define NOTE_GS2 104
-00051 #define NOTE_A2  110
-00052 #define NOTE_AS2 117
-00053 #define NOTE_B2  123
-00054 #define NOTE_C3  131
-00055 #define NOTE_CS3 139
-00056 #define NOTE_D3  147
-00057 #define NOTE_DS3 156
-00058 #define NOTE_E3  165
-00059 #define NOTE_F3  175
-00060 #define NOTE_FS3 185
-00061 #define NOTE_G3  196
-00062 #define NOTE_GS3 208
-00063 #define NOTE_A3  220
-00064 #define NOTE_AS3 233
-00065 #define NOTE_B3  247
-00066 #define NOTE_C4  262
-00067 #define NOTE_CS4 277
-00068 #define NOTE_D4  294
-00069 #define NOTE_DS4 311
-00070 #define NOTE_E4  330
-00071 #define NOTE_F4  349
-00072 #define NOTE_FS4 370
-00073 #define NOTE_G4  392
-00074 #define NOTE_GS4 415
-00075 #define NOTE_A4  440
-00076 #define NOTE_AS4 466
-00077 #define NOTE_B4  494
-00078 #define NOTE_C5  523
-00079 #define NOTE_CS5 554
-00080 #define NOTE_D5  587
-00081 #define NOTE_DS5 622
-00082 #define NOTE_E5  659
-00083 #define NOTE_F5  698
-00084 #define NOTE_FS5 740
-00085 #define NOTE_G5  784
-00086 #define NOTE_GS5 831
-00087 #define NOTE_A5  880
-00088 #define NOTE_AS5 932
-00089 #define NOTE_B5  988
-00090 #define NOTE_C6  1047
-00091 #define NOTE_CS6 1109
-00092 #define NOTE_D6  1175
-00093 #define NOTE_DS6 1245
-00094 #define NOTE_E6  1319
-00095 #define NOTE_F6  1397
-00096 #define NOTE_FS6 1480
-00097 #define NOTE_G6  1568
-00098 #define NOTE_GS6 1661
-00099 #define NOTE_A6  1760
-00100 #define NOTE_AS6 1865
-00101 #define NOTE_B6  1976
-00102 #define NOTE_C7  2093
-00103 #define NOTE_CS7 2217
-00104 #define NOTE_D7  2349
-00105 #define NOTE_DS7 2489
-00106 #define NOTE_E7  2637
-00107 #define NOTE_F7  2794
-00108 #define NOTE_FS7 2960
-00109 #define NOTE_G7  3136
-00110 #define NOTE_GS7 3322
-00111 #define NOTE_A7  3520
-00112 #define NOTE_AS7 3729
-00113 #define NOTE_B7  3951
-00114 #define NOTE_C8  4186
-00115 #define NOTE_CS8 4435
-00116 #define NOTE_D8  4699
-00117 #define NOTE_DS8 4978
-00118 
-00119 // Special note value that indicates a rest.
-00120 #define NOTE_REST 0
-00121 
-00122 class Melody {
-00123 public:
-00124     Melody(uint8_t pin);
-00125 
-00126     bool isPlaying() const { return playing; }
-00127 
-00128     int loopCount() const { return _loopCount; }
-00129     void setLoopCount(int count) { _loopCount = count; }
-00130 
-00131     void setLoopDuration(unsigned long ms);
-00132 
-00133     void play();
-00134     void playOnce();
-00135     void stop();
-00136 
-00137     void setMelody(const int *notes, const uint8_t *lengths, unsigned int size);
-00138 
-00139     void run();
-00140 
-00141 private:
-00142     uint8_t _pin;
-00143     bool playing;
-00144     int _loopCount;
-00145     int loopsLeft;
-00146     const int *notes;
-00147     const uint8_t *lengths;
-00148     unsigned int size;
-00149     unsigned int posn;
-00150     unsigned long duration;
-00151     unsigned long startNote;
-00152 
-00153     void nextNote();
-00154 };
-00155 
-00156 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -232,8 +77,178 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Melody.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef Melody_h
+
24 #define Melody_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 // Note frequencies from http://arduino.cc/en/Tutorial/Tone
+
29 #define NOTE_B0 31
+
30 #define NOTE_C1 33
+
31 #define NOTE_CS1 35
+
32 #define NOTE_D1 37
+
33 #define NOTE_DS1 39
+
34 #define NOTE_E1 41
+
35 #define NOTE_F1 44
+
36 #define NOTE_FS1 46
+
37 #define NOTE_G1 49
+
38 #define NOTE_GS1 52
+
39 #define NOTE_A1 55
+
40 #define NOTE_AS1 58
+
41 #define NOTE_B1 62
+
42 #define NOTE_C2 65
+
43 #define NOTE_CS2 69
+
44 #define NOTE_D2 73
+
45 #define NOTE_DS2 78
+
46 #define NOTE_E2 82
+
47 #define NOTE_F2 87
+
48 #define NOTE_FS2 93
+
49 #define NOTE_G2 98
+
50 #define NOTE_GS2 104
+
51 #define NOTE_A2 110
+
52 #define NOTE_AS2 117
+
53 #define NOTE_B2 123
+
54 #define NOTE_C3 131
+
55 #define NOTE_CS3 139
+
56 #define NOTE_D3 147
+
57 #define NOTE_DS3 156
+
58 #define NOTE_E3 165
+
59 #define NOTE_F3 175
+
60 #define NOTE_FS3 185
+
61 #define NOTE_G3 196
+
62 #define NOTE_GS3 208
+
63 #define NOTE_A3 220
+
64 #define NOTE_AS3 233
+
65 #define NOTE_B3 247
+
66 #define NOTE_C4 262
+
67 #define NOTE_CS4 277
+
68 #define NOTE_D4 294
+
69 #define NOTE_DS4 311
+
70 #define NOTE_E4 330
+
71 #define NOTE_F4 349
+
72 #define NOTE_FS4 370
+
73 #define NOTE_G4 392
+
74 #define NOTE_GS4 415
+
75 #define NOTE_A4 440
+
76 #define NOTE_AS4 466
+
77 #define NOTE_B4 494
+
78 #define NOTE_C5 523
+
79 #define NOTE_CS5 554
+
80 #define NOTE_D5 587
+
81 #define NOTE_DS5 622
+
82 #define NOTE_E5 659
+
83 #define NOTE_F5 698
+
84 #define NOTE_FS5 740
+
85 #define NOTE_G5 784
+
86 #define NOTE_GS5 831
+
87 #define NOTE_A5 880
+
88 #define NOTE_AS5 932
+
89 #define NOTE_B5 988
+
90 #define NOTE_C6 1047
+
91 #define NOTE_CS6 1109
+
92 #define NOTE_D6 1175
+
93 #define NOTE_DS6 1245
+
94 #define NOTE_E6 1319
+
95 #define NOTE_F6 1397
+
96 #define NOTE_FS6 1480
+
97 #define NOTE_G6 1568
+
98 #define NOTE_GS6 1661
+
99 #define NOTE_A6 1760
+
100 #define NOTE_AS6 1865
+
101 #define NOTE_B6 1976
+
102 #define NOTE_C7 2093
+
103 #define NOTE_CS7 2217
+
104 #define NOTE_D7 2349
+
105 #define NOTE_DS7 2489
+
106 #define NOTE_E7 2637
+
107 #define NOTE_F7 2794
+
108 #define NOTE_FS7 2960
+
109 #define NOTE_G7 3136
+
110 #define NOTE_GS7 3322
+
111 #define NOTE_A7 3520
+
112 #define NOTE_AS7 3729
+
113 #define NOTE_B7 3951
+
114 #define NOTE_C8 4186
+
115 #define NOTE_CS8 4435
+
116 #define NOTE_D8 4699
+
117 #define NOTE_DS8 4978
+
118 
+
119 // Special note value that indicates a rest.
+
120 #define NOTE_REST 0
+
121 
+
122 class Melody {
+
123 public:
+
124  Melody(uint8_t pin);
+
125 
+
126  bool isPlaying() const { return playing; }
+
127 
+
128  int loopCount() const { return _loopCount; }
+
129  void setLoopCount(int count) { _loopCount = count; }
+
130 
+
131  void setLoopDuration(unsigned long ms);
+
132 
+
133  void play();
+
134  void playOnce();
+
135  void stop();
+
136 
+
137  void setMelody(const int *notes, const uint8_t *lengths, unsigned int size);
+
138 
+
139  void run();
+
140 
+
141 private:
+
142  uint8_t _pin;
+
143  bool playing;
+
144  int _loopCount;
+
145  int loopsLeft;
+
146  const int *notes;
+
147  const uint8_t *lengths;
+
148  unsigned int size;
+
149  unsigned int posn;
+
150  unsigned long duration;
+
151  unsigned long startNote;
+
152 
+
153  void nextNote();
+
154 };
+
155 
+
156 #endif
+
+ + diff --git a/Mono5x7_8h_source.html b/Mono5x7_8h_source.html index fa41be27..3f7f4472 100644 --- a/Mono5x7_8h_source.html +++ b/Mono5x7_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: Mono5x7.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
Mono5x7.h
-
-
-
00001 
-00002 
-00003 /*
-00004  *
-00005  * Mono5x7
-00006  *
-00007  * created with FontCreator
-00008  * written by F. Maximilian Thiele
-00009  *
-00010  * http://www.apetech.de/fontCreator
-00011  * me@apetech.de
-00012  *
-00013  * File Name           : Mono5x7.h
-00014  * Date                : 29.05.2012
-00015  * Font size in bytes  : 3462
-00016  * Font width          : 5
-00017  * Font height         : 7
-00018  * Font first char     : 32
-00019  * Font last char      : 128
-00020  * Font used chars     : 96
-00021  *
-00022  * The font data are defined as
-00023  *
-00024  * struct _FONT_ {
-00025  *     uint16_t   font_Size_in_Bytes_over_all_included_Size_it_self;
-00026  *     uint8_t    font_Width_in_Pixel_for_fixed_drawing;
-00027  *     uint8_t    font_Height_in_Pixel_for_all_characters;
-00028  *     unit8_t    font_First_Char;
-00029  *     uint8_t    font_Char_Count;
-00030  *
-00031  *     uint8_t    font_Char_Widths[font_Last_Char - font_First_Char +1];
-00032  *                  // for each character the separate width in pixels,
-00033  *                  // characters < 128 have an implicit virtual right empty row
-00034  *
-00035  *     uint8_t    font_data[];
-00036  *                  // bit field of all characters
-00037  */
-00038 
-00039 #include <inttypes.h>
-00040 #include <avr/pgmspace.h>
-00041 
-00042 #ifndef MONO5X7_H
-00043 #define MONO5X7_H
-00044 
-00045 #define MONO5X7_WIDTH 5
-00046 #define MONO5X7_HEIGHT 7
-00047 
-00048 static uint8_t Mono5x7[] PROGMEM = {
-00049     0x00, 0x00, // size
-00050     0x05, // width
-00051     0x07, // height
-00052     0x20, // first char
-00053     0x60, // char count
-00054     
-00055     // font data
-00056     0x00, 0x00, 0x00, 0x00, 0x00, // 32
-00057     0x00, 0x00, 0x5F, 0x00, 0x00, // 33
-00058     0x00, 0x07, 0x00, 0x07, 0x00, // 34
-00059     0x14, 0x7F, 0x14, 0x7F, 0x14, // 35
-00060     0x24, 0x2A, 0x7F, 0x2A, 0x12, // 36
-00061     0x23, 0x13, 0x08, 0x64, 0x62, // 37
-00062     0x36, 0x49, 0x55, 0x22, 0x50, // 38
-00063     0x00, 0x05, 0x03, 0x00, 0x00, // 39
-00064     0x00, 0x1C, 0x22, 0x41, 0x00, // 40
-00065     0x00, 0x41, 0x22, 0x1C, 0x00, // 41
-00066     0x14, 0x08, 0x3E, 0x08, 0x14, // 42
-00067     0x08, 0x08, 0x3E, 0x08, 0x08, // 43
-00068     0x00, 0x50, 0x30, 0x00, 0x00, // 44
-00069     0x08, 0x08, 0x08, 0x08, 0x08, // 45
-00070     0x00, 0x60, 0x60, 0x00, 0x00, // 46
-00071     0x20, 0x10, 0x08, 0x04, 0x02, // 47
-00072     0x3E, 0x51, 0x49, 0x45, 0x3E, // 48
-00073     0x00, 0x42, 0x7F, 0x40, 0x00, // 49
-00074     0x42, 0x61, 0x51, 0x49, 0x46, // 50
-00075     0x21, 0x41, 0x45, 0x4B, 0x31, // 51
-00076     0x18, 0x14, 0x12, 0x7F, 0x10, // 52
-00077     0x27, 0x45, 0x45, 0x45, 0x39, // 53
-00078     0x3C, 0x4A, 0x49, 0x49, 0x30, // 54
-00079     0x01, 0x71, 0x09, 0x05, 0x03, // 55
-00080     0x36, 0x49, 0x49, 0x49, 0x36, // 56
-00081     0x06, 0x49, 0x49, 0x29, 0x1E, // 57
-00082     0x00, 0x36, 0x36, 0x00, 0x00, // 58
-00083     0x00, 0x56, 0x36, 0x00, 0x00, // 59
-00084     0x08, 0x14, 0x22, 0x41, 0x00, // 60
-00085     0x14, 0x14, 0x14, 0x14, 0x14, // 61
-00086     0x00, 0x41, 0x22, 0x14, 0x08, // 62
-00087     0x02, 0x01, 0x51, 0x09, 0x06, // 63
-00088     0x32, 0x49, 0x79, 0x41, 0x3E, // 64
-00089     0x7E, 0x11, 0x11, 0x11, 0x7E, // 65
-00090     0x7F, 0x49, 0x49, 0x49, 0x36, // 66
-00091     0x3E, 0x41, 0x41, 0x41, 0x22, // 67
-00092     0x7F, 0x41, 0x41, 0x22, 0x1C, // 68
-00093     0x7F, 0x49, 0x49, 0x49, 0x41, // 69
-00094     0x7F, 0x09, 0x09, 0x09, 0x01, // 70
-00095     0x3E, 0x41, 0x49, 0x49, 0x78, // 71
-00096     0x7F, 0x08, 0x08, 0x08, 0x7F, // 72
-00097     0x00, 0x41, 0x7F, 0x41, 0x00, // 73
-00098     0x20, 0x40, 0x41, 0x3F, 0x01, // 74
-00099     0x7F, 0x08, 0x14, 0x22, 0x41, // 75
-00100     0x7F, 0x40, 0x40, 0x40, 0x40, // 76
-00101     0x7F, 0x02, 0x0C, 0x02, 0x7F, // 77
-00102     0x7F, 0x04, 0x08, 0x10, 0x7F, // 78
-00103     0x3E, 0x41, 0x41, 0x41, 0x3E, // 79
-00104     0x7F, 0x09, 0x09, 0x09, 0x06, // 80
-00105     0x3E, 0x41, 0x51, 0x21, 0x5E, // 81
-00106     0x7F, 0x09, 0x19, 0x29, 0x46, // 82
-00107     0x46, 0x49, 0x49, 0x49, 0x31, // 83
-00108     0x01, 0x01, 0x7F, 0x01, 0x01, // 84
-00109     0x3F, 0x40, 0x40, 0x40, 0x3F, // 85
-00110     0x1F, 0x20, 0x40, 0x20, 0x1F, // 86
-00111     0x3F, 0x40, 0x38, 0x40, 0x3F, // 87
-00112     0x63, 0x14, 0x08, 0x14, 0x63, // 88
-00113     0x07, 0x08, 0x70, 0x08, 0x07, // 89
-00114     0x61, 0x51, 0x49, 0x45, 0x43, // 90
-00115     0x00, 0x7F, 0x41, 0x41, 0x00, // 91
-00116     0x02, 0x04, 0x08, 0x10, 0x20, // 92
-00117     0x00, 0x41, 0x41, 0x7F, 0x00, // 93
-00118     0x04, 0x02, 0x01, 0x02, 0x04, // 94
-00119     0x40, 0x40, 0x40, 0x40, 0x40, // 95
-00120     0x00, 0x02, 0x04, 0x08, 0x00, // 96
-00121     0x20, 0x54, 0x54, 0x54, 0x78, // 97
-00122     0x7F, 0x48, 0x44, 0x44, 0x38, // 98
-00123     0x38, 0x44, 0x44, 0x44, 0x20, // 99
-00124     0x38, 0x44, 0x44, 0x48, 0x7F, // 100
-00125     0x38, 0x54, 0x54, 0x54, 0x18, // 101
-00126     0x08, 0x7E, 0x09, 0x01, 0x02, // 102
-00127     0x0C, 0x52, 0x52, 0x52, 0x3E, // 103
-00128     0x7F, 0x08, 0x04, 0x04, 0x78, // 104
-00129     0x00, 0x44, 0x7D, 0x40, 0x00, // 105
-00130     0x20, 0x40, 0x44, 0x3D, 0x00, // 106
-00131     0x7F, 0x10, 0x28, 0x44, 0x00, // 107
-00132     0x00, 0x41, 0x7F, 0x40, 0x00, // 108
-00133     0x7C, 0x04, 0x18, 0x04, 0x78, // 109
-00134     0x7C, 0x08, 0x04, 0x04, 0x78, // 110
-00135     0x38, 0x44, 0x44, 0x44, 0x38, // 111
-00136     0x7C, 0x14, 0x14, 0x14, 0x08, // 112
-00137     0x08, 0x14, 0x14, 0x18, 0x7C, // 113
-00138     0x7C, 0x08, 0x04, 0x04, 0x08, // 114
-00139     0x48, 0x54, 0x54, 0x54, 0x20, // 115
-00140     0x04, 0x3F, 0x44, 0x40, 0x00, // 116
-00141     0x3C, 0x40, 0x40, 0x20, 0x7C, // 117
-00142     0x1C, 0x20, 0x40, 0x20, 0x1C, // 118
-00143     0x3C, 0x40, 0x30, 0x40, 0x3C, // 119
-00144     0x44, 0x28, 0x10, 0x28, 0x44, // 120
-00145     0x0C, 0x50, 0x50, 0x50, 0x3C, // 121
-00146     0x44, 0x64, 0x54, 0x4C, 0x44, // 122
-00147     0x00, 0x08, 0x36, 0x41, 0x00, // 123
-00148     0x00, 0x00, 0x7F, 0x00, 0x00, // 124
-00149     0x00, 0x41, 0x36, 0x08, 0x00, // 125
-00150     0x08, 0x04, 0x08, 0x10, 0x08, // 126
-00151     0x00, 0x00, 0x00, 0x00, 0x00 // 127
-00152     
-00153 };
-00154 
-00155 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -231,8 +77,177 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
Mono5x7.h
+
+
+
1 
+
2 
+
3 /*
+
4  *
+
5  * Mono5x7
+
6  *
+
7  * created with FontCreator
+
8  * written by F. Maximilian Thiele
+
9  *
+
10  * http://www.apetech.de/fontCreator
+
11  * me@apetech.de
+
12  *
+
13  * File Name : Mono5x7.h
+
14  * Date : 29.05.2012
+
15  * Font size in bytes : 3462
+
16  * Font width : 5
+
17  * Font height : 7
+
18  * Font first char : 32
+
19  * Font last char : 128
+
20  * Font used chars : 96
+
21  *
+
22  * The font data are defined as
+
23  *
+
24  * struct _FONT_ {
+
25  * uint16_t font_Size_in_Bytes_over_all_included_Size_it_self;
+
26  * uint8_t font_Width_in_Pixel_for_fixed_drawing;
+
27  * uint8_t font_Height_in_Pixel_for_all_characters;
+
28  * unit8_t font_First_Char;
+
29  * uint8_t font_Char_Count;
+
30  *
+
31  * uint8_t font_Char_Widths[font_Last_Char - font_First_Char +1];
+
32  * // for each character the separate width in pixels,
+
33  * // characters < 128 have an implicit virtual right empty row
+
34  *
+
35  * uint8_t font_data[];
+
36  * // bit field of all characters
+
37  */
+
38 
+
39 #include <inttypes.h>
+
40 #include <avr/pgmspace.h>
+
41 
+
42 #ifndef MONO5X7_H
+
43 #define MONO5X7_H
+
44 
+
45 #define MONO5X7_WIDTH 5
+
46 #define MONO5X7_HEIGHT 7
+
47 
+
48 static uint8_t const Mono5x7[] PROGMEM = {
+
49  0x00, 0x00, // size
+
50  0x05, // width
+
51  0x07, // height
+
52  0x20, // first char
+
53  0x60, // char count
+
54 
+
55  // font data
+
56  0x00, 0x00, 0x00, 0x00, 0x00, // 32
+
57  0x00, 0x00, 0x5F, 0x00, 0x00, // 33
+
58  0x00, 0x07, 0x00, 0x07, 0x00, // 34
+
59  0x14, 0x7F, 0x14, 0x7F, 0x14, // 35
+
60  0x24, 0x2A, 0x7F, 0x2A, 0x12, // 36
+
61  0x23, 0x13, 0x08, 0x64, 0x62, // 37
+
62  0x36, 0x49, 0x55, 0x22, 0x50, // 38
+
63  0x00, 0x05, 0x03, 0x00, 0x00, // 39
+
64  0x00, 0x1C, 0x22, 0x41, 0x00, // 40
+
65  0x00, 0x41, 0x22, 0x1C, 0x00, // 41
+
66  0x14, 0x08, 0x3E, 0x08, 0x14, // 42
+
67  0x08, 0x08, 0x3E, 0x08, 0x08, // 43
+
68  0x00, 0x50, 0x30, 0x00, 0x00, // 44
+
69  0x08, 0x08, 0x08, 0x08, 0x08, // 45
+
70  0x00, 0x60, 0x60, 0x00, 0x00, // 46
+
71  0x20, 0x10, 0x08, 0x04, 0x02, // 47
+
72  0x3E, 0x51, 0x49, 0x45, 0x3E, // 48
+
73  0x00, 0x42, 0x7F, 0x40, 0x00, // 49
+
74  0x42, 0x61, 0x51, 0x49, 0x46, // 50
+
75  0x21, 0x41, 0x45, 0x4B, 0x31, // 51
+
76  0x18, 0x14, 0x12, 0x7F, 0x10, // 52
+
77  0x27, 0x45, 0x45, 0x45, 0x39, // 53
+
78  0x3C, 0x4A, 0x49, 0x49, 0x30, // 54
+
79  0x01, 0x71, 0x09, 0x05, 0x03, // 55
+
80  0x36, 0x49, 0x49, 0x49, 0x36, // 56
+
81  0x06, 0x49, 0x49, 0x29, 0x1E, // 57
+
82  0x00, 0x36, 0x36, 0x00, 0x00, // 58
+
83  0x00, 0x56, 0x36, 0x00, 0x00, // 59
+
84  0x08, 0x14, 0x22, 0x41, 0x00, // 60
+
85  0x14, 0x14, 0x14, 0x14, 0x14, // 61
+
86  0x00, 0x41, 0x22, 0x14, 0x08, // 62
+
87  0x02, 0x01, 0x51, 0x09, 0x06, // 63
+
88  0x32, 0x49, 0x79, 0x41, 0x3E, // 64
+
89  0x7E, 0x11, 0x11, 0x11, 0x7E, // 65
+
90  0x7F, 0x49, 0x49, 0x49, 0x36, // 66
+
91  0x3E, 0x41, 0x41, 0x41, 0x22, // 67
+
92  0x7F, 0x41, 0x41, 0x22, 0x1C, // 68
+
93  0x7F, 0x49, 0x49, 0x49, 0x41, // 69
+
94  0x7F, 0x09, 0x09, 0x09, 0x01, // 70
+
95  0x3E, 0x41, 0x49, 0x49, 0x78, // 71
+
96  0x7F, 0x08, 0x08, 0x08, 0x7F, // 72
+
97  0x00, 0x41, 0x7F, 0x41, 0x00, // 73
+
98  0x20, 0x40, 0x41, 0x3F, 0x01, // 74
+
99  0x7F, 0x08, 0x14, 0x22, 0x41, // 75
+
100  0x7F, 0x40, 0x40, 0x40, 0x40, // 76
+
101  0x7F, 0x02, 0x0C, 0x02, 0x7F, // 77
+
102  0x7F, 0x04, 0x08, 0x10, 0x7F, // 78
+
103  0x3E, 0x41, 0x41, 0x41, 0x3E, // 79
+
104  0x7F, 0x09, 0x09, 0x09, 0x06, // 80
+
105  0x3E, 0x41, 0x51, 0x21, 0x5E, // 81
+
106  0x7F, 0x09, 0x19, 0x29, 0x46, // 82
+
107  0x46, 0x49, 0x49, 0x49, 0x31, // 83
+
108  0x01, 0x01, 0x7F, 0x01, 0x01, // 84
+
109  0x3F, 0x40, 0x40, 0x40, 0x3F, // 85
+
110  0x1F, 0x20, 0x40, 0x20, 0x1F, // 86
+
111  0x3F, 0x40, 0x38, 0x40, 0x3F, // 87
+
112  0x63, 0x14, 0x08, 0x14, 0x63, // 88
+
113  0x07, 0x08, 0x70, 0x08, 0x07, // 89
+
114  0x61, 0x51, 0x49, 0x45, 0x43, // 90
+
115  0x00, 0x7F, 0x41, 0x41, 0x00, // 91
+
116  0x02, 0x04, 0x08, 0x10, 0x20, // 92
+
117  0x00, 0x41, 0x41, 0x7F, 0x00, // 93
+
118  0x04, 0x02, 0x01, 0x02, 0x04, // 94
+
119  0x40, 0x40, 0x40, 0x40, 0x40, // 95
+
120  0x00, 0x02, 0x04, 0x08, 0x00, // 96
+
121  0x20, 0x54, 0x54, 0x54, 0x78, // 97
+
122  0x7F, 0x48, 0x44, 0x44, 0x38, // 98
+
123  0x38, 0x44, 0x44, 0x44, 0x20, // 99
+
124  0x38, 0x44, 0x44, 0x48, 0x7F, // 100
+
125  0x38, 0x54, 0x54, 0x54, 0x18, // 101
+
126  0x08, 0x7E, 0x09, 0x01, 0x02, // 102
+
127  0x0C, 0x52, 0x52, 0x52, 0x3E, // 103
+
128  0x7F, 0x08, 0x04, 0x04, 0x78, // 104
+
129  0x00, 0x44, 0x7D, 0x40, 0x00, // 105
+
130  0x20, 0x40, 0x44, 0x3D, 0x00, // 106
+
131  0x7F, 0x10, 0x28, 0x44, 0x00, // 107
+
132  0x00, 0x41, 0x7F, 0x40, 0x00, // 108
+
133  0x7C, 0x04, 0x18, 0x04, 0x78, // 109
+
134  0x7C, 0x08, 0x04, 0x04, 0x78, // 110
+
135  0x38, 0x44, 0x44, 0x44, 0x38, // 111
+
136  0x7C, 0x14, 0x14, 0x14, 0x08, // 112
+
137  0x08, 0x14, 0x14, 0x18, 0x7C, // 113
+
138  0x7C, 0x08, 0x04, 0x04, 0x08, // 114
+
139  0x48, 0x54, 0x54, 0x54, 0x20, // 115
+
140  0x04, 0x3F, 0x44, 0x40, 0x00, // 116
+
141  0x3C, 0x40, 0x40, 0x20, 0x7C, // 117
+
142  0x1C, 0x20, 0x40, 0x20, 0x1C, // 118
+
143  0x3C, 0x40, 0x30, 0x40, 0x3C, // 119
+
144  0x44, 0x28, 0x10, 0x28, 0x44, // 120
+
145  0x0C, 0x50, 0x50, 0x50, 0x3C, // 121
+
146  0x44, 0x64, 0x54, 0x4C, 0x44, // 122
+
147  0x00, 0x08, 0x36, 0x41, 0x00, // 123
+
148  0x00, 0x00, 0x7F, 0x00, 0x00, // 124
+
149  0x00, 0x41, 0x36, 0x08, 0x00, // 125
+
150  0x08, 0x04, 0x08, 0x10, 0x08, // 126
+
151  0x00, 0x00, 0x00, 0x00, 0x00 // 127
+
152 
+
153 };
+
154 
+
155 #endif
+
+ + diff --git a/PowerSave_8cpp_source.html b/PowerSave_8cpp_source.html index ebb44c10..9f32365f 100644 --- a/PowerSave_8cpp_source.html +++ b/PowerSave_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: PowerSave.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
PowerSave.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "PowerSave.h"
-00024 #include <avr/wdt.h>
-00025 #include <avr/sleep.h>
-00026 #include <avr/power.h>
-00027 #include <avr/interrupt.h>
-00028 
-00036 /*\@{*/
-00037 
-00048 ISR(WDT_vect)
-00049 {
-00050     wdt_disable();
-00051 }
-00132 void sleepFor(SleepDuration duration, uint8_t mode)
-00133 {
-00134     // Turn off the analog to digital converter.
-00135     ADCSRA &= ~(1 << ADEN);
-00136     power_adc_disable();
-00137 
-00138     // Turn on the watchdog timer for the desired duration.
-00139     wdt_enable(duration);
-00140     WDTCSR |= (1 << WDIE);
-00141 
-00142     // Put the device to sleep, including turning off the Brown Out Detector.
-00143     set_sleep_mode(mode);
-00144     cli();
-00145     sleep_enable();
-00146 #if defined(sleep_bod_disable)
-00147     sleep_bod_disable();
-00148 #endif
-00149     sei();
-00150     sleep_cpu();
-00151     sleep_disable();
-00152     sei();
-00153 
-00154     // Turn the analog to digital converter back on.
-00155     power_adc_enable();
-00156     ADCSRA |= (1 << ADEN);
-00157 }
-00158 
-00159 /*\@}*/
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -138,8 +77,84 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
PowerSave.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "PowerSave.h"
+
24 #include <avr/wdt.h>
+
25 #include <avr/sleep.h>
+
26 #include <avr/power.h>
+
27 #include <avr/interrupt.h>
+
28 
+
36 /*\@{*/
+
37 
+
48 ISR(WDT_vect)
+
49 {
+
50  wdt_disable();
+
51 }
+
132 void sleepFor(SleepDuration duration, uint8_t mode)
+
133 {
+
134  // Turn off the analog to digital converter.
+
135  ADCSRA &= ~(1 << ADEN);
+
136  power_adc_disable();
+
137 
+
138  // Turn on the watchdog timer for the desired duration.
+
139  wdt_enable(duration);
+
140  WDTCSR |= (1 << WDIE);
+
141 
+
142  // Put the device to sleep, including turning off the Brown Out Detector.
+
143  set_sleep_mode(mode);
+
144  cli();
+
145  sleep_enable();
+
146 #if defined(sleep_bod_disable)
+
147  sleep_bod_disable();
+
148 #endif
+
149  sei();
+
150  sleep_cpu();
+
151  sleep_disable();
+
152  sei();
+
153 
+
154  // Turn the analog to digital converter back on.
+
155  power_adc_enable();
+
156  ADCSRA |= (1 << ADEN);
+
157 }
+
158 
+
159 /*\@}*/
+
+ + diff --git a/PowerSave_8h_source.html b/PowerSave_8h_source.html index 2e3b245b..97a8c5ec 100644 --- a/PowerSave_8h_source.html +++ b/PowerSave_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: PowerSave.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
PowerSave.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef PowerSave_h
-00024 #define PowerSave_h
-00025 
-00026 #if defined(ARDUINO) && ARDUINO >= 100
-00027 #include <Arduino.h>
-00028 #else
-00029 #include <WProgram.h>
-00030 #endif
-00031 
-00032 inline void unusedPin(uint8_t pin)
-00033 {
-00034     pinMode(pin, INPUT);
-00035     digitalWrite(pin, HIGH);
-00036 }
-00037 
-00038 enum SleepDuration
-00039 {
-00040     SLEEP_15_MS,
-00041     SLEEP_30_MS,
-00042     SLEEP_60_MS,
-00043     SLEEP_120_MS,
-00044     SLEEP_250_MS,
-00045     SLEEP_500_MS,
-00046     SLEEP_1_SEC,
-00047     SLEEP_2_SEC,
-00048     SLEEP_4_SEC,
-00049     SLEEP_8_SEC
-00050 };
-00051 
-00052 void sleepFor(SleepDuration duration, uint8_t mode = 0);
-00053 
-00054 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -130,8 +77,76 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
PowerSave.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef PowerSave_h
+
24 #define PowerSave_h
+
25 
+
26 #if defined(ARDUINO) && ARDUINO >= 100
+
27 #include <Arduino.h>
+
28 #else
+
29 #include <WProgram.h>
+
30 #endif
+
31 
+
32 inline void unusedPin(uint8_t pin)
+
33 {
+
34  pinMode(pin, INPUT);
+
35  digitalWrite(pin, HIGH);
+
36 }
+
37 
+ +
39 {
+ + + + + + + + + + +
50 };
+
51 
+
52 void sleepFor(SleepDuration duration, uint8_t mode = 0);
+
53 
+
54 #endif
+
+ + diff --git a/RC5_8h_source.html b/RC5_8h_source.html index e0b6207e..09989393 100644 --- a/RC5_8h_source.html +++ b/RC5_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: RC5.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
RC5.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef RC5_h
-00024 #define RC5_h
-00025 
-00026 // http://en.wikipedia.org/wiki/RC-5#System_Number_Allocations
-00027 #define RC5_SYS_TV              0   // TV receiver 1
-00028 #define RC5_SYS_TV2             1   // TV receiver 2
-00029 #define RC5_SYS_TXT             2   // Teletext
-00030 #define RC5_SYS_TV_EXT          3   // Extension to TV 1 & 2
-00031 #define RC5_SYS_LV              4   // Laservision player
-00032 #define RC5_SYS_VCR             5   // VCR 1
-00033 #define RC5_SYS_VCR2            6   // VCR 2
-00034 #define RC5_SYS_SAT             8   // Satellite receiver 1
-00035 #define RC5_SYS_VCR_EXT         9   // Extension to VCR 1 & 2
-00036 #define RC5_SYS_SAT2            10  // Satellite receiver 2
-00037 #define RC5_SYS_CD_VIDEO        12  // CD video player
-00038 #define RC5_SYS_CD_PHOTO        14  // CD photo player
-00039 #define RC5_SYS_PREAMP          16  // Audio preamplifier 1
-00040 #define RC5_SYS_RADIO           17  // Radio tuner
-00041 #define RC5_SYS_REC             18  // Casette recorder 1
-00042 #define RC5_SYS_PREAMP2         19  // Audio preamplifier 2
-00043 #define RC5_SYS_CD              20  // CD player
-00044 #define RC5_SYS_COMBI           21  // Audio stack or record player
-00045 #define RC5_SYS_AUDIO_SAT       22  // Audio satellite
-00046 #define RC5_SYS_REC2            23  // Casette recorder 2
-00047 #define RC5_SYS_CD_R            26  // CD recorder
-00048 
-00049 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00050 // Table 2, Common commands:
-00051 #define RC5_0                   0   // Digit 0
-00052 #define RC5_1                   1   // Digit 1
-00053 #define RC5_2                   2   // Digit 2
-00054 #define RC5_3                   3   // Digit 3
-00055 #define RC5_4                   4   // Digit 4
-00056 #define RC5_5                   5   // Digit 5
-00057 #define RC5_6                   6   // Digit 6
-00058 #define RC5_7                   7   // Digit 7
-00059 #define RC5_8                   8   // Digit 8
-00060 #define RC5_9                   9   // Digit 9
-00061 #define RC5_INC_VOLUME          16  // Increase sound volume
-00062 #define RC5_DEC_VOLUME          17  // Decrease sound volume
-00063 #define RC5_INC_BRIGHTNESS      18  // Increase display brightness
-00064 #define RC5_DEC_BRIGHTNESS      19  // Decrease display brightness
-00065 #define RC5_INC_BASS            22  // Increase bass response
-00066 #define RC5_DEC_BASS            23  // Decrease bass response
-00067 #define RC5_INC_TREBLE          24  // Increase treble response
-00068 #define RC5_DEC_TREBLE          25  // Decrease treble response
-00069 #define RC5_BALANCE_LEFT        26  // Shift sound balance to left
-00070 #define RC5_BALANCE_RIGHT       27  // Shift sound balance to right
-00071 #define RC5_TRANSMIT_MODE       63  // Select remote transmit mode
-00072 #define RC5_DIM                 71  // Dim local display
-00073 #define RC5_INC_LINEAR          77  // Increase linear control
-00074 #define RC5_DEC_LINEAR          78  // Decrease linear control
-00075 #define RC5_UP                  80  // Move cursor up
-00076 #define RC5_DOWN                81  // Move cursor down
-00077 #define RC5_MENU_ON             82  // Switch display/screen menu on
-00078 #define RC5_MENU_OFF            83  // Switch display/screen menu off
-00079 #define RC5_AV_STATUS           84  // Display A/V system status
-00080 #define RC5_LEFT                85  // Move cursor left
-00081 #define RC5_RIGHT               86  // Move cursor right
-00082 #define RC5_OK                  87  // Acknowledge function at cursor
-00083 #define RC5_SUBMODE             118 // Select sub-mode
-00084 #define RC5_OPTIONS             119 // Select options sub-mode
-00085 #define RC5_CONNECT_EURO        123 // Connect items via Euroconnector
-00086 #define RC5_DISCONNECT_EURO     124 // Disconnect items via Euroconnector
-00087 
-00088 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00089 // Table 3, Common video system commands:
-00090 #define RC5_INC_SATURATION      20  // Increase color saturation
-00091 #define RC5_DEC_SATURATION      21  // Decrease color saturation
-00092 #define RC5_PIP                 88  // Picture-in-picture on/off
-00093 #define RC5_PIP_SHIFT           89  // Picture-in-picture shift
-00094 #define RC5_PIP_SWAP            90  // Picture-in-picture swap
-00095 #define RC5_PIP_STROBE          91  // Strobe main picture on/off
-00096 #define RC5_PIP_MULTI_STROBE    92  // Multi-strobe
-00097 #define RC5_PIP_FREEZE_MAIN     93  // Main picture frame frozen
-00098 #define RC5_PIP_MULTI_SCAN      94  // 3/9 multi-scan
-00099 #define RC5_PIP_SOURCE          95  // Select picture-in-picture source
-00100 #define RC5_PIP_MOSAIC          96  // Mosaic/multi-PIP
-00101 #define RC5_PIP_NOISE           97  // Digital noise reduction of picture
-00102 #define RC5_PIP_STORE           98  // Store main picture
-00103 #define RC5_PIP_PHOTO_FINISH    99  // PIP strobe; display photo-finish
-00104 #define RC5_PIP_RECALL          100 // Recall main stored picture
-00105 #define RC5_PIP_FREEZE          101 // Freeze PIP
-00106 #define RC5_PIP_UP              102 // Step up PIP options/source
-00107 #define RC5_PIP_DOWN            103 // Step down PIP options/source
-00108 
-00109 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00110 // Table 4a, TV and VCR commands:
-00111 #define RC5_123                 10  // 1/2/3 digit entry
-00112 #define RC5_11                  11  // Channel/program/frequency 11
-00113 #define RC5_STANDBY             12  // Standby
-00114 #define RC5_MUTE                13  // Master mute/de-mute
-00115 #define RC5_PREFERENCES         14  // Personal preference settings
-00116 #define RC5_DISPLAY_INFO        15  // Display user info on screen
-00117 #define RC5_INC_CONTRAST        28  // Increase picture contrast
-00118 #define RC5_DEC_CONTRAST        29  // Decrease picture contrast
-00119 #define RC5_SEARCH_UP           30  // Search up
-00120 #define RC5_DEC_TINT            31  // Decrease tint/hue
-00121 #define RC5_CHANNEL_UP          32  // Channel/program up
-00122 #define RC5_CHANNEL_DOWN        33  // Channel/program down
-00123 #define RC5_CHANNEL_LAST        34  // Last viewed channel/program
-00124 #define RC5_STEREO_SELECT       35  // Select stereo channel/language
-00125 #define RC5_STEREO_SPATIAL      36  // Spatial stereo
-00126 #define RC5_STEREO_TOGGLE       37  // Toggle stereo/mono
-00127 #define RC5_SLEEP_TIMER         38  // Sleep timer
-00128 #define RC5_INC_TINT            39  // Increase tint/hue
-00129 #define RC5_SWITCH_RF           40  // Switch RF inputs
-00130 #define RC5_STORE               41  // Store/vote
-00131 #define RC5_TIME                42  // Display time
-00132 #define RC5_INC_SCAN            43  // Scan forward/increment
-00133 #define RC5_DEC_SCAN            44  // Scan backward/decrement
-00134 #define RC5_SECONDARY_MENU      46  // Secondary menu
-00135 #define RC5_CLOCK               47  // Show clock
-00136 #define RC5_PAUSE               48  // Pause
-00137 #define RC5_ERASE               49  // Erase/correct entry
-00138 #define RC5_REWIND              50  // Rewind
-00139 #define RC5_GOTO                51  // Go to
-00140 #define RC5_WIND                52  // Wind (fast forward)
-00141 #define RC5_PLAY                53  // Play
-00142 #define RC5_STOP                54  // Stop
-00143 #define RC5_RECORD              55  // Record
-00144 #define RC5_EXTERNAL1           56  // External 1
-00145 #define RC5_EXTERNAL2           57  // External 2
-00146 #define RC5_VIEW_DATA           59  // View data, advance
-00147 #define RC5_12                  60  // Channel 12 (or TXT/TV toggle)
-00148 #define RC5_SYSTEM_STANDBY      61  // System standby
-00149 #define RC5_CRISP               62  // Picture crispener (coutour boost)
-00150 #define RC5_AUDIO_RESPONSE      70  // Audio response for speech/music
-00151 #define RC5_SOUND_FUNCTIONS     79  // Select sound functions in sequence
-00152 #define RC5_PIP_SIZE            104 // Alter PIP size step-by-step
-00153 #define RC5_VISION_FUNCTIONS    105 // Select vision functions in sequence
-00154 #define RC5_COLOR_KEY           106 // Colored or other special key
-00155 #define RC5_RED                 107 // Red button
-00156 #define RC5_GREEN               108 // Green button
-00157 #define RC5_YELLOW              109 // Yellow button
-00158 #define RC5_CYAN                110 // Cyan button
-00159 #define RC5_INDEX               111 // Index page/white function
-00160 #define RC5_NEXT_OPTION         112 // Next option
-00161 #define RC5_PREVIOUS_OPTION     113 // Previous option
-00162 #define RC5_STORE_OPEN_CLOSE    122 // Store open/close
-00163 #define RC5_PARENTAL_ACCESS     123 // Parental access via PIN code
-00164 
-00165 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00166 // Table 4b, TV1 and TV2 extension
-00167 #define RC5_DEFAULT_VIDEO       10  // Default video settings (TV1)
-00168 #define RC5_DEFAULT_AUDIO       11  // Default audio settings (TV1)
-00169 #define RC5_PAYTV_CHANNEL_UP    28  // Pay TV channel up (TV1)
-00170 #define RC5_PAYTV_CHANNEL_DOWN  29  // Pay TV channel down (TV1)
-00171 #define RC5_RADIO_CHANNEL_UP    30  // Radio channel up (TV1)
-00172 #define RC5_RADIO_CHANNEL_DOWN  31  // Radio channel down (TV1)
-00173 #define RC5_TILT_FORWARD        32  // Tilt cabinet forward (TV1)
-00174 #define RC5_TILT_BACKWARD       33  // Tilt cabinet backward (TV1)
-00175 #define RC5_EXTERNAL3           56  // External 3 (TV1)
-00176 #define RC5_EXTERNAL4           56  // External 4 (TV1)
-00177 #define RC5_PICTURE_FORMAT      62  // 4:3 vs 16:9 (TV1)
-00178 #define RC5_CHANNEL_10          67  // Channel 10
-00179 #define RC5_CHANNEL_11          68  // Channel 11
-00180 #define RC5_CHANNEL_12          69  // Channel 12
-00181 #define RC5_DEFAULT_VIDEO2      72  // Default video settings (TV2)
-00182 #define RC5_DEFAULT_AUDIO2      73  // Default audio settings (TV2)
-00183 #define RC5_PAYTV_CHANNEL_UP2   88  // Pay TV channel up (TV2)
-00184 #define RC5_PAYTV_CHANNEL_DOWN2 89  // Pay TV channel down (TV2)
-00185 #define RC5_RADIO_CHANNEL_UP2   90  // Radio channel up (TV2)
-00186 #define RC5_RADIO_CHANNEL_DOWN2 91  // Radio channel down (TV2)
-00187 #define RC5_TILT_FORWARD2       104 // Tilt cabinet forward (TV2)
-00188 #define RC5_TILT_BACKWARD2      105 // Tilt cabinet backward (TV2)
-00189 #define RC5_EXTERNAL3_2         120 // External 3 (TV2)
-00190 #define RC5_EXTERNAL4_2         121 // External 4 (TV2)
-00191 #define RC5_CHANNEL_MENU        122 // Channel setting menu
-00192 #define RC5_PICTURE_FORMAT2     126 // 4:3 vs 16:9 (TV2)
-00193 
-00194 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00195 // Table 5, Teletext commands
-00196 #define RC5_NEXT_PAGE           10  // Next page
-00197 #define RC5_PREVIOUS_PAGE       11  // Previous page
-00198 //      RC5_STANDBY             12  // Standby
-00199 #define RC5_ENTER_PAGE_NUMBER   28  // Enter page number in memory
-00200 #define RC5_SEQ_DISPLAY         29  // Sequential display of pages
-00201 #define RC5_SEQ_DELETE          30  // Sequential display/deletion of pages
-00202 #define RC5_EXCHANGE            32  // Exchange (Antiope function)
-00203 #define RC5_MAIN_INDEX          33  // Main index
-00204 #define RC5_ROW_ZERO            34  // Row zero (Antiope function)
-00205 #define RC5_PRINT               38  // Print displayed page
-00206 #define RC5_MIX                 39  // Mix Antiope/TV pictures
-00207 #define RC5_HOLD_PAGE           41  // Page hold
-00208 //      RC5_TIME                42  // Display time
-00209 #define RC5_LARGE               43  // Large top/bottom/normal
-00210 #define RC5_REVEAL              44  // Reveal/conceal
-00211 #define RC5_TV_TXT              45  // TV/TXT
-00212 #define RC5_TV_TXT_SUBTITLE     46  // TV + TXT/subtitle
-00213 //      RC5_ERASE               49  // Erase/correct entry
-00214 #define RC5_NEWS_FLASH          62  // News flash (Antiope function)
-00215 
-00216 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00217 // Table 6, LaserVision commands
-00218 #define RC5_PICTURE_NUMBER      10  // Display picture number/time
-00219 #define RC5_CHAPTER_NUMBER      11  // Display chapter number
-00220 //      RC5_STANDBY             12  // Standby
-00221 //      RC5_MUTE                13  // Master mute/de-mute
-00222 //      RC5_DISPLAY_INFO        15  // Display user info on screen
-00223 #define RC5_SHUFFLE             28  // Total shuffle play/repeat once
-00224 #define RC5_REPEAT              29  // Repeat continuously
-00225 #define RC5_SELECT_NEXT         30  // Select next option
-00226 #define RC5_FAST_REVERSE        31  // Fast run reverse
-00227 #define RC5_ENTRY               32  // Entry (prepare to program)
-00228 #define RC5_AUTO_STOP           33  // Auto-stop at pre-programmed point
-00229 #define RC5_SLOW_REVERSE        34  // Slow run reverse
-00230 #define RC5_STEREO_CHANNEL1     35  // Select stereo sound channel 1/language 1
-00231 #define RC5_STEREO_CHANNEL2     36  // Select stereo sound channel 2/language 2
-00232 #define RC5_DEC_STILL           37  // Still increment reverse
-00233 #define RC5_INC_SPEED           38  // Increase speed
-00234 #define RC5_DEC_SPEED           39  // Decrease speed
-00235 #define RC5_SLOW_FORWARD        40  // Slow run forward
-00236 #define RC5_INC_STILL           41  // Still increment forward
-00237 #define RC5_FAST_FORWARD        42  // Fast run forward
-00238 #define RC5_SEARCH_USER_CHOICE  43  // Automatic search for user choice
-00239 #define RC5_SEARCH_REVERSE      44  // Search in reverse
-00240 #define RC5_TRAY                45  // Open/close tray
-00241 #define RC5_SEARCH_FORWARD      46  // Search forward
-00242 #define RC5_PLAY_REVERSE        47  // Play reverse/play opposite sound track
-00243 //      RC5_PAUSE               48  // Pause
-00244 //      RC5_ERASE               49  // Erase/correct entry
-00245 //      RC5_PLAY                53  // Play
-00246 //      RC5_STOP                54  // Stop
-00247 #define RC5_CLEAR_MEMORY        58  // Clear memory all
-00248 #define RC5_FREEZE_SEGMENT      59  // Freeze segment(s) indicated by picture numbers.
-00249 #define RC5_TV_TXT_ALT          60  // TV/TXT toggle; RF switch (USA only)
-00250 #define RC5_CX                  62  // CX 1, 2, 3; toggle for CX noise reduction
-00251 
-00252 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00253 // Table 11, Preamplifier commands
-00254 #define RC5_GEQ_L               10  // Graphic equalizer left
-00255 #define RC5_GEQ_R               11  // Graphic equalizer right
-00256 //      RC5_STANDBY             12  // Standby
-00257 //      RC5_MUTE                13  // Master mute/de-mute
-00258 //      RC5_PREFERENCES         14  // Personal preference settings
-00259 //      RC5_DISPLAY_INFO        15  // Display user info on screen
-00260 #define RC5_GEQ_L_AND_R         28  // Graphic equalizer left and right
-00261 #define RC5_SPEAKER_SELECT      29  // Speaker select
-00262 #define RC5_SCRATCH_FILTER      30  // Scratch filter on/off
-00263 #define RC5_RUMBLE_FILTER       31  // Rumble filter on/off
-00264 #define RC5_INC_STEP            32  // Step function +
-00265 #define RC5_DEC_STEP            33  // Step function -
-00266 #define RC5_SIGNAL_PATH         34  // Signal path options
-00267 #define RC5_SPEAKER_A           35  // Speaker A on/off
-00268 #define RC5_SURROUND_OPTIONS    37  // Surround sound options
-00269 //      RC5_SLEEP_TIMER         38  // Sleep timer
-00270 #define RC5_SPEAKER_B           39  // Speaker B on/off
-00271 #define RC5_SPEAKER_C           40  // Speaker C on/off
-00272 #define RC5_TIMER_PROGRAM       41  // Timer program mode
-00273 //      RC5_TIME                42  // Display time
-00274 #define RC5_INC_TIMER           43  // Timer +
-00275 #define RC5_DEC_TIMER           44  // Timer -
-00276 #define RC5_TIMER_MEMORY        45  // Open timer memory
-00277 #define RC5_ACOUSTIC_CONTROL    46  // Open acoustic control setting memory
-00278 #define RC5_ACOUSTIC_SELECT     47  // Select acoustic settings in memory
-00279 //      RC5_ERASE               49  // Erase/correct entry
-00280 //      RC5_CLEAR_MEMORY        58  // Clear memory all
-00281 #define RC5_DYNAMIC_EXPAND      60  // Dynamic range expand
-00282 #define RC5_DYNAMIC_COMPRESS    62  // Dynamic range compress
-00283 #define RC5_SURROUND_SOUND      64  // Surround sound on/off
-00284 #define RC5_BALANCE_FRONT       65  // Balance front
-00285 #define RC5_BALANCE_REAR        66  // Balance rear
-00286 #define RC5_LINEAR_SOUND        79  // Scroll linear sound functions
-00287 #define RC5_RANDOM_NOISE        88  // Random noise generator on/off
-00288 #define RC5_TIMER               89  // Timer on/off
-00289 #define RC5_NEWS_TIMER          90  // News timer on/off
-00290 #define RC5_INC_CENTER_VOLUME   102 // Increase center channel volume
-00291 #define RC5_DEC_CENTER_VOLUME   103 // Decrease center channel volume
-00292 #define RC5_INC_DELAY_SURROUND  104 // Increase delay front to surround
-00293 #define RC5_DEC_DELAY_SURROUND  105 // Decrease delay front to surround
-00294 #define RC5_LINEAR_PHASE        106 // Linear phase
-00295 #define RC5_TAPE_MONITOR        122 // Tape monitor
-00296 
-00297 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
-00298 // Table 14, Compact disc player commands
-00299 #define RC5_LOCAL_CURSOR        10  // Scroll local display cursor
-00300 #define RC5_LOCAL_FUNCTION      11  // Scroll local display function
-00301 //      RC5_STANDBY             12  // Standby
-00302 //      RC5_MUTE                13  // Master mute/de-mute
-00303 //      RC5_DISPLAY_INFO        15  // Display user info on screen
-00304 //      RC5_SHUFFLE             28  // Total shuffle play/repeat once
-00305 //      RC5_REPEAT              29  // Repeat continuously
-00306 #define RC5_INC_SELECT          30  // Select increment
-00307 #define RC5_DEC_SELECT          31  // Select decrement
-00308 #define RC5_NEXT                32  // Next
-00309 #define RC5_PREVIOUS            33  // Previous
-00310 #define RC5_INDEX_NEXT          34  // Index next
-00311 #define RC5_INDEX_PREVIOUS      35  // Index previous
-00312 #define RC5_PLAY_PROGRAM        36  // Play/program
-00313 #define RC5_NOMINAL_SPEED       37  // Speed nominal
-00314 //      RC5_INC_SPEED           38  // Increase speed
-00315 //      RC5_DEC_SPEED           39  // Decrease speed
-00316 //      RC5_STORE               41  // Store/vote
-00317 //      RC5_INC_SCAN            43  // Scan forward/increment
-00318 //      RC5_TRAY                45  // Open/close tray
-00319 #define RC5_CARTRIDGE           47  // Fast/select disc from catridge
-00320 //      RC5_PAUSE               48  // Pause
-00321 //      RC5_ERASE               49  // Erase/correct entry
-00322 //      RC5_REWIND              50  // Rewind
-00323 //      RC5_GOTO                51  // Go to
-00324 //      RC5_WIND                52  // Wind (fast forward)
-00325 //      RC5_PLAY                53  // Play
-00326 //      RC5_STOP                54  // Stop
-00327 //      RC5_CLEAR_MEMORY        58  // Clear memory all
-00328 #define RC5_REPEAT_AB           59  // Repeat program marked A/B
-00329 //      RC5_DYNAMIC_EXPAND      60  // Dynamic range expand
-00330 //      RC5_DYNAMIC_COMPRESS    62  // Dynamic range compress
-00331 #define RC5_DSP                 91  // Digital signal processing on/off
-00332 #define RC5_DSP_MUSIC           92  // Music mode (DSP)
-00333 #define RC5_DSP_ACOUSTICS       93  // Select room acoustics (DSP)
-00334 #define RC5_DSP_JAZZ            94  // Jazz/s-hall effect (DSP)
-00335 #define RC5_DSP_POP             95  // Pop/s-hall effect (DSP)
-00336 #define RC5_DSP_CLASSIC         96  // Classic/church music for music/room mode (DSP)
-00337 #define RC5_DSP_EASY            97  // Easy/club music for music/room mode (DSP)
-00338 #define RC5_DSP_DISCO           98  // Disco/stadium music for music/room mode (DSP)
-00339 #define RC5_SECOND_FAVORITE     107 // Second favorite track selection
-00340 #define RC5_FAVORITE            108 // Favorite track selection
-00341 #define RC5_TITLE_INTO_MEMORY   109 // Title into memory
-00342 #define RC5_FADE                120 // Fade in/out audio
-00343 
-00344 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -420,8 +77,366 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
RC5.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef RC5_h
+
24 #define RC5_h
+
25 
+
26 // http://en.wikipedia.org/wiki/RC-5#System_Number_Allocations
+
27 #define RC5_SYS_TV 0 // TV receiver 1
+
28 #define RC5_SYS_TV2 1 // TV receiver 2
+
29 #define RC5_SYS_TXT 2 // Teletext
+
30 #define RC5_SYS_TV_EXT 3 // Extension to TV 1 & 2
+
31 #define RC5_SYS_LV 4 // Laservision player
+
32 #define RC5_SYS_VCR 5 // VCR 1
+
33 #define RC5_SYS_VCR2 6 // VCR 2
+
34 #define RC5_SYS_SAT 8 // Satellite receiver 1
+
35 #define RC5_SYS_VCR_EXT 9 // Extension to VCR 1 & 2
+
36 #define RC5_SYS_SAT2 10 // Satellite receiver 2
+
37 #define RC5_SYS_CD_VIDEO 12 // CD video player
+
38 #define RC5_SYS_CD_PHOTO 14 // CD photo player
+
39 #define RC5_SYS_PREAMP 16 // Audio preamplifier 1
+
40 #define RC5_SYS_RADIO 17 // Radio tuner
+
41 #define RC5_SYS_REC 18 // Casette recorder 1
+
42 #define RC5_SYS_PREAMP2 19 // Audio preamplifier 2
+
43 #define RC5_SYS_CD 20 // CD player
+
44 #define RC5_SYS_COMBI 21 // Audio stack or record player
+
45 #define RC5_SYS_AUDIO_SAT 22 // Audio satellite
+
46 #define RC5_SYS_REC2 23 // Casette recorder 2
+
47 #define RC5_SYS_CD_R 26 // CD recorder
+
48 
+
49 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
50 // Table 2, Common commands:
+
51 #define RC5_0 0 // Digit 0
+
52 #define RC5_1 1 // Digit 1
+
53 #define RC5_2 2 // Digit 2
+
54 #define RC5_3 3 // Digit 3
+
55 #define RC5_4 4 // Digit 4
+
56 #define RC5_5 5 // Digit 5
+
57 #define RC5_6 6 // Digit 6
+
58 #define RC5_7 7 // Digit 7
+
59 #define RC5_8 8 // Digit 8
+
60 #define RC5_9 9 // Digit 9
+
61 #define RC5_INC_VOLUME 16 // Increase sound volume
+
62 #define RC5_DEC_VOLUME 17 // Decrease sound volume
+
63 #define RC5_INC_BRIGHTNESS 18 // Increase display brightness
+
64 #define RC5_DEC_BRIGHTNESS 19 // Decrease display brightness
+
65 #define RC5_INC_BASS 22 // Increase bass response
+
66 #define RC5_DEC_BASS 23 // Decrease bass response
+
67 #define RC5_INC_TREBLE 24 // Increase treble response
+
68 #define RC5_DEC_TREBLE 25 // Decrease treble response
+
69 #define RC5_BALANCE_LEFT 26 // Shift sound balance to left
+
70 #define RC5_BALANCE_RIGHT 27 // Shift sound balance to right
+
71 #define RC5_TRANSMIT_MODE 63 // Select remote transmit mode
+
72 #define RC5_DIM 71 // Dim local display
+
73 #define RC5_INC_LINEAR 77 // Increase linear control
+
74 #define RC5_DEC_LINEAR 78 // Decrease linear control
+
75 #define RC5_UP 80 // Move cursor up
+
76 #define RC5_DOWN 81 // Move cursor down
+
77 #define RC5_MENU_ON 82 // Switch display/screen menu on
+
78 #define RC5_MENU_OFF 83 // Switch display/screen menu off
+
79 #define RC5_AV_STATUS 84 // Display A/V system status
+
80 #define RC5_LEFT 85 // Move cursor left
+
81 #define RC5_RIGHT 86 // Move cursor right
+
82 #define RC5_OK 87 // Acknowledge function at cursor
+
83 #define RC5_SUBMODE 118 // Select sub-mode
+
84 #define RC5_OPTIONS 119 // Select options sub-mode
+
85 #define RC5_CONNECT_EURO 123 // Connect items via Euroconnector
+
86 #define RC5_DISCONNECT_EURO 124 // Disconnect items via Euroconnector
+
87 
+
88 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
89 // Table 3, Common video system commands:
+
90 #define RC5_INC_SATURATION 20 // Increase color saturation
+
91 #define RC5_DEC_SATURATION 21 // Decrease color saturation
+
92 #define RC5_PIP 88 // Picture-in-picture on/off
+
93 #define RC5_PIP_SHIFT 89 // Picture-in-picture shift
+
94 #define RC5_PIP_SWAP 90 // Picture-in-picture swap
+
95 #define RC5_PIP_STROBE 91 // Strobe main picture on/off
+
96 #define RC5_PIP_MULTI_STROBE 92 // Multi-strobe
+
97 #define RC5_PIP_FREEZE_MAIN 93 // Main picture frame frozen
+
98 #define RC5_PIP_MULTI_SCAN 94 // 3/9 multi-scan
+
99 #define RC5_PIP_SOURCE 95 // Select picture-in-picture source
+
100 #define RC5_PIP_MOSAIC 96 // Mosaic/multi-PIP
+
101 #define RC5_PIP_NOISE 97 // Digital noise reduction of picture
+
102 #define RC5_PIP_STORE 98 // Store main picture
+
103 #define RC5_PIP_PHOTO_FINISH 99 // PIP strobe; display photo-finish
+
104 #define RC5_PIP_RECALL 100 // Recall main stored picture
+
105 #define RC5_PIP_FREEZE 101 // Freeze PIP
+
106 #define RC5_PIP_UP 102 // Step up PIP options/source
+
107 #define RC5_PIP_DOWN 103 // Step down PIP options/source
+
108 
+
109 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
110 // Table 4a, TV and VCR commands:
+
111 #define RC5_123 10 // 1/2/3 digit entry
+
112 #define RC5_11 11 // Channel/program/frequency 11
+
113 #define RC5_STANDBY 12 // Standby
+
114 #define RC5_MUTE 13 // Master mute/de-mute
+
115 #define RC5_PREFERENCES 14 // Personal preference settings
+
116 #define RC5_DISPLAY_INFO 15 // Display user info on screen
+
117 #define RC5_INC_CONTRAST 28 // Increase picture contrast
+
118 #define RC5_DEC_CONTRAST 29 // Decrease picture contrast
+
119 #define RC5_SEARCH_UP 30 // Search up
+
120 #define RC5_DEC_TINT 31 // Decrease tint/hue
+
121 #define RC5_CHANNEL_UP 32 // Channel/program up
+
122 #define RC5_CHANNEL_DOWN 33 // Channel/program down
+
123 #define RC5_CHANNEL_LAST 34 // Last viewed channel/program
+
124 #define RC5_STEREO_SELECT 35 // Select stereo channel/language
+
125 #define RC5_STEREO_SPATIAL 36 // Spatial stereo
+
126 #define RC5_STEREO_TOGGLE 37 // Toggle stereo/mono
+
127 #define RC5_SLEEP_TIMER 38 // Sleep timer
+
128 #define RC5_INC_TINT 39 // Increase tint/hue
+
129 #define RC5_SWITCH_RF 40 // Switch RF inputs
+
130 #define RC5_STORE 41 // Store/vote
+
131 #define RC5_TIME 42 // Display time
+
132 #define RC5_INC_SCAN 43 // Scan forward/increment
+
133 #define RC5_DEC_SCAN 44 // Scan backward/decrement
+
134 #define RC5_SECONDARY_MENU 46 // Secondary menu
+
135 #define RC5_CLOCK 47 // Show clock
+
136 #define RC5_PAUSE 48 // Pause
+
137 #define RC5_ERASE 49 // Erase/correct entry
+
138 #define RC5_REWIND 50 // Rewind
+
139 #define RC5_GOTO 51 // Go to
+
140 #define RC5_WIND 52 // Wind (fast forward)
+
141 #define RC5_PLAY 53 // Play
+
142 #define RC5_STOP 54 // Stop
+
143 #define RC5_RECORD 55 // Record
+
144 #define RC5_EXTERNAL1 56 // External 1
+
145 #define RC5_EXTERNAL2 57 // External 2
+
146 #define RC5_VIEW_DATA 59 // View data, advance
+
147 #define RC5_12 60 // Channel 12 (or TXT/TV toggle)
+
148 #define RC5_SYSTEM_STANDBY 61 // System standby
+
149 #define RC5_CRISP 62 // Picture crispener (coutour boost)
+
150 #define RC5_AUDIO_RESPONSE 70 // Audio response for speech/music
+
151 #define RC5_SOUND_FUNCTIONS 79 // Select sound functions in sequence
+
152 #define RC5_PIP_SIZE 104 // Alter PIP size step-by-step
+
153 #define RC5_VISION_FUNCTIONS 105 // Select vision functions in sequence
+
154 #define RC5_COLOR_KEY 106 // Colored or other special key
+
155 #define RC5_RED 107 // Red button
+
156 #define RC5_GREEN 108 // Green button
+
157 #define RC5_YELLOW 109 // Yellow button
+
158 #define RC5_CYAN 110 // Cyan button
+
159 #define RC5_INDEX 111 // Index page/white function
+
160 #define RC5_NEXT_OPTION 112 // Next option
+
161 #define RC5_PREVIOUS_OPTION 113 // Previous option
+
162 #define RC5_STORE_OPEN_CLOSE 122 // Store open/close
+
163 #define RC5_PARENTAL_ACCESS 123 // Parental access via PIN code
+
164 
+
165 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
166 // Table 4b, TV1 and TV2 extension
+
167 #define RC5_DEFAULT_VIDEO 10 // Default video settings (TV1)
+
168 #define RC5_DEFAULT_AUDIO 11 // Default audio settings (TV1)
+
169 #define RC5_PAYTV_CHANNEL_UP 28 // Pay TV channel up (TV1)
+
170 #define RC5_PAYTV_CHANNEL_DOWN 29 // Pay TV channel down (TV1)
+
171 #define RC5_RADIO_CHANNEL_UP 30 // Radio channel up (TV1)
+
172 #define RC5_RADIO_CHANNEL_DOWN 31 // Radio channel down (TV1)
+
173 #define RC5_TILT_FORWARD 32 // Tilt cabinet forward (TV1)
+
174 #define RC5_TILT_BACKWARD 33 // Tilt cabinet backward (TV1)
+
175 #define RC5_EXTERNAL3 56 // External 3 (TV1)
+
176 #define RC5_EXTERNAL4 56 // External 4 (TV1)
+
177 #define RC5_PICTURE_FORMAT 62 // 4:3 vs 16:9 (TV1)
+
178 #define RC5_CHANNEL_10 67 // Channel 10
+
179 #define RC5_CHANNEL_11 68 // Channel 11
+
180 #define RC5_CHANNEL_12 69 // Channel 12
+
181 #define RC5_DEFAULT_VIDEO2 72 // Default video settings (TV2)
+
182 #define RC5_DEFAULT_AUDIO2 73 // Default audio settings (TV2)
+
183 #define RC5_PAYTV_CHANNEL_UP2 88 // Pay TV channel up (TV2)
+
184 #define RC5_PAYTV_CHANNEL_DOWN2 89 // Pay TV channel down (TV2)
+
185 #define RC5_RADIO_CHANNEL_UP2 90 // Radio channel up (TV2)
+
186 #define RC5_RADIO_CHANNEL_DOWN2 91 // Radio channel down (TV2)
+
187 #define RC5_TILT_FORWARD2 104 // Tilt cabinet forward (TV2)
+
188 #define RC5_TILT_BACKWARD2 105 // Tilt cabinet backward (TV2)
+
189 #define RC5_EXTERNAL3_2 120 // External 3 (TV2)
+
190 #define RC5_EXTERNAL4_2 121 // External 4 (TV2)
+
191 #define RC5_CHANNEL_MENU 122 // Channel setting menu
+
192 #define RC5_PICTURE_FORMAT2 126 // 4:3 vs 16:9 (TV2)
+
193 
+
194 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
195 // Table 5, Teletext commands
+
196 #define RC5_NEXT_PAGE 10 // Next page
+
197 #define RC5_PREVIOUS_PAGE 11 // Previous page
+
198 // RC5_STANDBY 12 // Standby
+
199 #define RC5_ENTER_PAGE_NUMBER 28 // Enter page number in memory
+
200 #define RC5_SEQ_DISPLAY 29 // Sequential display of pages
+
201 #define RC5_SEQ_DELETE 30 // Sequential display/deletion of pages
+
202 #define RC5_EXCHANGE 32 // Exchange (Antiope function)
+
203 #define RC5_MAIN_INDEX 33 // Main index
+
204 #define RC5_ROW_ZERO 34 // Row zero (Antiope function)
+
205 #define RC5_PRINT 38 // Print displayed page
+
206 #define RC5_MIX 39 // Mix Antiope/TV pictures
+
207 #define RC5_HOLD_PAGE 41 // Page hold
+
208 // RC5_TIME 42 // Display time
+
209 #define RC5_LARGE 43 // Large top/bottom/normal
+
210 #define RC5_REVEAL 44 // Reveal/conceal
+
211 #define RC5_TV_TXT 45 // TV/TXT
+
212 #define RC5_TV_TXT_SUBTITLE 46 // TV + TXT/subtitle
+
213 // RC5_ERASE 49 // Erase/correct entry
+
214 #define RC5_NEWS_FLASH 62 // News flash (Antiope function)
+
215 
+
216 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
217 // Table 6, LaserVision commands
+
218 #define RC5_PICTURE_NUMBER 10 // Display picture number/time
+
219 #define RC5_CHAPTER_NUMBER 11 // Display chapter number
+
220 // RC5_STANDBY 12 // Standby
+
221 // RC5_MUTE 13 // Master mute/de-mute
+
222 // RC5_DISPLAY_INFO 15 // Display user info on screen
+
223 #define RC5_SHUFFLE 28 // Total shuffle play/repeat once
+
224 #define RC5_REPEAT 29 // Repeat continuously
+
225 #define RC5_SELECT_NEXT 30 // Select next option
+
226 #define RC5_FAST_REVERSE 31 // Fast run reverse
+
227 #define RC5_ENTRY 32 // Entry (prepare to program)
+
228 #define RC5_AUTO_STOP 33 // Auto-stop at pre-programmed point
+
229 #define RC5_SLOW_REVERSE 34 // Slow run reverse
+
230 #define RC5_STEREO_CHANNEL1 35 // Select stereo sound channel 1/language 1
+
231 #define RC5_STEREO_CHANNEL2 36 // Select stereo sound channel 2/language 2
+
232 #define RC5_DEC_STILL 37 // Still increment reverse
+
233 #define RC5_INC_SPEED 38 // Increase speed
+
234 #define RC5_DEC_SPEED 39 // Decrease speed
+
235 #define RC5_SLOW_FORWARD 40 // Slow run forward
+
236 #define RC5_INC_STILL 41 // Still increment forward
+
237 #define RC5_FAST_FORWARD 42 // Fast run forward
+
238 #define RC5_SEARCH_USER_CHOICE 43 // Automatic search for user choice
+
239 #define RC5_SEARCH_REVERSE 44 // Search in reverse
+
240 #define RC5_TRAY 45 // Open/close tray
+
241 #define RC5_SEARCH_FORWARD 46 // Search forward
+
242 #define RC5_PLAY_REVERSE 47 // Play reverse/play opposite sound track
+
243 // RC5_PAUSE 48 // Pause
+
244 // RC5_ERASE 49 // Erase/correct entry
+
245 // RC5_PLAY 53 // Play
+
246 // RC5_STOP 54 // Stop
+
247 #define RC5_CLEAR_MEMORY 58 // Clear memory all
+
248 #define RC5_FREEZE_SEGMENT 59 // Freeze segment(s) indicated by picture numbers.
+
249 #define RC5_TV_TXT_ALT 60 // TV/TXT toggle; RF switch (USA only)
+
250 #define RC5_CX 62 // CX 1, 2, 3; toggle for CX noise reduction
+
251 
+
252 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
253 // Table 11, Preamplifier commands
+
254 #define RC5_GEQ_L 10 // Graphic equalizer left
+
255 #define RC5_GEQ_R 11 // Graphic equalizer right
+
256 // RC5_STANDBY 12 // Standby
+
257 // RC5_MUTE 13 // Master mute/de-mute
+
258 // RC5_PREFERENCES 14 // Personal preference settings
+
259 // RC5_DISPLAY_INFO 15 // Display user info on screen
+
260 #define RC5_GEQ_L_AND_R 28 // Graphic equalizer left and right
+
261 #define RC5_SPEAKER_SELECT 29 // Speaker select
+
262 #define RC5_SCRATCH_FILTER 30 // Scratch filter on/off
+
263 #define RC5_RUMBLE_FILTER 31 // Rumble filter on/off
+
264 #define RC5_INC_STEP 32 // Step function +
+
265 #define RC5_DEC_STEP 33 // Step function -
+
266 #define RC5_SIGNAL_PATH 34 // Signal path options
+
267 #define RC5_SPEAKER_A 35 // Speaker A on/off
+
268 #define RC5_SURROUND_OPTIONS 37 // Surround sound options
+
269 // RC5_SLEEP_TIMER 38 // Sleep timer
+
270 #define RC5_SPEAKER_B 39 // Speaker B on/off
+
271 #define RC5_SPEAKER_C 40 // Speaker C on/off
+
272 #define RC5_TIMER_PROGRAM 41 // Timer program mode
+
273 // RC5_TIME 42 // Display time
+
274 #define RC5_INC_TIMER 43 // Timer +
+
275 #define RC5_DEC_TIMER 44 // Timer -
+
276 #define RC5_TIMER_MEMORY 45 // Open timer memory
+
277 #define RC5_ACOUSTIC_CONTROL 46 // Open acoustic control setting memory
+
278 #define RC5_ACOUSTIC_SELECT 47 // Select acoustic settings in memory
+
279 // RC5_ERASE 49 // Erase/correct entry
+
280 // RC5_CLEAR_MEMORY 58 // Clear memory all
+
281 #define RC5_DYNAMIC_EXPAND 60 // Dynamic range expand
+
282 #define RC5_DYNAMIC_COMPRESS 62 // Dynamic range compress
+
283 #define RC5_SURROUND_SOUND 64 // Surround sound on/off
+
284 #define RC5_BALANCE_FRONT 65 // Balance front
+
285 #define RC5_BALANCE_REAR 66 // Balance rear
+
286 #define RC5_LINEAR_SOUND 79 // Scroll linear sound functions
+
287 #define RC5_RANDOM_NOISE 88 // Random noise generator on/off
+
288 #define RC5_TIMER 89 // Timer on/off
+
289 #define RC5_NEWS_TIMER 90 // News timer on/off
+
290 #define RC5_INC_CENTER_VOLUME 102 // Increase center channel volume
+
291 #define RC5_DEC_CENTER_VOLUME 103 // Decrease center channel volume
+
292 #define RC5_INC_DELAY_SURROUND 104 // Increase delay front to surround
+
293 #define RC5_DEC_DELAY_SURROUND 105 // Decrease delay front to surround
+
294 #define RC5_LINEAR_PHASE 106 // Linear phase
+
295 #define RC5_TAPE_MONITOR 122 // Tape monitor
+
296 
+
297 // http://en.wikipedia.org/wiki/RC-5#Command_Tables
+
298 // Table 14, Compact disc player commands
+
299 #define RC5_LOCAL_CURSOR 10 // Scroll local display cursor
+
300 #define RC5_LOCAL_FUNCTION 11 // Scroll local display function
+
301 // RC5_STANDBY 12 // Standby
+
302 // RC5_MUTE 13 // Master mute/de-mute
+
303 // RC5_DISPLAY_INFO 15 // Display user info on screen
+
304 // RC5_SHUFFLE 28 // Total shuffle play/repeat once
+
305 // RC5_REPEAT 29 // Repeat continuously
+
306 #define RC5_INC_SELECT 30 // Select increment
+
307 #define RC5_DEC_SELECT 31 // Select decrement
+
308 #define RC5_NEXT 32 // Next
+
309 #define RC5_PREVIOUS 33 // Previous
+
310 #define RC5_INDEX_NEXT 34 // Index next
+
311 #define RC5_INDEX_PREVIOUS 35 // Index previous
+
312 #define RC5_PLAY_PROGRAM 36 // Play/program
+
313 #define RC5_NOMINAL_SPEED 37 // Speed nominal
+
314 // RC5_INC_SPEED 38 // Increase speed
+
315 // RC5_DEC_SPEED 39 // Decrease speed
+
316 // RC5_STORE 41 // Store/vote
+
317 // RC5_INC_SCAN 43 // Scan forward/increment
+
318 // RC5_TRAY 45 // Open/close tray
+
319 #define RC5_CARTRIDGE 47 // Fast/select disc from catridge
+
320 // RC5_PAUSE 48 // Pause
+
321 // RC5_ERASE 49 // Erase/correct entry
+
322 // RC5_REWIND 50 // Rewind
+
323 // RC5_GOTO 51 // Go to
+
324 // RC5_WIND 52 // Wind (fast forward)
+
325 // RC5_PLAY 53 // Play
+
326 // RC5_STOP 54 // Stop
+
327 // RC5_CLEAR_MEMORY 58 // Clear memory all
+
328 #define RC5_REPEAT_AB 59 // Repeat program marked A/B
+
329 // RC5_DYNAMIC_EXPAND 60 // Dynamic range expand
+
330 // RC5_DYNAMIC_COMPRESS 62 // Dynamic range compress
+
331 #define RC5_DSP 91 // Digital signal processing on/off
+
332 #define RC5_DSP_MUSIC 92 // Music mode (DSP)
+
333 #define RC5_DSP_ACOUSTICS 93 // Select room acoustics (DSP)
+
334 #define RC5_DSP_JAZZ 94 // Jazz/s-hall effect (DSP)
+
335 #define RC5_DSP_POP 95 // Pop/s-hall effect (DSP)
+
336 #define RC5_DSP_CLASSIC 96 // Classic/church music for music/room mode (DSP)
+
337 #define RC5_DSP_EASY 97 // Easy/club music for music/room mode (DSP)
+
338 #define RC5_DSP_DISCO 98 // Disco/stadium music for music/room mode (DSP)
+
339 #define RC5_SECOND_FAVORITE 107 // Second favorite track selection
+
340 #define RC5_FAVORITE 108 // Favorite track selection
+
341 #define RC5_TITLE_INTO_MEMORY 109 // Title into memory
+
342 #define RC5_FADE 120 // Fade in/out audio
+
343 
+
344 #endif
+
+ + diff --git a/RTC_8cpp_source.html b/RTC_8cpp_source.html index bf9c8af1..501c0dff 100644 --- a/RTC_8cpp_source.html +++ b/RTC_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: RTC.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
RTC.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "RTC.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 #include <stdlib.h>
-00030 #include <string.h>
-00031 
-00058 #define DEFAULT_BYTE_COUNT  43  // Default simulates DS1307 NVRAM size.
-00059 
-00060 #define MILLIS_PER_DAY      86400000UL
-00061 #define MILLIS_PER_SECOND   1000UL
-00062 #define MILLIS_PER_MINUTE   60000UL
-00063 #define MILLIS_PER_HOUR     3600000UL
-00064 
-00065 static uint8_t monthLengths[] = {
-00066     31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
-00067 };
-00068 
-00069 static unsigned int monthOffsets[] = {
-00070     0,
-00071     31,
-00072     31 + 28,
-00073     31 + 28 + 31,
-00074     31 + 28 + 31 + 30,
-00075     31 + 28 + 31 + 30 + 31,
-00076     31 + 28 + 31 + 30 + 31 + 30,
-00077     31 + 28 + 31 + 30 + 31 + 30 + 31,
-00078     31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
-00079     31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
-00080     31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
-00081     31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
-00082 };
-00083 
-00084 inline bool isLeapYear(unsigned int year)
-00085 {
-00086     if ((year % 100) == 0)
-00087         return (year % 400) == 0;
-00088     else
-00089         return (year % 4) == 0;
-00090 }
-00091 
-00092 inline uint8_t monthLength(const RTCDate *date)
-00093 {
-00094     if (date->month != 2 || !isLeapYear(date->year))
-00095         return monthLengths[date->month - 1];
-00096     else
-00097         return 29;
-00098 }
-00099 
-00105 RTC::RTC()
-00106     : midnight(millis() - 9 * MILLIS_PER_HOUR) // Simulated clock starts at 9am
-00107     , nvram(0)
-00108 {
-00109     // Start the simulated date at 1 Jan, 2000.
-00110     date.day = 1;
-00111     date.month = 1;
-00112     date.year = 2000;
-00113 
-00114     // Set all simulated alarms to 6am by default.
-00115     for (uint8_t index = 0; index < ALARM_COUNT; ++index) {
-00116         alarms[index].hour = 6;
-00117         alarms[index].minute = 0;
-00118         alarms[index].flags = 0;
-00119     }
-00120 }
-00121 
-00122 RTC::~RTC()
-00123 {
-00124     if (nvram)
-00125         free(nvram);
-00126 }
-00127 
-00134 bool RTC::hasUpdates()
-00135 {
-00136     return true;
-00137 }
-00138 
-00144 void RTC::readTime(RTCTime *value)
-00145 {
-00146     // Determine the number of seconds since the last midnight event.
-00147     unsigned long sinceMidnight = millis() - midnight;
-00148     if (sinceMidnight >= MILLIS_PER_DAY) {
-00149         // We have overflowed into the next day.  Readjust midnight.
-00150         midnight += MILLIS_PER_DAY;
-00151         sinceMidnight -= MILLIS_PER_DAY;
-00152 
-00153         // Increment the simulated date.
-00154         adjustDays(&date, INCREMENT);
-00155     }
-00156     value->second = (uint8_t)(((sinceMidnight / MILLIS_PER_SECOND) % 60));
-00157     value->minute = (uint8_t)(((sinceMidnight / MILLIS_PER_MINUTE) % 60));
-00158     value->hour = (uint8_t)(sinceMidnight / MILLIS_PER_HOUR);
-00159 }
-00160 
-00169 void RTC::readDate(RTCDate *value)
-00170 {
-00171     *value = date;
-00172 }
-00173 
-00179 void RTC::writeTime(const RTCTime *value)
-00180 {
-00181     // Adjust the position of the last simulated midnight event.
-00182     unsigned long sinceMidnight =
-00183         value->second * MILLIS_PER_SECOND +
-00184         value->minute * MILLIS_PER_MINUTE +
-00185         value->hour   * MILLIS_PER_HOUR;
-00186     midnight = millis() - sinceMidnight;
-00187 }
-00188 
-00194 void RTC::writeDate(const RTCDate *value)
-00195 {
-00196     date = *value;
-00197 }
-00198 
-00209 void RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
-00210 {
-00211     *value = alarms[alarmNum];
-00212 }
-00213 
-00224 void RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
-00225 {
-00226     alarms[alarmNum] = *value;
-00227 }
-00228 
-00235 int RTC::byteCount() const
-00236 {
-00237     return DEFAULT_BYTE_COUNT;
-00238 }
-00239 
-00247 uint8_t RTC::readByte(uint8_t offset)
-00248 {
-00249     if (nvram)
-00250         return nvram[offset];
-00251     else
-00252         return 0;
-00253 }
-00254 
-00262 void RTC::writeByte(uint8_t offset, uint8_t value)
-00263 {
-00264     if (nvram) {
-00265         nvram[offset] = value;
-00266     } else {
-00267         nvram = (uint8_t *)malloc(DEFAULT_BYTE_COUNT);
-00268         if (nvram) {
-00269             memset(nvram, 0, DEFAULT_BYTE_COUNT);
-00270             nvram[offset] = value;
-00271         }
-00272     }
-00273 }
-00274 
-00288 int RTC::readTemperature()
-00289 {
-00290     return NO_TEMPERATURE;
-00291 }
-00292 
-00313 void RTC::adjustDays(RTCDate *date, uint8_t flags)
-00314 {
-00315     if (flags & DECREMENT) {
-00316         --(date->day);
-00317         if (date->day == 0) {
-00318             if (!(flags & WRAP)) {
-00319                 --(date->month);
-00320                 if (date->month == 0)
-00321                     date->month = 12;
-00322             }
-00323             date->day = monthLength(date);
-00324         }
-00325     } else {
-00326         ++(date->day);
-00327         if (date->day > monthLength(date)) {
-00328             if (!(flags & WRAP)) {
-00329                 ++(date->month);
-00330                 if (date->month == 13)
-00331                     date->month = 1;
-00332             }
-00333             date->day = 1;
-00334         }
-00335     }
-00336 }
-00337 
-00343 void RTC::adjustMonths(RTCDate *date, uint8_t flags)
-00344 {
-00345     if (flags & DECREMENT) {
-00346         --(date->month);
-00347         if (date->month == 0) {
-00348             date->month = 12;
-00349             if (!(flags & WRAP) && date->year > 2000)
-00350                 --(date->year);
-00351         }
-00352     } else {
-00353         ++(date->month);
-00354         if (date->month == 13) {
-00355             date->month = 1;
-00356             if (!(flags & WRAP) && date->year < 2099)
-00357                 ++(date->year);
-00358         }
-00359     }
-00360     uint8_t len = monthLength(date);
-00361     if (date->day > len)
-00362         date->day = len;
-00363 }
-00364 
-00370 void RTC::adjustYears(RTCDate *date, uint8_t flags)
-00371 {
-00372     if (flags & DECREMENT) {
-00373         --(date->year);
-00374         if (date->year < 2000)
-00375             date->year = 2000;
-00376     } else {
-00377         ++(date->year);
-00378         if (date->year > 2099)
-00379             date->year = 2099;
-00380     }
-00381     uint8_t len = monthLength(date);
-00382     if (date->day > len)
-00383         date->day = len;
-00384 }
-00385 
-00399 RTC::DayOfWeek RTC::dayOfWeek(const RTCDate *date)
-00400 {
-00401     // The +4 here adjusts for Jan 1, 2000 being a Saturday.
-00402     unsigned long daynum = date->day + 4;
-00403     daynum += monthOffsets[date->month - 1];
-00404     if (date->month > 2 && isLeapYear(date->year))
-00405         ++daynum;
-00406     daynum += 365UL * (date->year - 2000);
-00407     if (date->year > 2000)
-00408         daynum += ((date->year - 2001) / 4) + 1;
-00409     return (DayOfWeek)((daynum % 7) + 1);
-00410 }
-00411 
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -331,8 +77,277 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
RTC.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "RTC.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 #include <stdlib.h>
+
30 #include <string.h>
+
31 
+
58 #define DEFAULT_BYTE_COUNT 43 // Default simulates DS1307 NVRAM size.
+
59 
+
60 #define MILLIS_PER_DAY 86400000UL
+
61 #define MILLIS_PER_SECOND 1000UL
+
62 #define MILLIS_PER_MINUTE 60000UL
+
63 #define MILLIS_PER_HOUR 3600000UL
+
64 
+
65 static uint8_t monthLengths[] = {
+
66  31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
+
67 };
+
68 
+
69 static unsigned int monthOffsets[] = {
+
70  0,
+
71  31,
+
72  31 + 28,
+
73  31 + 28 + 31,
+
74  31 + 28 + 31 + 30,
+
75  31 + 28 + 31 + 30 + 31,
+
76  31 + 28 + 31 + 30 + 31 + 30,
+
77  31 + 28 + 31 + 30 + 31 + 30 + 31,
+
78  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31,
+
79  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30,
+
80  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31,
+
81  31 + 28 + 31 + 30 + 31 + 30 + 31 + 31 + 30 + 31 + 30
+
82 };
+
83 
+
84 inline bool isLeapYear(unsigned int year)
+
85 {
+
86  if ((year % 100) == 0)
+
87  return (year % 400) == 0;
+
88  else
+
89  return (year % 4) == 0;
+
90 }
+
91 
+
92 inline uint8_t monthLength(const RTCDate *date)
+
93 {
+
94  if (date->month != 2 || !isLeapYear(date->year))
+
95  return monthLengths[date->month - 1];
+
96  else
+
97  return 29;
+
98 }
+
99 
+ +
106  : midnight(millis() - 9 * MILLIS_PER_HOUR) // Simulated clock starts at 9am
+
107  , nvram(0)
+
108 {
+
109  // Start the simulated date at 1 Jan, 2000.
+
110  date.day = 1;
+
111  date.month = 1;
+
112  date.year = 2000;
+
113 
+
114  // Set all simulated alarms to 6am by default.
+
115  for (uint8_t index = 0; index < ALARM_COUNT; ++index) {
+
116  alarms[index].hour = 6;
+
117  alarms[index].minute = 0;
+
118  alarms[index].flags = 0;
+
119  }
+
120 }
+
121 
+
122 RTC::~RTC()
+
123 {
+
124  if (nvram)
+
125  free(nvram);
+
126 }
+
127 
+ +
135 {
+
136  return true;
+
137 }
+
138 
+
144 void RTC::readTime(RTCTime *value)
+
145 {
+
146  // Determine the number of seconds since the last midnight event.
+
147  unsigned long sinceMidnight = millis() - midnight;
+
148  if (sinceMidnight >= MILLIS_PER_DAY) {
+
149  // We have overflowed into the next day. Readjust midnight.
+
150  midnight += MILLIS_PER_DAY;
+
151  sinceMidnight -= MILLIS_PER_DAY;
+
152 
+
153  // Increment the simulated date.
+
154  adjustDays(&date, INCREMENT);
+
155  }
+
156  value->second = (uint8_t)(((sinceMidnight / MILLIS_PER_SECOND) % 60));
+
157  value->minute = (uint8_t)(((sinceMidnight / MILLIS_PER_MINUTE) % 60));
+
158  value->hour = (uint8_t)(sinceMidnight / MILLIS_PER_HOUR);
+
159 }
+
160 
+
169 void RTC::readDate(RTCDate *value)
+
170 {
+
171  *value = date;
+
172 }
+
173 
+
179 void RTC::writeTime(const RTCTime *value)
+
180 {
+
181  // Adjust the position of the last simulated midnight event.
+
182  unsigned long sinceMidnight =
+
183  value->second * MILLIS_PER_SECOND +
+
184  value->minute * MILLIS_PER_MINUTE +
+
185  value->hour * MILLIS_PER_HOUR;
+
186  midnight = millis() - sinceMidnight;
+
187 }
+
188 
+
194 void RTC::writeDate(const RTCDate *value)
+
195 {
+
196  date = *value;
+
197 }
+
198 
+
209 void RTC::readAlarm(uint8_t alarmNum, RTCAlarm *value)
+
210 {
+
211  *value = alarms[alarmNum];
+
212 }
+
213 
+
224 void RTC::writeAlarm(uint8_t alarmNum, const RTCAlarm *value)
+
225 {
+
226  alarms[alarmNum] = *value;
+
227 }
+
228 
+
235 int RTC::byteCount() const
+
236 {
+
237  return DEFAULT_BYTE_COUNT;
+
238 }
+
239 
+
247 uint8_t RTC::readByte(uint8_t offset)
+
248 {
+
249  if (nvram)
+
250  return nvram[offset];
+
251  else
+
252  return 0;
+
253 }
+
254 
+
262 void RTC::writeByte(uint8_t offset, uint8_t value)
+
263 {
+
264  if (nvram) {
+
265  nvram[offset] = value;
+
266  } else {
+
267  nvram = (uint8_t *)malloc(DEFAULT_BYTE_COUNT);
+
268  if (nvram) {
+
269  memset(nvram, 0, DEFAULT_BYTE_COUNT);
+
270  nvram[offset] = value;
+
271  }
+
272  }
+
273 }
+
274 
+ +
289 {
+
290  return NO_TEMPERATURE;
+
291 }
+
292 
+
313 void RTC::adjustDays(RTCDate *date, uint8_t flags)
+
314 {
+
315  if (flags & DECREMENT) {
+
316  --(date->day);
+
317  if (date->day == 0) {
+
318  if (!(flags & WRAP)) {
+
319  --(date->month);
+
320  if (date->month == 0)
+
321  date->month = 12;
+
322  }
+
323  date->day = monthLength(date);
+
324  }
+
325  } else {
+
326  ++(date->day);
+
327  if (date->day > monthLength(date)) {
+
328  if (!(flags & WRAP)) {
+
329  ++(date->month);
+
330  if (date->month == 13)
+
331  date->month = 1;
+
332  }
+
333  date->day = 1;
+
334  }
+
335  }
+
336 }
+
337 
+
343 void RTC::adjustMonths(RTCDate *date, uint8_t flags)
+
344 {
+
345  if (flags & DECREMENT) {
+
346  --(date->month);
+
347  if (date->month == 0) {
+
348  date->month = 12;
+
349  if (!(flags & WRAP) && date->year > 2000)
+
350  --(date->year);
+
351  }
+
352  } else {
+
353  ++(date->month);
+
354  if (date->month == 13) {
+
355  date->month = 1;
+
356  if (!(flags & WRAP) && date->year < 2099)
+
357  ++(date->year);
+
358  }
+
359  }
+
360  uint8_t len = monthLength(date);
+
361  if (date->day > len)
+
362  date->day = len;
+
363 }
+
364 
+
370 void RTC::adjustYears(RTCDate *date, uint8_t flags)
+
371 {
+
372  if (flags & DECREMENT) {
+
373  --(date->year);
+
374  if (date->year < 2000)
+
375  date->year = 2000;
+
376  } else {
+
377  ++(date->year);
+
378  if (date->year > 2099)
+
379  date->year = 2099;
+
380  }
+
381  uint8_t len = monthLength(date);
+
382  if (date->day > len)
+
383  date->day = len;
+
384 }
+
385 
+ +
400 {
+
401  // The +4 here adjusts for Jan 1, 2000 being a Saturday.
+
402  unsigned long daynum = date->day + 4;
+
403  daynum += monthOffsets[date->month - 1];
+
404  if (date->month > 2 && isLeapYear(date->year))
+
405  ++daynum;
+
406  daynum += 365UL * (date->year - 2000);
+
407  if (date->year > 2000)
+
408  daynum += ((date->year - 2001) / 4) + 1;
+
409  return (DayOfWeek)((daynum % 7) + 1);
+
410 }
+
411 
+
+ + diff --git a/RTC_8h_source.html b/RTC_8h_source.html index f93c540a..e52fb65c 100644 --- a/RTC_8h_source.html +++ b/RTC_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: RTC.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
RTC.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef RTC_h
-00024 #define RTC_h
-00025 
-00026 #include <inttypes.h>
-00027 
-00028 struct RTCTime
-00029 {
-00030     uint8_t hour;
-00031     uint8_t minute;
-00032     uint8_t second;
-00033 };
-00034 
-00035 struct RTCDate
-00036 {
-00037     unsigned int year;
-00038     uint8_t month;
-00039     uint8_t day;
-00040 };
-00041 
-00042 struct RTCAlarm
-00043 {
-00044     uint8_t hour;
-00045     uint8_t minute;
-00046     uint8_t flags;
-00047 };
-00048 
-00049 class RTC
-00050 {
-00051 public:
-00052     RTC();
-00053     ~RTC();
-00054 
-00055     enum DayOfWeek
-00056     {
-00057         Monday = 1,
-00058         Tuesday,
-00059         Wednesday,
-00060         Thursday,
-00061         Friday,
-00062         Saturday,
-00063         Sunday,
-00064     };
-00065 
-00066     virtual bool hasUpdates();
-00067 
-00068     virtual void readTime(RTCTime *value);
-00069     virtual void readDate(RTCDate *value);
-00070 
-00071     virtual void writeTime(const RTCTime *value);
-00072     virtual void writeDate(const RTCDate *value);
-00073 
-00074     static const uint8_t ALARM_COUNT = 4;
-00075 
-00076     virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value);
-00077     virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
-00078 
-00079     virtual int byteCount() const;
-00080     virtual uint8_t readByte(uint8_t offset);
-00081     virtual void writeByte(uint8_t offset, uint8_t value);
-00082 
-00083     static const int NO_TEMPERATURE = 32767;
-00084 
-00085     virtual int readTemperature();
-00086 
-00087     // Flags for adjustDays(), adjustMonths(), and adjustYears().
-00088     static const uint8_t INCREMENT = 0x0000;
-00089     static const uint8_t DECREMENT = 0x0001;
-00090     static const uint8_t WRAP      = 0x0002;
-00091 
-00092     static void adjustDays(RTCDate *date, uint8_t flags);
-00093     static void adjustMonths(RTCDate *date, uint8_t flags);
-00094     static void adjustYears(RTCDate *date, uint8_t flags);
-00095 
-00096     static DayOfWeek dayOfWeek(const RTCDate *date);
-00097 
-00098 private:
-00099     unsigned long midnight;
-00100     RTCDate date;
-00101     RTCAlarm alarms[ALARM_COUNT];
-00102     uint8_t *nvram;
-00103 };
-00104 
-00105 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -181,8 +77,127 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
RTC.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef RTC_h
+
24 #define RTC_h
+
25 
+
26 #include <inttypes.h>
+
27 
+
28 struct RTCTime
+
29 {
+
30  uint8_t hour;
+
31  uint8_t minute;
+
32  uint8_t second;
+
33 };
+
34 
+
35 struct RTCDate
+
36 {
+
37  unsigned int year;
+
38  uint8_t month;
+
39  uint8_t day;
+
40 };
+
41 
+
42 struct RTCAlarm
+
43 {
+
44  uint8_t hour;
+
45  uint8_t minute;
+
46  uint8_t flags;
+
47 };
+
48 
+
49 class RTC
+
50 {
+
51 public:
+
52  RTC();
+
53  ~RTC();
+
54 
+
55  enum DayOfWeek
+
56  {
+
57  Monday = 1,
+
58  Tuesday,
+
59  Wednesday,
+
60  Thursday,
+
61  Friday,
+
62  Saturday,
+
63  Sunday,
+
64  };
+
65 
+
66  virtual bool hasUpdates();
+
67 
+
68  virtual void readTime(RTCTime *value);
+
69  virtual void readDate(RTCDate *value);
+
70 
+
71  virtual void writeTime(const RTCTime *value);
+
72  virtual void writeDate(const RTCDate *value);
+
73 
+
74  static const uint8_t ALARM_COUNT = 4;
+
75 
+
76  virtual void readAlarm(uint8_t alarmNum, RTCAlarm *value);
+
77  virtual void writeAlarm(uint8_t alarmNum, const RTCAlarm *value);
+
78 
+
79  virtual int byteCount() const;
+
80  virtual uint8_t readByte(uint8_t offset);
+
81  virtual void writeByte(uint8_t offset, uint8_t value);
+
82 
+
83  static const int NO_TEMPERATURE = 32767;
+
84 
+
85  virtual int readTemperature();
+
86 
+
87  // Flags for adjustDays(), adjustMonths(), and adjustYears().
+
88  static const uint8_t INCREMENT = 0x0000;
+
89  static const uint8_t DECREMENT = 0x0001;
+
90  static const uint8_t WRAP = 0x0002;
+
91 
+
92  static void adjustDays(RTCDate *date, uint8_t flags);
+
93  static void adjustMonths(RTCDate *date, uint8_t flags);
+
94  static void adjustYears(RTCDate *date, uint8_t flags);
+
95 
+
96  static DayOfWeek dayOfWeek(const RTCDate *date);
+
97 
+
98 private:
+
99  unsigned long midnight;
+
100  RTCDate date;
+
101  RTCAlarm alarms[ALARM_COUNT];
+
102  uint8_t *nvram;
+
103 };
+
104 
+
105 #endif
+
+ + diff --git a/SoftI2C_8cpp_source.html b/SoftI2C_8cpp_source.html index 554d5106..b172ff93 100644 --- a/SoftI2C_8cpp_source.html +++ b/SoftI2C_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: SoftI2C.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
SoftI2C.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "SoftI2C.h"
-00024 #if defined(ARDUINO) && ARDUINO >= 100
-00025 #include <Arduino.h>
-00026 #else
-00027 #include <WProgram.h>
-00028 #endif
-00029 
-00045 #define i2cDelay()  delayMicroseconds(5)
-00046 
-00050 SoftI2C::SoftI2C(uint8_t dataPin, uint8_t clockPin)
-00051     : _dataPin(dataPin)
-00052     , _clockPin(clockPin)
-00053     , started(false)
-00054     , acked(true)
-00055     , inWrite(false)
-00056     , readCount(0)
-00057 {
-00058     // Initially set the CLOCK and DATA lines to be outputs in the high state.
-00059     pinMode(_clockPin, OUTPUT);
-00060     pinMode(_dataPin, OUTPUT);
-00061     digitalWrite(_clockPin, HIGH);
-00062     digitalWrite(_dataPin, HIGH);
-00063 }
-00064 
-00065 unsigned int SoftI2C::maxTransferSize() const
-00066 {
-00067     return 0xFFFF;
-00068 }
-00069 
-00070 void SoftI2C::start()
-00071 {
-00072     pinMode(_dataPin, OUTPUT);
-00073     if (started) {
-00074         // Already started, so send a restart condition.
-00075         digitalWrite(_dataPin, HIGH);
-00076         digitalWrite(_clockPin, HIGH);
-00077         i2cDelay();
-00078     }
-00079     digitalWrite(_dataPin, LOW);
-00080     i2cDelay();
-00081     digitalWrite(_clockPin, LOW);
-00082     i2cDelay();
-00083     started = true;
-00084     acked = true;
-00085 }
-00086 
-00087 void SoftI2C::stop()
-00088 {
-00089     pinMode(_dataPin, OUTPUT);
-00090     digitalWrite(_dataPin, LOW);
-00091     digitalWrite(_clockPin, HIGH);
-00092     i2cDelay();
-00093     digitalWrite(_dataPin, HIGH);
-00094     i2cDelay();
-00095     started = false;
-00096     inWrite = false;
-00097 }
-00098 
-00099 #define I2C_WRITE   0x00
-00100 #define I2C_WRITE10 0xF0
-00101 #define I2C_READ    0x01
-00102 #define I2C_READ10  0xF1
-00103 
-00104 void SoftI2C::startWrite(unsigned int address)
-00105 {
-00106     start();
-00107     inWrite = true;
-00108     if (address < 0x80) {
-00109         // 7-bit address.
-00110         write((uint8_t)((address << 1) | I2C_WRITE));
-00111     } else {
-00112         // 10-bit address.
-00113         write((uint8_t)(((address >> 7) & 0x06)) | I2C_WRITE10);
-00114         write((uint8_t)address);
-00115     }
-00116 }
-00117 
-00118 void SoftI2C::write(uint8_t value)
-00119 {
-00120     uint8_t mask = 0x80;
-00121     while (mask != 0) {
-00122         writeBit((value & mask) != 0);
-00123         mask >>= 1;
-00124     }
-00125     if (readBit())  // 0: ACK, 1: NACK
-00126         acked = false;
-00127 }
-00128 
-00129 bool SoftI2C::endWrite()
-00130 {
-00131     stop();
-00132     return acked;
-00133 }
-00134 
-00135 bool SoftI2C::startRead(unsigned int address, unsigned int count)
-00136 {
-00137     start();
-00138     inWrite = false;
-00139     if (address < 0x80) {
-00140         // 7-bit address.
-00141         write((uint8_t)((address << 1) | I2C_READ));
-00142     } else {
-00143         // 10-bit address.
-00144         write((uint8_t)(((address >> 7) & 0x06)) | I2C_READ10);
-00145         write((uint8_t)address);
-00146     }
-00147     if (!acked) {
-00148         readCount = 0;
-00149         return false;
-00150     }
-00151     readCount = count;
-00152     return true;
-00153 }
-00154 
-00155 unsigned int SoftI2C::available()
-00156 {
-00157     return readCount;
-00158 }
-00159 
-00160 uint8_t SoftI2C::read()
-00161 {
-00162     uint8_t value = 0;
-00163     for (uint8_t bit = 0; bit < 8; ++bit)
-00164         value = (value << 1) | readBit();
-00165     if (readCount > 1) {
-00166         // More bytes left to read - send an ACK.
-00167         writeBit(false);
-00168         --readCount;
-00169     } else {
-00170         // Last byte - send the NACK and a stop condition.
-00171         writeBit(true);
-00172         stop();
-00173         readCount = 0;
-00174     }
-00175     return value;
-00176 }
-00177 
-00178 void SoftI2C::writeBit(bool bit)
-00179 {
-00180     pinMode(_dataPin, OUTPUT);
-00181     if (bit)
-00182         digitalWrite(_dataPin, HIGH);
-00183     else
-00184         digitalWrite(_dataPin, LOW);
-00185     i2cDelay();
-00186     digitalWrite(_clockPin, HIGH);
-00187     i2cDelay();
-00188     digitalWrite(_clockPin, LOW);
-00189     i2cDelay();
-00190 }
-00191 
-00192 bool SoftI2C::readBit()
-00193 {
-00194     pinMode(_dataPin, INPUT);
-00195     digitalWrite(_dataPin, HIGH);
-00196     digitalWrite(_clockPin, HIGH);
-00197     bool bit = digitalRead(_dataPin);
-00198     i2cDelay();
-00199     digitalWrite(_clockPin, LOW);
-00200     i2cDelay();
-00201     return bit;
-00202 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -260,8 +77,206 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
SoftI2C.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "SoftI2C.h"
+
24 #if defined(ARDUINO) && ARDUINO >= 100
+
25 #include <Arduino.h>
+
26 #else
+
27 #include <WProgram.h>
+
28 #endif
+
29 
+
45 #define i2cDelay() delayMicroseconds(5)
+
46 
+
50 SoftI2C::SoftI2C(uint8_t dataPin, uint8_t clockPin)
+
51  : _dataPin(dataPin)
+
52  , _clockPin(clockPin)
+
53  , started(false)
+
54  , acked(true)
+
55  , inWrite(false)
+
56  , readCount(0)
+
57 {
+
58  // Initially set the CLOCK and DATA lines to be outputs in the high state.
+
59  pinMode(_clockPin, OUTPUT);
+
60  pinMode(_dataPin, OUTPUT);
+
61  digitalWrite(_clockPin, HIGH);
+
62  digitalWrite(_dataPin, HIGH);
+
63 }
+
64 
+
65 unsigned int SoftI2C::maxTransferSize() const
+
66 {
+
67  return 0xFFFF;
+
68 }
+
69 
+
70 void SoftI2C::start()
+
71 {
+
72  pinMode(_dataPin, OUTPUT);
+
73  if (started) {
+
74  // Already started, so send a restart condition.
+
75  digitalWrite(_dataPin, HIGH);
+
76  digitalWrite(_clockPin, HIGH);
+
77  i2cDelay();
+
78  }
+
79  digitalWrite(_dataPin, LOW);
+
80  i2cDelay();
+
81  digitalWrite(_clockPin, LOW);
+
82  i2cDelay();
+
83  started = true;
+
84  acked = true;
+
85 }
+
86 
+
87 void SoftI2C::stop()
+
88 {
+
89  pinMode(_dataPin, OUTPUT);
+
90  digitalWrite(_dataPin, LOW);
+
91  digitalWrite(_clockPin, HIGH);
+
92  i2cDelay();
+
93  digitalWrite(_dataPin, HIGH);
+
94  i2cDelay();
+
95  started = false;
+
96  inWrite = false;
+
97 }
+
98 
+
99 #define I2C_WRITE 0x00
+
100 #define I2C_WRITE10 0xF0
+
101 #define I2C_READ 0x01
+
102 #define I2C_READ10 0xF1
+
103 
+
104 void SoftI2C::startWrite(unsigned int address)
+
105 {
+
106  start();
+
107  inWrite = true;
+
108  if (address < 0x80) {
+
109  // 7-bit address.
+
110  write((uint8_t)((address << 1) | I2C_WRITE));
+
111  } else {
+
112  // 10-bit address.
+
113  write((uint8_t)(((address >> 7) & 0x06)) | I2C_WRITE10);
+
114  write((uint8_t)address);
+
115  }
+
116 }
+
117 
+
118 void SoftI2C::write(uint8_t value)
+
119 {
+
120  uint8_t mask = 0x80;
+
121  while (mask != 0) {
+
122  writeBit((value & mask) != 0);
+
123  mask >>= 1;
+
124  }
+
125  if (readBit()) // 0: ACK, 1: NACK
+
126  acked = false;
+
127 }
+
128 
+ +
130 {
+
131  stop();
+
132  return acked;
+
133 }
+
134 
+
135 bool SoftI2C::startRead(unsigned int address, unsigned int count)
+
136 {
+
137  start();
+
138  inWrite = false;
+
139  if (address < 0x80) {
+
140  // 7-bit address.
+
141  write((uint8_t)((address << 1) | I2C_READ));
+
142  } else {
+
143  // 10-bit address.
+
144  write((uint8_t)(((address >> 7) & 0x06)) | I2C_READ10);
+
145  write((uint8_t)address);
+
146  }
+
147  if (!acked) {
+
148  readCount = 0;
+
149  return false;
+
150  }
+
151  readCount = count;
+
152  return true;
+
153 }
+
154 
+
155 unsigned int SoftI2C::available()
+
156 {
+
157  return readCount;
+
158 }
+
159 
+
160 uint8_t SoftI2C::read()
+
161 {
+
162  uint8_t value = 0;
+
163  for (uint8_t bit = 0; bit < 8; ++bit)
+
164  value = (value << 1) | readBit();
+
165  if (readCount > 1) {
+
166  // More bytes left to read - send an ACK.
+
167  writeBit(false);
+
168  --readCount;
+
169  } else {
+
170  // Last byte - send the NACK and a stop condition.
+
171  writeBit(true);
+
172  stop();
+
173  readCount = 0;
+
174  }
+
175  return value;
+
176 }
+
177 
+
178 void SoftI2C::writeBit(bool bit)
+
179 {
+
180  pinMode(_dataPin, OUTPUT);
+
181  if (bit)
+
182  digitalWrite(_dataPin, HIGH);
+
183  else
+
184  digitalWrite(_dataPin, LOW);
+
185  i2cDelay();
+
186  digitalWrite(_clockPin, HIGH);
+
187  i2cDelay();
+
188  digitalWrite(_clockPin, LOW);
+
189  i2cDelay();
+
190 }
+
191 
+
192 bool SoftI2C::readBit()
+
193 {
+
194  pinMode(_dataPin, INPUT);
+
195  digitalWrite(_dataPin, HIGH);
+
196  digitalWrite(_clockPin, HIGH);
+
197  bool bit = digitalRead(_dataPin);
+
198  i2cDelay();
+
199  digitalWrite(_clockPin, LOW);
+
200  i2cDelay();
+
201  return bit;
+
202 }
+
+ + diff --git a/SoftI2C_8h_source.html b/SoftI2C_8h_source.html index 8c1533d1..36e79324 100644 --- a/SoftI2C_8h_source.html +++ b/SoftI2C_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: SoftI2C.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
SoftI2C.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef SoftI2C_h
-00024 #define SoftI2C_h
-00025 
-00026 #include "I2CMaster.h"
-00027 
-00028 class SoftI2C : public I2CMaster {
-00029 public:
-00030     SoftI2C(uint8_t dataPin, uint8_t clockPin);
-00031 
-00032     unsigned int maxTransferSize() const;
-00033 
-00034     void startWrite(unsigned int address);
-00035     void write(uint8_t value);
-00036     bool endWrite();
-00037 
-00038     bool startRead(unsigned int address, unsigned int count);
-00039     unsigned int available();
-00040     uint8_t read();
-00041 
-00042 private:
-00043     uint8_t _dataPin;
-00044     uint8_t _clockPin;
-00045     bool started;
-00046     bool acked;
-00047     bool inWrite;
-00048     unsigned int readCount;
-00049 
-00050     void start();
-00051     void stop();
-00052     void writeBit(bool bit);
-00053     bool readBit();
-00054 };
-00055 
-00056 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -132,8 +77,78 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
SoftI2C.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef SoftI2C_h
+
24 #define SoftI2C_h
+
25 
+
26 #include "I2CMaster.h"
+
27 
+
28 class SoftI2C : public I2CMaster {
+
29 public:
+
30  SoftI2C(uint8_t dataPin, uint8_t clockPin);
+
31 
+
32  unsigned int maxTransferSize() const;
+
33 
+
34  void startWrite(unsigned int address);
+
35  void write(uint8_t value);
+
36  bool endWrite();
+
37 
+
38  bool startRead(unsigned int address, unsigned int count);
+
39  unsigned int available();
+
40  uint8_t read();
+
41 
+
42 private:
+
43  uint8_t _dataPin;
+
44  uint8_t _clockPin;
+
45  bool started;
+
46  bool acked;
+
47  bool inWrite;
+
48  unsigned int readCount;
+
49 
+
50  void start();
+
51  void stop();
+
52  void writeBit(bool bit);
+
53  bool readBit();
+
54 };
+
55 
+
56 #endif
+
+ + diff --git a/TextField_8cpp_source.html b/TextField_8cpp_source.html index ccb5b273..ed6f7c31 100644 --- a/TextField_8cpp_source.html +++ b/TextField_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: TextField.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
TextField.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "TextField.h"
-00024 
-00066 TextField::TextField(const String &label)
-00067     : Field(label)
-00068 {
-00069 }
-00070 
-00077 TextField::TextField(Form &form, const String &label, const String &value)
-00078     : Field(form, label)
-00079     , _value(value)
-00080 {
-00081 }
-00082 
-00083 void TextField::enterField(bool reverse)
-00084 {
-00085     Field::enterField(reverse);
-00086     lcd()->setCursor(0, 1);
-00087     lcd()->print(_value);
-00088 }
-00089 
-00102 void TextField::setValue(const String &value)
-00103 {
-00104     if (isCurrent()) {
-00105         unsigned int prevLen = _value.length();
-00106         unsigned int newLen = value.length();
-00107         _value = value;
-00108         lcd()->setCursor(0, 1);
-00109         lcd()->print(value);
-00110         while (newLen++ < prevLen)
-00111             lcd()->write(' ');
-00112     } else {
-00113         _value = value;
-00114     }
-00115 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -132,8 +77,78 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
TextField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "TextField.h"
+
24 
+
66 TextField::TextField(const String &label)
+
67  : Field(label)
+
68 {
+
69 }
+
70 
+
77 TextField::TextField(Form &form, const String &label, const String &value)
+
78  : Field(form, label)
+
79  , _value(value)
+
80 {
+
81 }
+
82 
+
83 void TextField::enterField(bool reverse)
+
84 {
+
85  Field::enterField(reverse);
+
86  lcd()->setCursor(0, 1);
+
87  lcd()->print(_value);
+
88 }
+
89 
+
102 void TextField::setValue(const String &value)
+
103 {
+
104  if (isCurrent()) {
+
105  unsigned int prevLen = _value.length();
+
106  unsigned int newLen = value.length();
+
107  _value = value;
+
108  lcd()->setCursor(0, 1);
+
109  lcd()->print(value);
+
110  while (newLen++ < prevLen)
+
111  lcd()->write(' ');
+
112  } else {
+
113  _value = value;
+
114  }
+
115 }
+
+ + diff --git a/TextField_8h_source.html b/TextField_8h_source.html index 2c7d0001..5f7fb68c 100644 --- a/TextField_8h_source.html +++ b/TextField_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: TextField.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
TextField.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef TextField_h
-00024 #define TextField_h
-00025 
-00026 #include "Field.h"
-00027 
-00028 class TextField : public Field {
-00029 public:
-00030     explicit TextField(const String &label);
-00031     TextField(Form &form, const String &label, const String &value);
-00032 
-00033     void enterField(bool reverse);
-00034 
-00035     const String &value() const { return _value; }
-00036     void setValue(const String &value);
-00037 
-00038 private:
-00039     String _value;
-00040 };
-00041 
-00042 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -118,8 +77,64 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
TextField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef TextField_h
+
24 #define TextField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 class TextField : public Field {
+
29 public:
+
30  explicit TextField(const String &label);
+
31  TextField(Form &form, const String &label, const String &value);
+
32 
+
33  void enterField(bool reverse);
+
34 
+
35  const String &value() const { return _value; }
+
36  void setValue(const String &value);
+
37 
+
38 private:
+
39  String _value;
+
40 };
+
41 
+
42 #endif
+
+ + diff --git a/TimeField_8cpp_source.html b/TimeField_8cpp_source.html index f80bd3ce..66ac9819 100644 --- a/TimeField_8cpp_source.html +++ b/TimeField_8cpp_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: TimeField.cpp Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
TimeField.cpp
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #include "TimeField.h"
-00024 
-00065 #define EDIT_HOUR           0
-00066 #define EDIT_MINUTE_TENS    1
-00067 #define EDIT_MINUTE         2
-00068 #define EDIT_SECOND_TENS    3
-00069 #define EDIT_SECOND         4
-00070 
-00082 TimeField::TimeField(const String &label)
-00083     : Field(label)
-00084     , _value(0)
-00085     , _maxHours(24)
-00086     , _printLen(0)
-00087     , _readOnly(false)
-00088     , editField(EDIT_HOUR)
-00089 {
-00090 }
-00091 
-00105 TimeField::TimeField(Form &form, const String &label, int maxHours, bool readOnly)
-00106     : Field(form, label)
-00107     , _value(0)
-00108     , _maxHours(maxHours)
-00109     , _printLen(0)
-00110     , _readOnly(readOnly)
-00111     , editField(EDIT_HOUR)
-00112 {
-00113 }
-00114 
-00115 int TimeField::dispatch(int event)
-00116 {
-00117     unsigned long newValue;
-00118     if (_readOnly)
-00119         return -1;
-00120     if (event == LCD_BUTTON_UP) {
-00121         newValue = _value;
-00122         if (editField == EDIT_HOUR) {
-00123             newValue += 60 * 60;
-00124         } else if (editField == EDIT_MINUTE_TENS) {
-00125             if (((newValue / 60) % 60) >= 50)
-00126                 newValue -= 50 * 60;
-00127             else
-00128                 newValue += 10 * 60;
-00129         } else if (editField == EDIT_MINUTE) {
-00130             if (((newValue / 60) % 60) == 59)
-00131                 newValue -= 59 * 60;
-00132             else
-00133                 newValue += 60;
-00134         } else if (editField == EDIT_SECOND_TENS) {
-00135             if ((newValue % 60) >= 50)
-00136                 newValue -= 50;
-00137             else
-00138                 newValue += 10;
-00139         } else {
-00140             if ((newValue % 60) == 59)
-00141                 newValue -= 59;
-00142             else
-00143                 newValue += 1;
-00144         }
-00145         setValue(newValue);
-00146         return FORM_CHANGED;
-00147     } else if (event == LCD_BUTTON_DOWN) {
-00148         newValue = _value;
-00149         if (editField == EDIT_HOUR) {
-00150             if (newValue < 60 * 60)
-00151                 newValue += ((unsigned long)(_maxHours - 1)) * 60 * 60;
-00152             else
-00153                 newValue -= 60 * 60;
-00154         } else if (editField == EDIT_MINUTE_TENS) {
-00155             if (((newValue / 60) % 60) < 10)
-00156                 newValue += 50 * 60;
-00157             else
-00158                 newValue -= 10 * 60;
-00159         } else if (editField == EDIT_MINUTE) {
-00160             if (((newValue / 60) % 60) == 0)
-00161                 newValue += 59 * 60;
-00162             else
-00163                 newValue -= 60;
-00164         } else if (editField == EDIT_SECOND_TENS) {
-00165             if ((newValue % 60) < 10)
-00166                 newValue += 50;
-00167             else
-00168                 newValue -= 10;
-00169         } else {
-00170             if ((newValue % 60) == 0)
-00171                 newValue += 59;
-00172             else
-00173                 newValue -= 1;
-00174         }
-00175         setValue(newValue);
-00176         return FORM_CHANGED;
-00177     } else if (event == LCD_BUTTON_LEFT) {
-00178         if (editField != EDIT_HOUR) {
-00179             --editField;
-00180             printTime();
-00181             return 0;
-00182         }
-00183     } else if (event == LCD_BUTTON_RIGHT) {
-00184         if (editField != EDIT_SECOND) {
-00185             ++editField;
-00186             printTime();
-00187             return 0;
-00188         }
-00189     }
-00190     return -1;
-00191 }
-00192 
-00193 void TimeField::enterField(bool reverse)
-00194 {
-00195     Field::enterField(reverse);
-00196     if (reverse)
-00197         editField = EDIT_SECOND;
-00198     else
-00199         editField = EDIT_HOUR;
-00200     printTime();
-00201     if (!_readOnly)
-00202         lcd()->cursor();
-00203 }
-00204 
-00205 void TimeField::exitField()
-00206 {
-00207     if (!_readOnly)
-00208         lcd()->noCursor();
-00209     Field::exitField();
-00210 }
-00211 
-00227 void TimeField::setValue(unsigned long value)
-00228 {
-00229     unsigned long maxSecs = ((unsigned long)_maxHours) * 60 * 60;
-00230     value %= maxSecs;
-00231     if (value != _value) {
-00232         _value = value;
-00233         if (isCurrent())
-00234             printTime();
-00235     }
-00236 }
-00237 
-00268 void TimeField::setReadOnly(bool value)
-00269 {
-00270     if (_readOnly != value) {
-00271         _readOnly = value;
-00272         printTime();
-00273         if (isCurrent()) {
-00274             if (value)
-00275                 lcd()->cursor();
-00276             else
-00277                 lcd()->noCursor();
-00278         }
-00279     }
-00280 }
-00281 
-00282 void TimeField::printTime()
-00283 {
-00284     lcd()->setCursor(0, 1);
-00285     int col = printField(_value / (60 * 60));
-00286     int hourCol = col - 1;
-00287     lcd()->write(':');
-00288     ++col;
-00289     col += printField((_value / 60) % 60);
-00290     int minuteCol = col - 1;
-00291     lcd()->write(':');
-00292     ++col;
-00293     col += printField(_value % 60);
-00294     int secondCol = col - 1;
-00295     int tempCol = col;
-00296     while (tempCol++ < _printLen)
-00297         lcd()->write(' ');
-00298     _printLen = col;
-00299     if (!_readOnly) {
-00300         if (editField == EDIT_HOUR)
-00301             lcd()->setCursor(hourCol, 1);
-00302         else if (editField == EDIT_MINUTE_TENS)
-00303             lcd()->setCursor(minuteCol - 1, 1);
-00304         else if (editField == EDIT_MINUTE)
-00305             lcd()->setCursor(minuteCol, 1);
-00306         else if (editField == EDIT_SECOND_TENS)
-00307             lcd()->setCursor(secondCol - 1, 1);
-00308         else
-00309             lcd()->setCursor(secondCol, 1);
-00310     }
-00311 }
-00312 
-00313 int TimeField::printField(unsigned long value)
-00314 {
-00315     if (value < 100) {
-00316         lcd()->write('0' + (int)(value / 10));
-00317         lcd()->write('0' + (int)(value % 10));
-00318         return 2;
-00319     }
-00320     unsigned long divisor = 100;
-00321     while ((value / divisor) >= 10)
-00322         divisor *= 10;
-00323     int digits = 0;
-00324     while (divisor > 0) {
-00325         lcd()->write('0' + (int)((value / divisor) % 10));
-00326         divisor /= 10;
-00327         ++digits;
-00328     }
-00329     return digits;
-00330 }
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -297,8 +77,243 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
TimeField.cpp
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #include "TimeField.h"
+
24 
+
65 #define EDIT_HOUR 0
+
66 #define EDIT_MINUTE_TENS 1
+
67 #define EDIT_MINUTE 2
+
68 #define EDIT_SECOND_TENS 3
+
69 #define EDIT_SECOND 4
+
70 
+
82 TimeField::TimeField(const String &label)
+
83  : Field(label)
+
84  , _value(0)
+
85  , _maxHours(24)
+
86  , _printLen(0)
+
87  , _readOnly(false)
+
88  , editField(EDIT_HOUR)
+
89 {
+
90 }
+
91 
+
105 TimeField::TimeField(Form &form, const String &label, int maxHours, bool readOnly)
+
106  : Field(form, label)
+
107  , _value(0)
+
108  , _maxHours(maxHours)
+
109  , _printLen(0)
+
110  , _readOnly(readOnly)
+
111  , editField(EDIT_HOUR)
+
112 {
+
113 }
+
114 
+
115 int TimeField::dispatch(int event)
+
116 {
+
117  unsigned long newValue;
+
118  if (_readOnly)
+
119  return -1;
+
120  if (event == LCD_BUTTON_UP) {
+
121  newValue = _value;
+
122  if (editField == EDIT_HOUR) {
+
123  newValue += 60 * 60;
+
124  } else if (editField == EDIT_MINUTE_TENS) {
+
125  if (((newValue / 60) % 60) >= 50)
+
126  newValue -= 50 * 60;
+
127  else
+
128  newValue += 10 * 60;
+
129  } else if (editField == EDIT_MINUTE) {
+
130  if (((newValue / 60) % 60) == 59)
+
131  newValue -= 59 * 60;
+
132  else
+
133  newValue += 60;
+
134  } else if (editField == EDIT_SECOND_TENS) {
+
135  if ((newValue % 60) >= 50)
+
136  newValue -= 50;
+
137  else
+
138  newValue += 10;
+
139  } else {
+
140  if ((newValue % 60) == 59)
+
141  newValue -= 59;
+
142  else
+
143  newValue += 1;
+
144  }
+
145  setValue(newValue);
+
146  return FORM_CHANGED;
+
147  } else if (event == LCD_BUTTON_DOWN) {
+
148  newValue = _value;
+
149  if (editField == EDIT_HOUR) {
+
150  if (newValue < 60 * 60)
+
151  newValue += ((unsigned long)(_maxHours - 1)) * 60 * 60;
+
152  else
+
153  newValue -= 60 * 60;
+
154  } else if (editField == EDIT_MINUTE_TENS) {
+
155  if (((newValue / 60) % 60) < 10)
+
156  newValue += 50 * 60;
+
157  else
+
158  newValue -= 10 * 60;
+
159  } else if (editField == EDIT_MINUTE) {
+
160  if (((newValue / 60) % 60) == 0)
+
161  newValue += 59 * 60;
+
162  else
+
163  newValue -= 60;
+
164  } else if (editField == EDIT_SECOND_TENS) {
+
165  if ((newValue % 60) < 10)
+
166  newValue += 50;
+
167  else
+
168  newValue -= 10;
+
169  } else {
+
170  if ((newValue % 60) == 0)
+
171  newValue += 59;
+
172  else
+
173  newValue -= 1;
+
174  }
+
175  setValue(newValue);
+
176  return FORM_CHANGED;
+
177  } else if (event == LCD_BUTTON_LEFT) {
+
178  if (editField != EDIT_HOUR) {
+
179  --editField;
+
180  printTime();
+
181  return 0;
+
182  }
+
183  } else if (event == LCD_BUTTON_RIGHT) {
+
184  if (editField != EDIT_SECOND) {
+
185  ++editField;
+
186  printTime();
+
187  return 0;
+
188  }
+
189  }
+
190  return -1;
+
191 }
+
192 
+
193 void TimeField::enterField(bool reverse)
+
194 {
+
195  Field::enterField(reverse);
+
196  if (reverse)
+
197  editField = EDIT_SECOND;
+
198  else
+
199  editField = EDIT_HOUR;
+
200  printTime();
+
201  if (!_readOnly)
+
202  lcd()->cursor();
+
203 }
+
204 
+ +
206 {
+
207  if (!_readOnly)
+
208  lcd()->noCursor();
+ +
210 }
+
211 
+
227 void TimeField::setValue(unsigned long value)
+
228 {
+
229  unsigned long maxSecs = ((unsigned long)_maxHours) * 60 * 60;
+
230  value %= maxSecs;
+
231  if (value != _value) {
+
232  _value = value;
+
233  if (isCurrent())
+
234  printTime();
+
235  }
+
236 }
+
237 
+
268 void TimeField::setReadOnly(bool value)
+
269 {
+
270  if (_readOnly != value) {
+
271  _readOnly = value;
+
272  printTime();
+
273  if (isCurrent()) {
+
274  if (value)
+
275  lcd()->cursor();
+
276  else
+
277  lcd()->noCursor();
+
278  }
+
279  }
+
280 }
+
281 
+
282 void TimeField::printTime()
+
283 {
+
284  lcd()->setCursor(0, 1);
+
285  int col = printField(_value / (60 * 60));
+
286  int hourCol = col - 1;
+
287  lcd()->write(':');
+
288  ++col;
+
289  col += printField((_value / 60) % 60);
+
290  int minuteCol = col - 1;
+
291  lcd()->write(':');
+
292  ++col;
+
293  col += printField(_value % 60);
+
294  int secondCol = col - 1;
+
295  int tempCol = col;
+
296  while (tempCol++ < _printLen)
+
297  lcd()->write(' ');
+
298  _printLen = col;
+
299  if (!_readOnly) {
+
300  if (editField == EDIT_HOUR)
+
301  lcd()->setCursor(hourCol, 1);
+
302  else if (editField == EDIT_MINUTE_TENS)
+
303  lcd()->setCursor(minuteCol - 1, 1);
+
304  else if (editField == EDIT_MINUTE)
+
305  lcd()->setCursor(minuteCol, 1);
+
306  else if (editField == EDIT_SECOND_TENS)
+
307  lcd()->setCursor(secondCol - 1, 1);
+
308  else
+
309  lcd()->setCursor(secondCol, 1);
+
310  }
+
311 }
+
312 
+
313 int TimeField::printField(unsigned long value)
+
314 {
+
315  if (value < 100) {
+
316  lcd()->write('0' + (int)(value / 10));
+
317  lcd()->write('0' + (int)(value % 10));
+
318  return 2;
+
319  }
+
320  unsigned long divisor = 100;
+
321  while ((value / divisor) >= 10)
+
322  divisor *= 10;
+
323  int digits = 0;
+
324  while (divisor > 0) {
+
325  lcd()->write('0' + (int)((value / divisor) % 10));
+
326  divisor /= 10;
+
327  ++digits;
+
328  }
+
329  return digits;
+
330 }
+
+ + diff --git a/TimeField_8h_source.html b/TimeField_8h_source.html index 46825138..8ec2bd78 100644 --- a/TimeField_8h_source.html +++ b/TimeField_8h_source.html @@ -2,29 +2,37 @@ + ArduinoLibs: TimeField.h Source File + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
TimeField.h
-
-
-
00001 /*
-00002  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
-00003  *
-00004  * Permission is hereby granted, free of charge, to any person obtaining a
-00005  * copy of this software and associated documentation files (the "Software"),
-00006  * to deal in the Software without restriction, including without limitation
-00007  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
-00008  * and/or sell copies of the Software, and to permit persons to whom the
-00009  * Software is furnished to do so, subject to the following conditions:
-00010  *
-00011  * The above copyright notice and this permission notice shall be included
-00012  * in all copies or substantial portions of the Software.
-00013  *
-00014  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-00015  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-00016  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-00017  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-00019  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-00020  * DEALINGS IN THE SOFTWARE.
-00021  */
-00022 
-00023 #ifndef TimeField_h
-00024 #define TimeField_h
-00025 
-00026 #include "Field.h"
-00027 
-00028 #define TIMEFIELD_READ_ONLY     true
-00029 #define TIMEFIELD_READ_WRITE    false
-00030 
-00031 class TimeField : public Field {
-00032 public:
-00033     explicit TimeField(const String &label);
-00034     TimeField(Form &form, const String &label, int maxHours, bool readOnly);
-00035 
-00036     int dispatch(int event);
-00037 
-00038     void enterField(bool reverse);
-00039     void exitField();
-00040 
-00041     unsigned long value() const { return _value; }
-00042     void setValue(unsigned long value);
-00043 
-00044     int maxHours() const { return _maxHours; }
-00045     void setMaxHours(int maxHours) { _maxHours = maxHours; }
-00046 
-00047     bool readOnly() const { return _readOnly; }
-00048     void setReadOnly(bool value);
-00049 
-00050 private:
-00051     unsigned long _value;
-00052     int _maxHours;
-00053     int _printLen;
-00054     bool _readOnly;
-00055     uint8_t editField;
-00056 
-00057     void printTime();
-00058     int printField(unsigned long value);
-00059 };
-00060 
-00061 #endif
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -137,8 +77,83 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + + +
+
+
TimeField.h
+
+
+
1 /*
+
2  * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
+
3  *
+
4  * Permission is hereby granted, free of charge, to any person obtaining a
+
5  * copy of this software and associated documentation files (the "Software"),
+
6  * to deal in the Software without restriction, including without limitation
+
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+
8  * and/or sell copies of the Software, and to permit persons to whom the
+
9  * Software is furnished to do so, subject to the following conditions:
+
10  *
+
11  * The above copyright notice and this permission notice shall be included
+
12  * in all copies or substantial portions of the Software.
+
13  *
+
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+
20  * DEALINGS IN THE SOFTWARE.
+
21  */
+
22 
+
23 #ifndef TimeField_h
+
24 #define TimeField_h
+
25 
+
26 #include "Field.h"
+
27 
+
28 #define TIMEFIELD_READ_ONLY true
+
29 #define TIMEFIELD_READ_WRITE false
+
30 
+
31 class TimeField : public Field {
+
32 public:
+
33  explicit TimeField(const String &label);
+
34  TimeField(Form &form, const String &label, int maxHours, bool readOnly);
+
35 
+
36  int dispatch(int event);
+
37 
+
38  void enterField(bool reverse);
+
39  void exitField();
+
40 
+
41  unsigned long value() const { return _value; }
+
42  void setValue(unsigned long value);
+
43 
+
44  int maxHours() const { return _maxHours; }
+
45  void setMaxHours(int maxHours) { _maxHours = maxHours; }
+
46 
+
47  bool readOnly() const { return _readOnly; }
+
48  void setReadOnly(bool value);
+
49 
+
50 private:
+
51  unsigned long _value;
+
52  int _maxHours;
+
53  int _printLen;
+
54  bool _readOnly;
+
55  uint8_t editField;
+
56 
+
57  void printTime();
+
58  int printField(unsigned long value);
+
59 };
+
60 
+
61 #endif
+
+ + diff --git a/alarm-clock_8dox.html b/alarm-clock_8dox.html index a949dc07..01ed0ff7 100644 --- a/alarm-clock_8dox.html +++ b/alarm-clock_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: alarm-clock.dox File Reference + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
alarm-clock.dox File Reference
-
-
- -
-

Detailed Description

-
-

Definition in file alarm-clock.dox.

-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + +
+
+
alarm-clock.dox File Reference
+
+
+

Detailed Description

+
+

Definition in file alarm-clock.dox.

+
+ + diff --git a/alarm_clock.html b/alarm_clock.html index d42a4327..ba3126fb 100644 --- a/alarm_clock.html +++ b/alarm_clock.html @@ -2,29 +2,37 @@ + ArduinoLibs: Alarm Clock + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + + + + + +
+
+ +
Alarm Clock
-
+
-

-Features

+

+Features

The alarm clock described on this page is a large example application that uses many of the classes in the provided libraries: LCD, Form, Field, SoftI2C, DS1307RTC (or DS3232RTC), Melody and PowerSave. The clock has the following features:

  • Displays both the time and date.
  • @@ -70,8 +92,8 @@ Features
  • Up, down, left, and right buttons to change clock settings.
  • MOSFET that controls the power to a separate radio circuit.
-

-Main circuit

+

+Main circuit

The main clock circuit consists of an Arduino Uno compatible board, a 16x2 LCD module, a realtime clock chip, a piezo buzzer for the alarm, and a MOSFET for controlling the radio:

alarm_circuit.png @@ -82,25 +104,25 @@ Main circuit clock_shield.jpg

The clock module is based on the DS1307 chip and has an on-board coin battery to keep the time and date ticking over even if the main circuit loses power. The chip is I2C-based and has an auxillary SQW output that can be configured to provide a 1 Hz squarewave signal. This signal is used by the software running on the Arduino to detect when a new time or date is available for display on the LCD. The DS1307RTC class takes care of the details of talking to the chip via I2C.

-

-Arduino board

+

+Arduino board

To keep power consumption low, say for being powered by batteries, we don't need a full Arduino Uno or similar board. The USB interface is unnecessary, as is the on-board power supply if there is an external source of 5 volt power. We also don't want the power and D13 status LED's to be draining power. Therefore, a cut-down version of the Arduino is recommended. We used the KitTen kit from Freetronics, and didn't solder up anything that wasn't strictly necessary. A 5v FTDI USB-to-Serial cable is necessary for programming. Similar minimalistic built-it-yourself Arduino designs should also work.

kitten_minimal.jpg
-

-Controlling a radio

+

+Controlling a radio

The MOSFET connected to D11 can be used to control the power supply to a separate radio circuit so that the radio can be used as an alarm. In the following circuit, RadioV+ is the radio's power supply voltage (which may be the Arduino's 5V supply if the radio can run off 5V):

radio_controller.png

The output of the MOSFET can be used to control almost any kind of circuit; for example an extremely loud mechanical alarm bell. It doesn't have to be a radio. A 2N7000 or equivalent MOSFET is suitable for light loads up to 200mA. For larger currents, a higher-rated MOSFET should be used instead.

Double-tapping the Stop Alarm button will turn the radio on. Single-tapping the Stop Alarm button will turn the radio off. A settings field can also be used to turn the radio on and off.

-

-Using DS3232 instead of DS1307

+

+Using DS3232 instead of DS1307

For clock modules based on the DS3232 chip, such as the Freetronics Real Time Clock Module, change the Clock typedef in Clock.h to the following:

-
typedef DS3232RTC Clock;
-

The pads on the Freetronics module should be connected to the Arduino as follows:

+
typedef DS3232RTC Clock;
+

The pads on the Freetronics module should be connected to the Arduino as follows:

  • VCC and GND connected to 5V and GND on the Arduino.
  • SQI connected to A3.
  • @@ -108,29 +130,18 @@ Using DS3232 instead of DS1307
  • SCL connected to A5.
  • BAT, 32K, and RST left unconnected.
-

-Completed Clock

+

+Completed Clock

The following picture shows the completed clock prototype, built into a UB1 jiffy box with the radio. Being the prototype, it is a little rough and ready, but rugged enough to take a pounding each morning as a bedside alarm clock:

alarm_clock.jpg
-
- - - - -
- -
- - +
+ + diff --git a/annotated.html b/annotated.html index 6bcc1a5c..a144a4b5 100644 --- a/annotated.html +++ b/annotated.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class List + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
Class List
-
-
-
Here are the classes, structs, unions and interfaces with brief descriptions:
- - - - - - - - - - - - - - - - - - - - - - - - -
BitmapRepresents a monochrome bitmap within main memory
BlinkLEDBlink a LED on a digital output pin
BoolFieldField that manages the input of a boolean value
CharlieplexManage an array of LED's in a charlieplexed arrangement
ChaseLEDsChase LED's on output pins in a defined sequence
DMDHandle large dot matrix displays composed of LED's
DS1307RTCCommunicates with a DS1307 realtime clock chip via I2C
DS3232RTCCommunicates with a DS3232 realtime clock chip via I2C
EEPROM24Reading and writing EEPROM's from the 24LCXX family
FieldManages a single data input/output field within a Form
FormManager for a form containing data input/output fields
I2CMasterAbstract base class for I2C master implementations
IntFieldField that manages the input of an integer value
IRreceiverManages the reception of RC-5 commands from an infrared remote control
LCDEnhanced library for Freetronics 16x2 LCD shields
ListFieldField that manages selection from a static list of items
MelodyPlays a melody on a digital output pin using tone()
RTCBase class for realtime clock handlers
RTCAlarmStores alarm information from a realtime clock chip
RTCDateStores date information from a realtime clock chip
RTCTimeStores time information from a realtime clock chip
SoftI2CBit-banged implementation of an I2C master
TextFieldField that displays a read-only text value
TimeFieldField that manages the display and editing of a time value
-
+
- All Classes Files Functions Variables Typedefs Enumerations Enumerator
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -105,8 +81,45 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- +
+
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+ + + + + + + + + + + + + + + + + + + + + + + + + +
oCBitmapRepresents a monochrome bitmap within main memory
oCBlinkLEDBlink a LED on a digital output pin
oCBoolFieldField that manages the input of a boolean value
oCCharlieplexManage an array of LED's in a charlieplexed arrangement
oCChaseLEDsChase LED's on output pins in a defined sequence
oCDMDHandle large dot matrix displays composed of LED's
oCDS1307RTCCommunicates with a DS1307 realtime clock chip via I2C
oCDS3232RTCCommunicates with a DS3232 realtime clock chip via I2C
oCEEPROM24Reading and writing EEPROM's from the 24LCXX family
oCFieldManages a single data input/output field within a Form
oCFormManager for a form containing data input/output fields
oCI2CMasterAbstract base class for I2C master implementations
oCIntFieldField that manages the input of an integer value
oCIRreceiverManages the reception of RC-5 commands from an infrared remote control
oCLCDEnhanced library for Freetronics 16x2 LCD shields
oCListFieldField that manages selection from a static list of items
oCMelodyPlays a melody on a digital output pin using tone()
oCRTCBase class for realtime clock handlers
oCRTCAlarmStores alarm information from a realtime clock chip
oCRTCDateStores date information from a realtime clock chip
oCRTCTimeStores time information from a realtime clock chip
oCSoftI2CBit-banged implementation of an I2C master
oCTextFieldField that displays a read-only text value
\CTimeFieldField that manages the display and editing of a time value
+
+
+ + diff --git a/bc_s.png b/bc_s.png index e4018628b5b45cb4301037485a29d7d74ac22138..25e3beb4cc756e7e822c731ecc959f571bbfa472 100644 GIT binary patch delta 656 zcmV;B0&o4L1*ip(B!6#7L_t(|0qvblOcOyA$KUKuySt_Bc1!tCN@;7cQZ-(T2SaGW z#e*S45_%95gAxrYRWw$E8e+smjWK>;IC$Vdh+cshzd!H;@T3BvxZOa}m>At|;b2Nk zOr71>ri0u(PyR3OP2O*2^4`9^qnYzbWACZR5~bjaQO5GkfZTtPU3f_^D2%*m#{Z5u)PM6H=d|Z&@3}{X$yy7K?|RqTm&s|PlkAqd zJ%vC|xvR*6G1IT6Gvh|9Te=?Pl4KZ=vc5{v<6wMVGX|L5T${h4U9$6)0*@zV=hFlE zd5FaB=YQhaK&3-(bIYe>IzJ?AX!~y6*9#nO7HwRHBxBS}HXR?){h+(d7PJU>Ku)G_ zP{6LvkrMLNlz>On_dYqfs8K-UvEh?0hY)d!+_b!~*a`rYP(ySm;j0jNj8P=9uxQjy q{Wzqh%M1cdPHO)o0RaBr{s6_0vTt95b4&mL00{s|MNUMnLSTY!k32;H delta 653 zcmV;80&@MR1*HX$B!6s4L_t(|0qxyONK|bY2k`&%o_A)>8E59q8L#Cyj?kXSitLLZr4T(fwlOrBykKmotNoMi6;Cql*{` z!W5ce=IFBRvw0u*|IYKC#q;i|{lUlOo&IzH@Q0`4r^X#gpJ zE_Vz9fSHKqclcZaV^k3gX%h+1`u||OZ+B z;_TE|c=0K<+!-)}cFoH7~ zid3JaNTG=ty@rmqJvV}&-{Z8IIBS@k(O=V%tIv|dGONfRdbc`OCT8?P01$SUA5I4C zIT>kI&RLfhjST|;)wMo}hc1CpczeDA07a9t`T_t5yUG$18Wo3_Cy9JyYBt)P*oWG{ z<9I*i&wq1DfTKVI45w7J>re diff --git a/bdwn.png b/bdwn.png new file mode 100644 index 0000000000000000000000000000000000000000..940a0b950443a0bb1b216ac03c45b8a16c955452 GIT binary patch literal 147 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)H!3HEvS)PKZC{Gv1kP61Pb5HX&C2wk~_T + ArduinoLibs: blink-blink.dox File Reference + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
blink-blink.dox File Reference
-
-
- -
-

Detailed Description

-
-

Definition in file blink-blink.dox.

-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + +
+
+
blink-blink.dox File Reference
+
+
+

Detailed Description

+
+

Definition in file blink-blink.dox.

+
+ + diff --git a/blink-charlieplex_8dox.html b/blink-charlieplex_8dox.html index df32be04..6eb5ff41 100644 --- a/blink-charlieplex_8dox.html +++ b/blink-charlieplex_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: blink-charlieplex.dox File Reference + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
blink-charlieplex.dox File Reference
-
-
- -
-

Detailed Description

-
-

Definition in file blink-charlieplex.dox.

-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + +
+
+
blink-charlieplex.dox File Reference
+
+
+

Detailed Description

+
+

Definition in file blink-charlieplex.dox.

+
+ + diff --git a/blink-cylon_8dox.html b/blink-cylon_8dox.html index 3984b49e..c9c1b3ef 100644 --- a/blink-cylon_8dox.html +++ b/blink-cylon_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: blink-cylon.dox File Reference + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
blink-cylon.dox File Reference
-
-
- -
-

Detailed Description

-
-

Definition in file blink-cylon.dox.

-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + +
+
+
blink-cylon.dox File Reference
+
+
+

Detailed Description

+
+

Definition in file blink-cylon.dox.

+
+ + diff --git a/blink-startrek_8dox.html b/blink-startrek_8dox.html index 9e65317a..27c9f4d3 100644 --- a/blink-startrek_8dox.html +++ b/blink-startrek_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: blink-startrek.dox File Reference + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
blink-startrek.dox File Reference
-
-
- -
-

Detailed Description

-
-

Definition in file blink-startrek.dox.

-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + +
+
+
blink-startrek.dox File Reference
+
+
+

Detailed Description

+
+

Definition in file blink-startrek.dox.

+
+ + diff --git a/blink_blink.html b/blink_blink.html index dad309e8..da7bd184 100644 --- a/blink_blink.html +++ b/blink_blink.html @@ -2,29 +2,37 @@ + ArduinoLibs: Blinking LED Example + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
Blinking LED Example
-
-
-

The BlinkLED class provides support logic for blinking a LED connected to an output pin. The traditional way to blink a LED uses a delay loop:

-
void loop() {
-    digitalWrite(13, HIGH);
-    delay(1000);
-    digitalWrite(13, LOW);
-    delay(1000);
-}
-

The problem with this code is that the entire application is blocked during the delay(). No other activities can be serviced. BlinkLED provides a re-entrant timer-based implementation that is simple to use in any application and which won't block other activities.

-

We start this example by including the BlinkLED class and instantiating an object instance:

-
#include <BlinkLED.h>
-
-BlinkLED statusBlink(13, 70, 930);
-

-

In this example we have specified that the LED is on pin D13, the LED should be on for 70 milliseconds, and off for 930 milliseconds. This will cause the status LED to "strobe" once per second. The LED will be initially off for 930 milliseconds after device reset. To start with the LED on, use the following initialization code instead:

-
BlinkLED statusBlink(13, 70, 930, true);
-

The remaining code we need is a call to BlinkLED::loop() every time around the main application loop:

-
void loop() {
-  statusBlink.loop();
-}
-

-

As can be seen, BlinkLED simplifies the process of blinking a LED quite considerably. It is also possible to pause() and resume() the blinking. This is useful in applications where a blinking LED indicates a certain state such as an error condition or a long-running operation that is in progress; with the LED off at other times. The on/off blink rate can be modified at runtime using BlinkLED::setBlinkRate(), and the LED can be set to a specific value using BlinkLED::setState().

-

The full source code for the example follows:

-
/*
-Blink the status LED using the BlinkLED utility class.
-
-This example is placed into the public domain.
-*/
-
-#include <BlinkLED.h>
-
-BlinkLED statusBlink(13, 70, 930);
-
-void setup() {}
-
-void loop() {
-  statusBlink.loop();
-}
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -109,8 +72,56 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
- + +
+
+
Blinking LED Example
+
+
+

The BlinkLED class provides support logic for blinking a LED connected to an output pin. The traditional way to blink a LED uses a delay loop:

+
void loop() {
+
digitalWrite(13, HIGH);
+
delay(1000);
+
digitalWrite(13, LOW);
+
delay(1000);
+
}
+

The problem with this code is that the entire application is blocked during the delay(). No other activities can be serviced. BlinkLED provides a re-entrant timer-based implementation that is simple to use in any application and which won't block other activities.

+

We start this example by including the BlinkLED class and instantiating an object instance:

+
#include <BlinkLED.h>
+
+
BlinkLED statusBlink(13, 70, 930);
+

+

In this example we have specified that the LED is on pin D13, the LED should be on for 70 milliseconds, and off for 930 milliseconds. This will cause the status LED to "strobe" once per second. The LED will be initially off for 930 milliseconds after device reset. To start with the LED on, use the following initialization code instead:

+
BlinkLED statusBlink(13, 70, 930, true);
+

The remaining code we need is a call to BlinkLED::loop() every time around the main application loop:

+
void loop() {
+
statusBlink.loop();
+
}
+

+

As can be seen, BlinkLED simplifies the process of blinking a LED quite considerably. It is also possible to pause() and resume() the blinking. This is useful in applications where a blinking LED indicates a certain state such as an error condition or a long-running operation that is in progress; with the LED off at other times. The on/off blink rate can be modified at runtime using BlinkLED::setBlinkRate(), and the LED can be set to a specific value using BlinkLED::setState().

+

The full source code for the example follows:

+
/*
+
Blink the status LED using the BlinkLED utility class.
+
+
This example is placed into the public domain.
+
*/
+
+
#include <BlinkLED.h>
+
+
BlinkLED statusBlink(13, 70, 930);
+
+
void setup() {}
+
+
void loop() {
+
statusBlink.loop();
+
}
+
+
+ + diff --git a/blink_charlieplex.html b/blink_charlieplex.html index 5ff72a88..b593ba21 100644 --- a/blink_charlieplex.html +++ b/blink_charlieplex.html @@ -2,29 +2,37 @@ + ArduinoLibs: Charlieplexing Example + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
Charlieplexing Example
-
-
-

Charlieplexing is a technique for multiplexing large numbers of LED's on a small number of microcontroller output pins. LED's are arranged in complementary pairs and managed by the Charlieplex class. For this example we are going to use 3 output pins to drive 6 LED's:

-
-charlieplexeg.png -
-

The technique can be expanded to even larger numbers of LED's. See the documentation for the Charlieplex class for a description of how to connect up larger numbers of pins in a Charlieplexed arrangement.

-

The first step is to initialize a Charlieplex object with the output pins it needs to drive:

-
#include <Charlieplex.h>
-
-byte pins[3] = {9, 10, 11};
-Charlieplex charlie(pins, sizeof(pins));
-

-

Then in setup() we use Charlieplex::setLed() and Charlieplex::setPwmLed() to set three of the six LED's to the desired output values:

-
void setup() {
-    charlie.setLed(0, true);    // Turn on LED1
-    charlie.setLed(3, true);    // Turn on LED4
-    charlie.setPwmLed(5, 64);   // Set LED6 to one-quarter on
-}
-

-

Charlieplexing can only light a single LED at a time. It is therefore necessary to constantly scan the entire LED array, alternatively turning LED's on and off. The user's peristence of vision fills in the gaps. To do this, we call Charlieplex::loop():

-
void loop() {
-    charlie.loop();
-}
-

-

The downside of Charlieplexing is that when multiple LED's are lit, each LED will appear to be dimmer than if only a single LED was lit. This can be counteracted by using brighter LED's or smaller resistors. The danger with smaller resistors is that if the program crashes or locks up for some reason, a large amount of continuous current could be fed through a single LED and cause it to exceed its maximum rating and burn out.

-

The full source code for the example follows:

-
/* This example is placed into the public domain */
-
-#include <Charlieplex.h>
-
-byte pins[3] = {9, 10, 11};
-Charlieplex charlie(pins, sizeof(pins));
-
-void setup() {
-    charlie.setLed(0, true);    // Turn on LED1
-    charlie.setLed(3, true);    // Turn on LED4
-    charlie.setPwmLed(5, 64);   // Set LED6 to one-quarter on
-}
-
-void loop() {
-    charlie.loop();
-}
-

A more complex example that performs a LED chase over the 6 LED's follows:

-
/* This example is placed into the public domain */
-
-#include <Charlieplex.h>
-
-byte pins[3] = {9, 10, 11};
-Charlieplex charlie(pins, sizeof(pins));
-
-int previous = 1;
-int current = 0;
-int step = 1;
-unsigned long lastTime;
-
-void setup() {
-    lastTime = millis();
-    charlie.setLed(current, true);
-    charlie.setPwmLed(previous, 64);
-}
-
-void loop() {
-    if ((millis() - lastTime) >= 100) {
-        charlie.setLed(previous, false);
-        charlie.setPwmLed(current, 64);
-        previous = current;
-        current += step;
-        if (current < 0) {
-            current = 1;
-            step = 1;
-        } else if (current >= charlie.count()) {
-            current = charlie.count() - 2;
-            step = -1;
-        }
-        charlie.setLed(current, true);
-        lastTime += 100;
-    }
-    charlie.loop();
-}
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -149,8 +72,96 @@ byte pins[3] = {9, 10, 11};
- + +
+
+
Charlieplexing Example
+
+
+

Charlieplexing is a technique for multiplexing large numbers of LED's on a small number of microcontroller output pins. LED's are arranged in complementary pairs and managed by the Charlieplex class. For this example we are going to use 3 output pins to drive 6 LED's:

+
+charlieplexeg.png +
+

The technique can be expanded to even larger numbers of LED's. See the documentation for the Charlieplex class for a description of how to connect up larger numbers of pins in a Charlieplexed arrangement.

+

The first step is to initialize a Charlieplex object with the output pins it needs to drive:

+
#include <Charlieplex.h>
+
+
byte pins[3] = {9, 10, 11};
+
Charlieplex charlie(pins, sizeof(pins));
+

+

Then in setup() we use Charlieplex::setLed() and Charlieplex::setPwmLed() to set three of the six LED's to the desired output values:

+
void setup() {
+
charlie.setLed(0, true); // Turn on LED1
+
charlie.setLed(3, true); // Turn on LED4
+
charlie.setPwmLed(5, 64); // Set LED6 to one-quarter on
+
}
+

+

Charlieplexing can only light a single LED at a time. It is therefore necessary to constantly scan the entire LED array, alternatively turning LED's on and off. The user's peristence of vision fills in the gaps. To do this, we call Charlieplex::loop():

+
void loop() {
+
charlie.loop();
+
}
+

+

The downside of Charlieplexing is that when multiple LED's are lit, each LED will appear to be dimmer than if only a single LED was lit. This can be counteracted by using brighter LED's or smaller resistors. The danger with smaller resistors is that if the program crashes or locks up for some reason, a large amount of continuous current could be fed through a single LED and cause it to exceed its maximum rating and burn out.

+

The full source code for the example follows:

+
/* This example is placed into the public domain */
+
+
#include <Charlieplex.h>
+
+
byte pins[3] = {9, 10, 11};
+
Charlieplex charlie(pins, sizeof(pins));
+
+
void setup() {
+
charlie.setLed(0, true); // Turn on LED1
+
charlie.setLed(3, true); // Turn on LED4
+
charlie.setPwmLed(5, 64); // Set LED6 to one-quarter on
+
}
+
+
void loop() {
+
charlie.loop();
+
}
+

A more complex example that performs a LED chase over the 6 LED's follows:

+
/* This example is placed into the public domain */
+
+
#include <Charlieplex.h>
+
+
byte pins[3] = {9, 10, 11};
+
Charlieplex charlie(pins, sizeof(pins));
+
+
int previous = 1;
+
int current = 0;
+
int step = 1;
+
unsigned long lastTime;
+
+
void setup() {
+
lastTime = millis();
+
charlie.setLed(current, true);
+
charlie.setPwmLed(previous, 64);
+
}
+
+
void loop() {
+
if ((millis() - lastTime) >= 100) {
+
charlie.setLed(previous, false);
+
charlie.setPwmLed(current, 64);
+
previous = current;
+
current += step;
+
if (current < 0) {
+
current = 1;
+
step = 1;
+
} else if (current >= charlie.count()) {
+
current = charlie.count() - 2;
+
step = -1;
+
}
+
charlie.setLed(current, true);
+
lastTime += 100;
+
}
+
charlie.loop();
+
}
+
+ + diff --git a/blink_cylon.html b/blink_cylon.html index 02701e7d..681b7dbc 100644 --- a/blink_cylon.html +++ b/blink_cylon.html @@ -2,29 +2,37 @@ + ArduinoLibs: Cylon Eyes Example + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
Cylon Eyes Example
-
-
-

This example shows how to use the ChaseLEDs class to simulate the Cylon eye effect from Battlestar Galactica. Digital outputs are used to drive six LED's in a back and forth motion, using the following schematic:

-
-Cylon.png -
-

We start by including the ChaseLEDs class:

-
#include <ChaseLEDs.h>
-

-

The next step is to define the pins that the chase will run over:

-
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
-ChaseLEDs cylonEyes(pins, sizeof(pins), 100);
-

-

The chase runs from the first pin to the sixth pin and back again, with each LED lit for 100 milliseconds before moving onto the next one. To complete the example, we need to call ChaseLEDs::loop() each time around our main loop to cause the chase to run:

-
void loop() {
-  cylonEyes.loop();
-}
-

-

While this example uses only six pins, it can be easily extended to any number of pins by modifying the pins array and altering the schematic accordingly.

-

So far we are chasing only a single LED. We could change this to chase two adjacent LED's instead by defining a new CylonChase class that inherits from ChaseLEDs:

-
class CylonChase : public ChaseLEDs
-{
-public:
-  CylonChase(const byte *pins, int num, unsigned long advanceTime)
-    : ChaseLEDs(pins, num, advanceTime) {}
-
-protected:
-  void advance(byte prevPin, byte nextPin) {
-    digitalWrite(previousPin(2), LOW);
-    digitalWrite(prevPin, HIGH);
-    digitalWrite(nextPin, HIGH);
-  }
-};
-

-

The important part is the implementation of the advance() method, which overrides ChaseLEDs::advance() to provide our own scheme for lighting the LED's each time the chase advances. We use ChaseLEDs::previousPin() to get the pin that is 2 steps back in the sequence, set it to LOW, and then set the previous pin (1 step back) and the next pin to HIGH. All that remains is to change our chase initialization to use the new class:

-
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
-CylonChase cylonEyes(pins, sizeof(pins), 100);
-

-

We can do even better than this. Instead of fully lighting both LED's, we could instead use the PWM outputs to dim the previous pin, creating a kind of "trailing flame" effect:

-
  void advance(byte prevPin, byte nextPin) {
-    digitalWrite(previousPin(2), LOW);
-    analogWrite(prevPin, 32);
-    digitalWrite(nextPin, HIGH);
-  }
-

-

The current chase is fixed at 100 milliseconds per LED, which takes a full second to run the sequence. An alternative to hard-wiring the chase rate is to hook up a 10K potentiometer to the A0 analog input:

-
-Cylon4.png -
-

We then modify the advance() method to read the new chase rate from the potentiometer each time the LED advances:

-
  void advance(byte prevPin, byte nextPin) {
-    digitalWrite(previousPin(2), LOW);
-    analogWrite(prevPin, 32);
-    digitalWrite(nextPin, HIGH);
-    setAdvanceTime(map(analogRead(A0), 0, 1023, 25, 250));
-  }
-

-

The full source code for the final version of the example follows:

-
/*
-Sketch that manipulates Arduino outputs to create the "Cylon Eyes" effect from
-Battlestar Galactica.  It uses the ChaseLEDs utility class.
-
-This example is placed into the public domain.
-*/
-
-#include <ChaseLEDs.h>
-
-class CylonChase : public ChaseLEDs
-{
-public:
-  CylonChase(const byte *pins, int num, unsigned long advanceTime)
-    : ChaseLEDs(pins, num, advanceTime) {}
-
-protected:
-  void advance(byte prevPin, byte nextPin) {
-    digitalWrite(previousPin(2), LOW);
-    analogWrite(prevPin, 32);
-    digitalWrite(nextPin, HIGH);
-    setAdvanceTime(map(analogRead(A0), 0, 1023, 25, 250));
-  }
-};
-
-byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
-CylonChase cylonEyes(pins, sizeof(pins), 100);
-
-void setup() {}
-
-void loop() {
-  cylonEyes.loop();
-}
-
-
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -160,8 +72,107 @@ CylonChase cylonEyes(pins, sizeof(pins), 100);
- + +
+
+
Cylon Eyes Example
+
+
+

This example shows how to use the ChaseLEDs class to simulate the Cylon eye effect from Battlestar Galactica. Digital outputs are used to drive six LED's in a back and forth motion, using the following schematic:

+
+Cylon.png +
+

We start by including the ChaseLEDs class:

+
#include <ChaseLEDs.h>
+

+

The next step is to define the pins that the chase will run over:

+
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
+
ChaseLEDs cylonEyes(pins, sizeof(pins), 100);
+

+

The chase runs from the first pin to the sixth pin and back again, with each LED lit for 100 milliseconds before moving onto the next one. To complete the example, we need to call ChaseLEDs::loop() each time around our main loop to cause the chase to run:

+
void loop() {
+
cylonEyes.loop();
+
}
+

+

While this example uses only six pins, it can be easily extended to any number of pins by modifying the pins array and altering the schematic accordingly.

+

So far we are chasing only a single LED. We could change this to chase two adjacent LED's instead by defining a new CylonChase class that inherits from ChaseLEDs:

+
class CylonChase : public ChaseLEDs
+
{
+
public:
+
CylonChase(const byte *pins, int num, unsigned long advanceTime)
+
: ChaseLEDs(pins, num, advanceTime) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
digitalWrite(prevPin, HIGH);
+
digitalWrite(nextPin, HIGH);
+
}
+
};
+

+

The important part is the implementation of the advance() method, which overrides ChaseLEDs::advance() to provide our own scheme for lighting the LED's each time the chase advances. We use ChaseLEDs::previousPin() to get the pin that is 2 steps back in the sequence, set it to LOW, and then set the previous pin (1 step back) and the next pin to HIGH. All that remains is to change our chase initialization to use the new class:

+
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
+
CylonChase cylonEyes(pins, sizeof(pins), 100);
+

+

We can do even better than this. Instead of fully lighting both LED's, we could instead use the PWM outputs to dim the previous pin, creating a kind of "trailing flame" effect:

+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, 32);
+
digitalWrite(nextPin, HIGH);
+
}
+

+

The current chase is fixed at 100 milliseconds per LED, which takes a full second to run the sequence. An alternative to hard-wiring the chase rate is to hook up a 10K potentiometer to the A0 analog input:

+
+Cylon4.png +
+

We then modify the advance() method to read the new chase rate from the potentiometer each time the LED advances:

+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, 32);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(A0), 0, 1023, 25, 250));
+
}
+

+

The full source code for the final version of the example follows:

+
/*
+
Sketch that manipulates Arduino outputs to create the "Cylon Eyes" effect from
+
Battlestar Galactica. It uses the ChaseLEDs utility class.
+
+
This example is placed into the public domain.
+
*/
+
+
#include <ChaseLEDs.h>
+
+
class CylonChase : public ChaseLEDs
+
{
+
public:
+
CylonChase(const byte *pins, int num, unsigned long advanceTime)
+
: ChaseLEDs(pins, num, advanceTime) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, 32);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(A0), 0, 1023, 25, 250));
+
}
+
};
+
+
byte pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
+
CylonChase cylonEyes(pins, sizeof(pins), 100);
+
+
void setup() {}
+
+
void loop() {
+
cylonEyes.loop();
+
}
+
+
+ + diff --git a/blink_startrek.html b/blink_startrek.html index 00f99a23..e48d7c51 100644 --- a/blink_startrek.html +++ b/blink_startrek.html @@ -2,29 +2,37 @@ + ArduinoLibs: Star Trek Example + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + + + + + +
+
+ +
Star Trek Example
-
+

This example shows how to use the BlinkLED and ChaseLEDs classes to simulate the running lights on the starship Enterprise from Star Trek. This can be used as the basis for lighting a model kit. It is recommended that you read the Blink and Cylon tutorials first.

There are four categories of lights on the Enterprise:

@@ -78,57 +100,57 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); StarTrekShield.png

Now that we have a circuit, let's configure the red navigation LED on AOUT2 using the BlinkLED class, to blink with a period of 1000 milliseconds on, 1000 milliseconds off:

-
#include <BlinkLED.h>
-#define NAV_LIGHTS           A2    // Output pin for controlling the navigation lights
-#define NAV_LIGHTS_ON        1000  // Time the navigation lights are on (milliseconds)
-#define NAV_LIGHTS_OFF       1000  // Time the navigation lights are off (milliseconds)
-BlinkLED navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
-

+
#include <BlinkLED.h>
+
#define NAV_LIGHTS A2 // Output pin for controlling the navigation lights
+
#define NAV_LIGHTS_ON 1000 // Time the navigation lights are on (milliseconds)
+
#define NAV_LIGHTS_OFF 1000 // Time the navigation lights are off (milliseconds)
+
BlinkLED navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
+

We repeat the process for the strobe LED on AOUT3, with a period of 70 milliseconds on, and 830 milliseconds off:

-
#define STROBE_LIGHT         A3    // Output pin for controlling the strobe
-#define STROBE_LIGHT_ON      70    // Time the strobe light is on (milliseconds)
-#define STROBE_LIGHT_OFF     830   // Time the strobe light is off (milliseconds)
-BlinkLED strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
-

+
#define STROBE_LIGHT A3 // Output pin for controlling the strobe
+
#define STROBE_LIGHT_ON 70 // Time the strobe light is on (milliseconds)
+
#define STROBE_LIGHT_OFF 830 // Time the strobe light is off (milliseconds)
+
BlinkLED strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
+

We also need to arrange for BlinkLED::loop() to be called from the application's main loop() function:

-
void loop() {
-  navLights.loop();
-  strobeLight.loop();
-}
-

If you run the sketch at this point, you should see the navigation and strobe LED's blink with the selected rates.

+
void loop() {
+
navLights.loop();
+
strobeLight.loop();
+
}
+

If you run the sketch at this point, you should see the navigation and strobe LED's blink with the selected rates.

Next is the twirl effect in the warp nacelles, using the ChaseLEDs class. We are actually going to inherit from ChaseLEDs to create a custom LED chaser that reads the chase rate from AIN0 and uses PWM outputs to create a trailing flame effect. See the Cylon example for more information on creating custom effects with ChaseLEDs.

-
#define NACELLE_CHASE_LEN    6     // Length of nacelle chase, 1..6
-#define NACELLE_MIN_PERIOD   25    // Minimum time to advance the nacelle chase (milliseconds)
-#define NACELLE_MAX_PERIOD   250   // Maximum time to advance the nacelle chase (milliseconds)
-#define NACELLE_DIM_VALUE    32    // Value for dimming previous LED in chase, 0..255
-
-// Output pins to use for the nacelle chase
-byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
-
-class NacelleChaseLEDs : public ChaseLEDs
-{
-public:
-  NacelleChaseLEDs(const byte *pins, int num)
-    : ChaseLEDs(pins, num, 0) {}
-
-protected:
-  void advance(byte prevPin, byte nextPin) {
-    digitalWrite(previousPin(2), LOW);
-    analogWrite(prevPin, NACELLE_DIM_VALUE);
-    digitalWrite(nextPin, HIGH);
-    setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
-  }
-};
-
-NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
-

+
#define NACELLE_CHASE_LEN 6 // Length of nacelle chase, 1..6
+
#define NACELLE_MIN_PERIOD 25 // Minimum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_MAX_PERIOD 250 // Maximum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_DIM_VALUE 32 // Value for dimming previous LED in chase, 0..255
+
+
// Output pins to use for the nacelle chase
+
byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
+
+
class NacelleChaseLEDs : public ChaseLEDs
+
{
+
public:
+
NacelleChaseLEDs(const byte *pins, int num)
+
: ChaseLEDs(pins, num, 0) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, NACELLE_DIM_VALUE);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
+
}
+
};
+
+
NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
+

We also need to add a call to ChaseLEDs::loop() to the application's main loop:

-
void loop() {
-  navLights.loop();
-  strobeLight.loop();
-  nacelleChase.loop();
-}
-

+
void loop() {
+
navLights.loop();
+
strobeLight.loop();
+
nacelleChase.loop();
+
}
+

Running the sketch now should cause the six LED's in the nacelle sequence to chase, in addition to the navigation and strobe LED's. The 10K potentiometer can be used to select the desired chase rate. This completes the test circuit, and will allow you to fiddle with the blink timings and chase rate until you are happy with the result.

We've made provision in this sketch for six outputs in the chase, but some models may only use three or five. The NACELLE_CHASE_LEN parameter controls the length of the chase.

With three outputs, the LED's can be arranged in opposite pairs, lighting two LED's at a time. The following circuit demonstrates how three outputs can be used to drive six LED's:

@@ -138,96 +160,85 @@ NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);

You will need two of these circuits, for the left and right warp nacelles. The transistor drivers reduce the current load on the Arduino CPU and provide the option to drive the LED's from 12V instead of 5V.

It is recommended that you use transistor drivers for the navigation and strobe lights as well as there will be multiple LED's on each output in a real model. For example, there will be at least three each of the red and green navigation lights: the top of the saucer section, the bottom of the saucer section, and the top of the warp nacelle. Using a 12V supply will make it easier to string lots of LED's together in series.

Other nacelle effects are possible by modifying the advance() method in the sketch. For example, the "opposite pairs" effect with 3 outputs can also be done with 6 outputs and the following modification to the sketch:

-
  void advance(byte prevPin, byte nextPin) {
-    digitalWrite(previousPin(5), LOW);
-    analogWrite(previousPin(4), NACELLE_DIM_VALUE);
-    digitalWrite(previousPin(3), HIGH);
-    digitalWrite(previousPin(2), LOW);
-    analogWrite(prevPin, NACELLE_DIM_VALUE);
-    digitalWrite(nextPin, HIGH);
-    setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
-  }
-

+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(5), LOW);
+
analogWrite(previousPin(4), NACELLE_DIM_VALUE);
+
digitalWrite(previousPin(3), HIGH);
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, NACELLE_DIM_VALUE);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
+
}
+

The full source code for the example, including the "opposite pairs" effect, follows:

-
/*
-Sketch that manipulates Arduino outputs to create Star Trek Enterprise style
-running lights and LED chasers.
-
-This example is placed into the public domain.
-*/
-
-#include <BlinkLED.h>
-#include <ChaseLEDs.h>
-
-#define NACELLE_RATE         A0    // Analog input for reading the nacelle chase rate
-#define NAV_LIGHTS           A2    // Output pin for controlling the navigation lights
-#define STROBE_LIGHT         A3    // Output pin for controlling the strobe
-
-// Configurable parameters.
-#define NAV_LIGHTS_ON        1000  // Time the navigation lights are on (milliseconds)
-#define NAV_LIGHTS_OFF       1000  // Time the navigation lights are off (milliseconds)
-#define STROBE_LIGHT_ON      70    // Time the strobe light is on (milliseconds)
-#define STROBE_LIGHT_OFF     830   // Time the strobe light is off (milliseconds)
-#define NACELLE_CHASE_LEN    6     // Length of nacelle chase, 1..6
-#define NACELLE_MIN_PERIOD   25    // Minimum time to advance the nacelle chase (milliseconds)
-#define NACELLE_MAX_PERIOD   250   // Maximum time to advance the nacelle chase (milliseconds)
-#define NACELLE_DIM_VALUE    32    // Value for dimming previous LED in chase, 0..255
-
-// Output pins to use for the nacelle chase
-byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
-
-class NacelleChaseLEDs : public ChaseLEDs
-{
-public:
-  NacelleChaseLEDs(const byte *pins, int num)
-    : ChaseLEDs(pins, num, 0) {}
-
-protected:
-  void advance(byte prevPin, byte nextPin) {
-    digitalWrite(previousPin(5), LOW);
-    analogWrite(previousPin(4), NACELLE_DIM_VALUE);
-    digitalWrite(previousPin(3), HIGH);
-    digitalWrite(previousPin(2), LOW);
-    analogWrite(prevPin, NACELLE_DIM_VALUE);
-    digitalWrite(nextPin, HIGH);
-    setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
-  }
-};
-
-NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
-
-BlinkLED navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
-BlinkLED strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
-
-void setup() {
-  // Turn off the status LED on the Arduino board (we don't need it).
-  pinMode(13, OUTPUT);
-  digitalWrite(13, LOW);
-}
-
-void loop() {
-  navLights.loop();
-  strobeLight.loop();
-  nacelleChase.loop();
-}
-
-
- - - - -
- -
- - +
/*
+
Sketch that manipulates Arduino outputs to create Star Trek Enterprise style
+
running lights and LED chasers.
+
+
This example is placed into the public domain.
+
*/
+
+
#include <BlinkLED.h>
+
#include <ChaseLEDs.h>
+
+
#define NACELLE_RATE A0 // Analog input for reading the nacelle chase rate
+
#define NAV_LIGHTS A2 // Output pin for controlling the navigation lights
+
#define STROBE_LIGHT A3 // Output pin for controlling the strobe
+
+
// Configurable parameters.
+
#define NAV_LIGHTS_ON 1000 // Time the navigation lights are on (milliseconds)
+
#define NAV_LIGHTS_OFF 1000 // Time the navigation lights are off (milliseconds)
+
#define STROBE_LIGHT_ON 70 // Time the strobe light is on (milliseconds)
+
#define STROBE_LIGHT_OFF 830 // Time the strobe light is off (milliseconds)
+
#define NACELLE_CHASE_LEN 6 // Length of nacelle chase, 1..6
+
#define NACELLE_MIN_PERIOD 25 // Minimum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_MAX_PERIOD 250 // Maximum time to advance the nacelle chase (milliseconds)
+
#define NACELLE_DIM_VALUE 32 // Value for dimming previous LED in chase, 0..255
+
+
// Output pins to use for the nacelle chase
+
byte nacelleChasePins[6] = {3, 5, 6, 9, 10, 11};
+
+
class NacelleChaseLEDs : public ChaseLEDs
+
{
+
public:
+
NacelleChaseLEDs(const byte *pins, int num)
+
: ChaseLEDs(pins, num, 0) {}
+
+
protected:
+
void advance(byte prevPin, byte nextPin) {
+
digitalWrite(previousPin(5), LOW);
+
analogWrite(previousPin(4), NACELLE_DIM_VALUE);
+
digitalWrite(previousPin(3), HIGH);
+
digitalWrite(previousPin(2), LOW);
+
analogWrite(prevPin, NACELLE_DIM_VALUE);
+
digitalWrite(nextPin, HIGH);
+
setAdvanceTime(map(analogRead(NACELLE_RATE), 0, 1023, NACELLE_MIN_PERIOD, NACELLE_MAX_PERIOD));
+
}
+
};
+
+
NacelleChaseLEDs nacelleChase(nacelleChasePins, NACELLE_CHASE_LEN);
+
+
BlinkLED navLights(NAV_LIGHTS, NAV_LIGHTS_ON, NAV_LIGHTS_OFF);
+
BlinkLED strobeLight(STROBE_LIGHT, STROBE_LIGHT_ON, STROBE_LIGHT_OFF);
+
+
void setup() {
+
// Turn off the status LED on the Arduino board (we don't need it).
+
pinMode(13, OUTPUT);
+
digitalWrite(13, LOW);
+
}
+
+
void loop() {
+
navLights.loop();
+
strobeLight.loop();
+
nacelleChase.loop();
+
}
+
+
+ + diff --git a/classBitmap-members.html b/classBitmap-members.html index da4e21df..a8a4f635 100644 --- a/classBitmap-members.html +++ b/classBitmap-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + -
-
-
-
Bitmap Member List
-
-
-This is the complete list of members for Bitmap, including all inherited members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Bitmap(int width, int height)Bitmap
bitsPerPixel() const Bitmap [inline]
BlackBitmap [static]
charWidth(char ch) const Bitmap
clear(Color color=Black)Bitmap
Color typedefBitmap
copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)Bitmap
data()Bitmap [inline]
data() const Bitmap [inline]
DMD (defined in Bitmap)Bitmap [friend]
drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)Bitmap
drawBitmap(int x, int y, const prog_uint8_t *bitmap, Color color=White)Bitmap
drawChar(int x, int y, char ch)Bitmap
drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawFilledCircle(int centerX, int centerY, int radius, Color color=White)Bitmap [inline]
drawFilledRect(int x1, int y1, int x2, int y2, Color color=White)Bitmap [inline]
drawInvertedBitmap(int x, int y, const Bitmap &bitmap)Bitmap [inline]
drawInvertedBitmap(int x, int y, const prog_uint8_t *bitmap)Bitmap [inline]
drawLine(int x1, int y1, int x2, int y2, Color color=White)Bitmap
drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawText(int x, int y, const char *str, int len=-1)Bitmap
drawText(int x, int y, const String &str, int start=0, int len=-1)Bitmap
fill(int x, int y, int width, int height, Color color)Bitmap
fill(int x, int y, int width, int height, const prog_uint8_t *pattern, Color color=White)Bitmap
font() const Bitmap [inline]
height() const Bitmap [inline]
invert(int x, int y, int width, int height)Bitmap
isValid() const Bitmap [inline]
NoFillBitmap [static]
pixel(int x, int y) const Bitmap
scroll(int dx, int dy, Color fillColor=Black)Bitmap [inline]
scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)Bitmap
setFont(const prog_uint8_t *font)Bitmap [inline]
setPixel(int x, int y, Color color)Bitmap
setTextColor(Color color)Bitmap [inline]
stride() const Bitmap [inline]
textColor() const Bitmap [inline]
textHeight() const Bitmap
textWidth(const char *str, int len=-1) const Bitmap
textWidth(const String &str, int start=0, int len=-1) const Bitmap
WhiteBitmap [static]
width() const Bitmap [inline]
~Bitmap()Bitmap
+ All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
@@ -123,8 +80,66 @@ This is the complete list of members for B
- + +
+
+
Bitmap Member List
+
+
+ +

This is the complete list of members for Bitmap, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bitmap(int width, int height)Bitmap
bitsPerPixel() const Bitmapinline
BlackBitmapstatic
charWidth(char ch) const Bitmap
clear(Color color=Black)Bitmap
Color typedefBitmap
copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)Bitmap
data()Bitmapinline
data() const Bitmapinline
DMD (defined in Bitmap)Bitmapfriend
drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)Bitmap
drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color=White)Bitmap
drawChar(int x, int y, char ch)Bitmap
drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawFilledCircle(int centerX, int centerY, int radius, Color color=White)Bitmapinline
drawFilledRect(int x1, int y1, int x2, int y2, Color color=White)Bitmapinline
drawInvertedBitmap(int x, int y, const Bitmap &bitmap)Bitmapinline
drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)Bitmapinline
drawLine(int x1, int y1, int x2, int y2, Color color=White)Bitmap
drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)Bitmap
drawText(int x, int y, const char *str, int len=-1)Bitmap
drawText(int x, int y, const String &str, int start=0, int len=-1)Bitmap
fill(int x, int y, int width, int height, Color color)Bitmap
fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)Bitmap
font() const Bitmapinline
Font typedefBitmap
height() const Bitmapinline
invert(int x, int y, int width, int height)Bitmap
isValid() const Bitmapinline
NoFillBitmapstatic
pixel(int x, int y) const Bitmap
ProgMem typedefBitmap
scroll(int dx, int dy, Color fillColor=Black)Bitmapinline
scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)Bitmap
setFont(Font font)Bitmapinline
setPixel(int x, int y, Color color)Bitmap
setTextColor(Color color)Bitmapinline
stride() const Bitmapinline
textColor() const Bitmapinline
textHeight() const Bitmap
textWidth(const char *str, int len=-1) const Bitmap
textWidth(const String &str, int start=0, int len=-1) const Bitmap
WhiteBitmapstatic
width() const Bitmapinline
~Bitmap()Bitmap
+ + diff --git a/classBitmap.html b/classBitmap.html index ac27b137..21702264 100644 --- a/classBitmap.html +++ b/classBitmap.html @@ -2,29 +2,37 @@ + ArduinoLibs: Bitmap Class Reference + + - + + - - - -
+ +
-
ArduinoLibs
+
ArduinoLibs +
+ + + + + + + +
+
+ +
Bitmap Class Reference
-
+
- +

Represents a monochrome bitmap within main memory. More...

@@ -83,117 +106,124 @@ Inheritance diagram for Bitmap:
DMD - -

List of all members.

- - - - + + + + + +

+

Public Types

typedef uint8_t Color
 Type that represents the color of a pixel in a bitmap.

+

typedef uint8_t Color
 Type that represents the color of a pixel in a bitmap.
+typedef PGM_VOID_P ProgMem
 Type that represents a bitmap within program memory.
+typedef PGM_VOID_P Font
 Type that represents a font within program memory.
+ - - - + + - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 Bitmap (int width, int height)
 Constructs a new in-memory bitmap that is width x height pixels in size.
+
 Bitmap (int width, int height)
 Constructs a new in-memory bitmap that is width x height pixels in size.
 ~Bitmap ()
 Destroys this bitmap.
bool isValid () const
 Returns true if the memory for this bitmap is valid; false otherwise.
int width () const
 Returns the width of the bitmap in pixels.
int height () const
 Returns the height of the bitmap in pixels.
int stride () const
 Returns the number of bytes in each line of the bitmap's data() buffer.
int bitsPerPixel () const
 Returns the number of bits per pixel for the bitmap; always 1.
uint8_t * data ()
 Returns a pointer to the start of the bitmap's data buffer.
+
 Destroys this bitmap.
bool isValid () const
 Returns true if the memory for this bitmap is valid; false otherwise.
int width () const
 Returns the width of the bitmap in pixels.
int height () const
 Returns the height of the bitmap in pixels.
int stride () const
 Returns the number of bytes in each line of the bitmap's data() buffer.
int bitsPerPixel () const
 Returns the number of bits per pixel for the bitmap; always 1.
uint8_t * data ()
 Returns a pointer to the start of the bitmap's data buffer.
const uint8_t * data () const
 Returns a constant pointer to the start of the bitmap's data buffer.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void clear (Color color=Black)
 Clears the entire bitmap to the specified color.
Color pixel (int x, int y) const
 Returns the color of the pixel at (x, y); either Black or White.
void setPixel (int x, int y, Color color)
 Sets the pixel at (x, y) to color.
void drawLine (int x1, int y1, int x2, int y2, Color color=White)
 Draws a line from (x1, y1) to (x2, y2) in color.
void drawRect (int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)
 Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled with fillColor.
void drawFilledRect (int x1, int y1, int x2, int y2, Color color=White)
 Draws a filled rectangle from (x1, y1) to (x2, y2) in color.
void drawCircle (int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)
 Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor and the interior filled with fillColor.
void drawFilledCircle (int centerX, int centerY, int radius, Color color=White)
 Draws a filled circle with a specific center (centerX, centerY) and radius in color.
void drawBitmap (int x, int y, const Bitmap &bitmap, Color color=White)
 Draws bitmap at (x, y) in color.
void drawBitmap (int x, int y, const prog_uint8_t *bitmap, Color color=White)
 Draws bitmap at (x, y) in color.
void drawInvertedBitmap (int x, int y, const Bitmap &bitmap)
 Draws bitmap at (x, y) in inverted colors.
void drawInvertedBitmap (int x, int y, const prog_uint8_t *bitmap)
 Draws bitmap at (x, y) in inverted colors.
const prog_uint8_t * font () const
 Returns the currently selected font, or null if none selected.
void setFont (const prog_uint8_t *font)
 Sets the font for use with drawText() and drawChar().
Color textColor () const
 Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White.
void setTextColor (Color color)
 Sets the color that will be used for drawing text with drawText() and drawChar().
void drawText (int x, int y, const char *str, int len=-1)
 Draws the len characters of str at (x, y).
void drawText (int x, int y, const String &str, int start=0, int len=-1)
 Draws len characters starting at start from str to the screen at (x, y).
int drawChar (int x, int y, char ch)
 Draws a single character ch at (x, y).
int charWidth (char ch) const
 Returns the width in pixels of ch in the current font().
int textWidth (const char *str, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing.
int textWidth (const String &str, int start=0, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing.
int textHeight () const
 Returns the height in pixels of the current text drawing font(); or zero if font() is not set.
void copy (int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
 Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap dest.
void fill (int x, int y, int width, int height, Color color)
 Fills the width x height pixels starting at top-left corner (x, y) with color.
void fill (int x, int y, int width, int height, const prog_uint8_t *pattern, Color color=White)
 Fills the width x height pixels starting at top-left corner (x, y) with the contents of pattern.
void scroll (int dx, int dy, Color fillColor=Black)
 Scrolls the entire contents of the bitmap by dx and dy.
void scroll (int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)
 Scrolls the width x height pixels starting at top-left corner (x, y) by dx and dy.
void invert (int x, int y, int width, int height)
 Inverts the width x height pixels starting at top-left corner (x, y).

+

 Returns a constant pointer to the start of the bitmap's data buffer.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void clear (Color color=Black)
 Clears the entire bitmap to the specified color.
Color pixel (int x, int y) const
 Returns the color of the pixel at (x, y); either Black or White.
void setPixel (int x, int y, Color color)
 Sets the pixel at (x, y) to color.
void drawLine (int x1, int y1, int x2, int y2, Color color=White)
 Draws a line from (x1, y1) to (x2, y2) in color.
void drawRect (int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)
 Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled with fillColor.
void drawFilledRect (int x1, int y1, int x2, int y2, Color color=White)
 Draws a filled rectangle from (x1, y1) to (x2, y2) in color.
void drawCircle (int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)
 Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor and the interior filled with fillColor.
void drawFilledCircle (int centerX, int centerY, int radius, Color color=White)
 Draws a filled circle with a specific center (centerX, centerY) and radius in color.
void drawBitmap (int x, int y, const Bitmap &bitmap, Color color=White)
 Draws bitmap at (x, y) in color.
void drawBitmap (int x, int y, Bitmap::ProgMem bitmap, Color color=White)
 Draws bitmap at (x, y) in color.
void drawInvertedBitmap (int x, int y, const Bitmap &bitmap)
 Draws bitmap at (x, y) in inverted colors.
void drawInvertedBitmap (int x, int y, Bitmap::ProgMem bitmap)
 Draws bitmap at (x, y) in inverted colors.
Font font () const
 Returns the currently selected font, or null if none selected.
void setFont (Font font)
 Sets the font for use with drawText() and drawChar().
Color textColor () const
 Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White.
void setTextColor (Color color)
 Sets the color that will be used for drawing text with drawText() and drawChar().
void drawText (int x, int y, const char *str, int len=-1)
 Draws the len characters of str at (x, y).
void drawText (int x, int y, const String &str, int start=0, int len=-1)
 Draws len characters starting at start from str to the screen at (x, y).
int drawChar (int x, int y, char ch)
 Draws a single character ch at (x, y).
int charWidth (char ch) const
 Returns the width in pixels of ch in the current font().
int textWidth (const char *str, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing.
int textWidth (const String &str, int start=0, int len=-1) const
 Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing.
int textHeight () const
 Returns the height in pixels of the current text drawing font(); or zero if font() is not set.
void copy (int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
 Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap dest.
void fill (int x, int y, int width, int height, Color color)
 Fills the width x height pixels starting at top-left corner (x, y) with color.
void fill (int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)
 Fills the width x height pixels starting at top-left corner (x, y) with the contents of pattern.
void scroll (int dx, int dy, Color fillColor=Black)
 Scrolls the entire contents of the bitmap by dx and dy.
void scroll (int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)
 Scrolls the width x height pixels starting at top-left corner (x, y) by dx and dy.
void invert (int x, int y, int width, int height)
 Inverts the width x height pixels starting at top-left corner (x, y).
+ - - - - - + + + - - +

Static Public Attributes

+
static const Color Black = 0
 Color value corresponding to "black".
static const Color White = 1
 Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a different physical color.
+
 Color value corresponding to "black".
static const Color White = 1
 Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a different physical color.
static const Color NoFill = 2
 Special color value that is used with drawRect() and drawCircle() to indicate that the interior of the shape should not be filled. For all other uses, NoFill is equivalent to White.

+

 Special color value that is used with drawRect() and drawCircle() to indicate that the interior of the shape should not be filled. For all other uses, NoFill is equivalent to White.
+ - +

Friends

-class DMD
+class DMD
-

Detailed Description

+

Detailed Description

Represents a monochrome bitmap within main memory.

Bitmaps are a rectangular arrangement of width() x height() pixels, with each pixel set to either Black or White. The co-ordinate system has origin (0, 0) at the top-left of the bitmap.

Functions within this class can be used to draw various shapes into the bitmap's data() buffer; e.g. drawLine(), drawRect(), drawBitmap(), drawText(), clear(), fill(), etc.

-
See also:
DMD
+
See Also
DMD

Definition at line 32 of file Bitmap.h.

-

Member Typedef Documentation

- +

Member Typedef Documentation

+
@@ -201,18 +231,17 @@ class 
Bitmap::Color
-
-
+

Type that represents the color of a pixel in a bitmap.

-
See also:
Black, White
+
See Also
Black, White

Definition at line 40 of file Bitmap.h.

-

Constructor & Destructor Documentation

- +

Constructor & Destructor Documentation

+
@@ -234,39 +263,45 @@ class 
+ -

Member Function Documentation

- +

Member Function Documentation

+
+ + + + + +
- +
int Bitmap::bitsPerPixel ( ) const [inline] const
- -
+
+inline
+

Returns the number of bits per pixel for the bitmap; always 1.

-
See also:
width(), height()
+
See Also
width(), height()
-

Definition at line 49 of file Bitmap.h.

+

Definition at line 51 of file Bitmap.h.

- +
@@ -278,18 +313,17 @@ class 
+
-

Returns the width in pixels of ch in the current font().

-

Returns zero if font() is not set, or ch is not present in font().

-
See also:
drawChar(), font(), textWidth(), textHeight()
+

Returns the width in pixels of ch in the current font().

+

Returns zero if font() is not set, or ch is not present in font().

+
See Also
drawChar(), font(), textWidth(), textHeight()
-

Definition at line 640 of file Bitmap.cpp.

+

Definition at line 650 of file Bitmap.cpp.

- +
@@ -301,17 +335,16 @@ class 
+

Clears the entire bitmap to the specified color.

-
See also:
fill()
+
See Also
fill()
-

Definition at line 164 of file Bitmap.cpp.

+

Definition at line 174 of file Bitmap.cpp.

- +
@@ -363,42 +396,48 @@ class 
+ - +
+ + + + + +
- +
uint8_t * Bitmap::data ( ) [inline]
- -
+
+inline
+

Returns a pointer to the start of the bitmap's data buffer.

The data is organized as height() lines of stride() bytes, laid out horizontally across the extent of width() pixels. The most significant bit in each byte has the lowest x value.

Note: bits within the data are 1 for Black and 0 for White, which is the reverse of the constant values. This differs from pixel() which returns the correct constant.

-
See also:
pixel(), stride()
+
See Also
pixel(), stride()
-

Definition at line 51 of file Bitmap.h.

+

Definition at line 53 of file Bitmap.h.

- +
@@ -432,19 +471,18 @@ class 
+

Draws bitmap at (x, y) in color.

Bits that are set to White in the bitmap are drawn with color. Bits that are set to Black in the bitmap are drawn with the inverse of color. The pixel at (x, y) will be the top-left corner of the drawn image.

Note: bitmap must not be the same as this object or the behaviour will be undefined. To copy a region of a bitmap to elsewhere within the same bitmap, use copy() instead.

-
See also:
drawInvertedBitmap(), copy()
+
See Also
drawInvertedBitmap(), copy()
-

Definition at line 378 of file Bitmap.cpp.

+

Definition at line 388 of file Bitmap.cpp.

- +
@@ -463,7 +501,7 @@ class  - + @@ -478,19 +516,18 @@ class 
const prog_uint8_t * Bitmap::ProgMem  bitmap,
+ - +
@@ -518,19 +555,18 @@ class 
+

Draws a single character ch at (x, y).

Returns the width of the character in pixels so that higher-order functions like drawText() can advance x to the location of the next character to be drawn. The width does not include inter-character spacing.

The position (x, y) will be the upper-left pixel of the drawn character.

-
See also:
drawText(), textColor(), font(), charWidth()
+
See Also
drawText(), textColor(), font(), charWidth()
-

Definition at line 575 of file Bitmap.cpp.

+

Definition at line 585 of file Bitmap.cpp.

- +
@@ -570,20 +606,22 @@ class 
+ - +
+ + +
@@ -612,23 +650,30 @@ class  + + +
void Bitmap::drawFilledCircle + +inline
+

Draws a filled circle with a specific center (centerX, centerY) and radius in color.

This is a convenience function that is equivalent to drawCircle(centerX, centerY, radius, color, color).

-
See also:
drawCircle(), drawFilledRect()
+
See Also
drawCircle(), drawFilledRect()
-

Definition at line 118 of file Bitmap.h.

+

Definition at line 120 of file Bitmap.h.

- +
+ + +
@@ -663,23 +708,30 @@ class  + + +
void Bitmap::drawFilledRect + +inline
+

Draws a filled rectangle from (x1, y1) to (x2, y2) in color.

This is a convenience function that is equivalent to drawRect(x1, y1, x2, y2, color, color).

-
See also:
drawRect(), drawFilledCircle()
+
See Also
drawRect(), drawFilledCircle()
-

Definition at line 113 of file Bitmap.h.

+

Definition at line 115 of file Bitmap.h.

- +
+ + +
@@ -702,23 +754,30 @@ class  + + +
void Bitmap::drawInvertedBitmap + +inline
+

Draws bitmap at (x, y) in inverted colors.

This is a convenience function that is equivalent to drawBitmap(x, y, bitmap, Black).

-
See also:
drawBitmap()
+
See Also
drawBitmap()
-

Definition at line 123 of file Bitmap.h.

+

Definition at line 125 of file Bitmap.h.

- +
+ + + + + +
@@ -735,27 +794,31 @@ class  - + - +
void Bitmap::drawInvertedBitmap const prog_uint8_t * Bitmap::ProgMem  bitmap 
) [inline]
- -
+
+inline
+

Draws bitmap at (x, y) in inverted colors.

This is a convenience function that is equivalent to drawBitmap(x, y, bitmap, Black).

-
See also:
drawBitmap()
+
See Also
drawBitmap()
-

Definition at line 128 of file Bitmap.h.

+

Definition at line 130 of file Bitmap.h.

- +
@@ -795,17 +858,16 @@ class 
+ - +
@@ -851,18 +913,17 @@ class 
+ - +
@@ -896,19 +957,18 @@ class 
+ - +
@@ -948,19 +1008,18 @@ class 
+ - +
@@ -1000,17 +1059,16 @@ class 
+ - +
@@ -1041,7 +1099,7 @@ class  - + @@ -1056,61 +1114,74 @@ class 
const prog_uint8_t * Bitmap::ProgMem  pattern,
+ - +
+ + + + + +
- + - +
const prog_uint8_t * Bitmap::font Font Bitmap::font ( ) const [inline] const
- -
+
+inline
+

Returns the currently selected font, or null if none selected.

-
See also:
setFont(), drawText(), drawChar(), charWidth()
+
See Also
setFont(), drawText(), drawChar(), charWidth()
-

Definition at line 70 of file Bitmap.h.

+

Definition at line 72 of file Bitmap.h.

- +
+ + + + + +
- +
int Bitmap::height ( ) const [inline] const
- -
+
+inline
+

Returns the height of the bitmap in pixels.

-
See also:
width(), bitsPerPixel()
+
See Also
width(), bitsPerPixel()
-

Definition at line 47 of file Bitmap.h.

+

Definition at line 49 of file Bitmap.h.

- +
@@ -1144,29 +1215,35 @@ class 
+ - +
+ + + + + +
- +
bool Bitmap::isValid ( ) const [inline] const
- -
+
+inline
+

Returns true if the memory for this bitmap is valid; false otherwise.

This function can be called just after the constructor to determine if the memory for the bitmap was allocated successfully.

@@ -1175,7 +1252,7 @@ class 
+
@@ -1197,20 +1274,22 @@ class 
  • ChaseLEDs.h
  • ChaseLEDs.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classDMD-members.html b/classDMD-members.html index 0a6db58f..d8a59bb0 100644 --- a/classDMD-members.html +++ b/classDMD-members.html @@ -2,29 +2,37 @@ +ArduinoLibs: Member List + + - + + - - - -
    + +
    +

    Returns the color of the pixel at (x, y); either Black or White.

    Returns Black if x or y is out of range.

    -
    See also:
    setPixel(), data()
    +
    See Also
    setPixel(), data()
    -

    Definition at line 181 of file Bitmap.cpp.

    +

    Definition at line 191 of file Bitmap.cpp.

    - +
    + + +

    In this case, LED5 is lit when Pin1 is 1, Pin3 is 0, and Pin2 is set to a high-impedance input to "disconnect" it.

    Charlieplex presents a simple array of led() values that indicate whether each LED is on, off, or in an intermediate PWM state (if setPwmLed() is used). The application must call loop() or refresh() on a regular basis to ensure that the multiplexed display is kept up to date. The following example drives 6 LED's connected to the output pins D9, D10, and D11:

    -
    #include <Charlieplex.h>
    -
    -byte pins[3] = {9, 10, 11};
    -Charlieplex charlie(pins, sizeof(pins));
    -
    -void setup() {
    -    charlie.setLed(0, true);    // Turn on LED1
    -    charlie.setLed(3, true);    // Turn on LED4
    -    charlie.setPwmLed(5, 64);   // Set LED6 to one-quarter on
    -}
    -
    -void loop() {
    -    charlie.loop();
    -}
    -

    +
    #include <Charlieplex.h>
    +
    +
    byte pins[3] = {9, 10, 11};
    +
    Charlieplex charlie(pins, sizeof(pins));
    +
    +
    void setup() {
    +
    charlie.setLed(0, true); // Turn on LED1
    +
    charlie.setLed(3, true); // Turn on LED4
    +
    charlie.setPwmLed(5, 64); // Set LED6 to one-quarter on
    +
    }
    +
    +
    void loop() {
    +
    charlie.loop();
    +
    }
    +

    The following diagram extends the circuit for 4 output pins and 12 LED's:

    charlieplex4pin.png @@ -136,13 +157,13 @@ byte pins[3] = {9, 10, 11}; charlieplex5pin.png

    Circuits for higher numbers of LED's get increasingly complex. For those cases it can be easier to use traditional multiplexing matrix arrangements and shift registers. The DMD class does this for a specific kind of large dot matrix display. Otherwise, use the following pseudocode to determine how to connect the LED's for higher numbers of pins:

    -
     n = 1
    - for Pass = 1 to NumPins-1:
    -     for Pin = 1 to NumPins-Pass:
    -         LED[n] is connected between Pin (anode) and Pin+Pass (cathode)
    -         LED[n+1] is connected between Pin+Pass (anode) and Pin (cathode)
    -         n = n + 2
    -

    Note: while the above circuit diagrams and psuedocode use 1-based numbering for LED's, Charlieplex uses 0-based numbering in the led(), setLed(), pwmLed(), and setPwmLed() functions.

    +
    n = 1
    +
    for Pass = 1 to NumPins-1:
    +
    for Pin = 1 to NumPins-Pass:
    +
    LED[n] is connected between Pin (anode) and Pin+Pass (cathode)
    +
    LED[n+1] is connected between Pin+Pass (anode) and Pin (cathode)
    +
    n = n + 2
    +

    Note: while the above circuit diagrams and psuedocode use 1-based numbering for LED's, Charlieplex uses 0-based numbering in the led(), setLed(), pwmLed(), and setPwmLed() functions.

    It isn't necessary to wire up all LED's. If you only need 10 LED's, then use the 4-output circuit and omit LED11 and LED12. Charlieplex only drives LED's that are lit; LED's that are unlit or unused will be skipped during the refresh scan. The maximum number of LED's that that can be driven by a specific number of pins is given by the following table:

    @@ -1233,21 +1312,25 @@ class  + + +
    void Bitmap::scroll + +inline
    +

    Scrolls the entire contents of the bitmap by dx and dy.

    If dx is 2 and dy is -1, then the region will be scrolled two pixels to the right and one pixel up. Pixels that are uncovered by the scroll are filled with fillColor.

    -
    See also:
    copy(), fill()
    +
    See Also
    copy(), fill()
    -

    Definition at line 133 of file Bitmap.h.

    +

    Definition at line 135 of file Bitmap.h.

    - +
    @@ -1299,45 +1382,51 @@ class 
  • BoolField.h
  • BoolField.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classBoolField.png b/classBoolField.png index cbe86e17dfc964d30b3c23aab78f59b6e641ac41..4f5281dedd1abe77b3a485fc1610d6982be25c1e 100644 GIT binary patch delta 247 zcmVDI)U&B z*X;0Yf0$a`*>YwZ8!;QXSnrrSvcND zl0x3qhxA)W(#t8~%LI4#OaPu{14tz;Y+IH{3plt?PD~m36xPpbG~%KklgRQ^kEg+#>j?hs67n}^L-xbLwpu`vn05{#tRaC V4%ys^=!O6Q002ovPDHLkV1g(zYIXns diff --git a/classCharlieplex-members.html b/classCharlieplex-members.html index ccd9c153..3082b7e8 100644 --- a/classCharlieplex-members.html +++ b/classCharlieplex-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    + - +
    + + + + + +
    - + - +
    void Bitmap::setFont (const prog_uint8_t * Font  font) [inline]
    - -
    +
    +inline
    +

    Sets the font for use with drawText() and drawChar().

    -
     #include <DejaVuSans9.h>
    +
    #include <DejaVuSans9.h>
    +
    +
    display.setFont(DejaVuSans9);
    +
    display.drawText(0, 0, "Hello");
    +

    New fonts can be generated with GLCDFontCreator2.

    +
    See Also
    font(), drawText(), drawChar()
    - display.setFont(DejaVuSans9); - display.drawText(0, 0, "Hello"); -

    New fonts can be generated with GLCDFontCreator2.

    -
    See also:
    font(), drawText(), drawChar()
    - -

    Definition at line 71 of file Bitmap.h.

    +

    Definition at line 73 of file Bitmap.h.

    - +
    @@ -1365,81 +1454,101 @@ class  - +
    +
    +

    Sets the pixel at (x, y) to color.

    -
    See also:
    pixel()
    +
    See Also
    pixel()
    -

    Definition at line 198 of file Bitmap.cpp.

    +

    Definition at line 208 of file Bitmap.cpp.

    - +
    + + + + + +
    - +
    void Bitmap::setTextColor ( Color  textColor) [inline]
    - -
    +
    +inline
    +

    Sets the color that will be used for drawing text with drawText() and drawChar().

    -
    See also:
    textColor(), drawText(), drawChar()
    +
    See Also
    textColor(), drawText(), drawChar()
    -

    Definition at line 74 of file Bitmap.h.

    +

    Definition at line 76 of file Bitmap.h.

    - +
    + + + + + +
    - +
    int Bitmap::stride ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the number of bytes in each line of the bitmap's data() buffer.

    -
    See also:
    width(), bitsPerPixel(), data()
    +
    See Also
    width(), bitsPerPixel(), data()
    -

    Definition at line 48 of file Bitmap.h.

    +

    Definition at line 50 of file Bitmap.h.

    - +
    + + + + + +
    - +
    Color Bitmap::textColor ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White.

    -
    See also:
    setTextColor(), drawText(), drawChar()
    +
    See Also
    setTextColor(), drawText(), drawChar()
    -

    Definition at line 73 of file Bitmap.h.

    +

    Definition at line 75 of file Bitmap.h.

    - +
    @@ -1450,17 +1559,16 @@ class  - +
    +
    +
    -

    Returns the height in pixels of the current text drawing font(); or zero if font() is not set.

    -
    See also:
    font(), charWidth(), textWidth()
    +

    Returns the height in pixels of the current text drawing font(); or zero if font() is not set.

    +
    See Also
    font(), charWidth(), textWidth()
    -

    Definition at line 706 of file Bitmap.cpp.

    +

    Definition at line 716 of file Bitmap.cpp.

    - +
    @@ -1482,18 +1590,17 @@ class 
  • BlinkLED.h
  • BlinkLED.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classBoolField-members.html b/classBoolField-members.html index d449f4dd..4b6b4ddf 100644 --- a/classBoolField-members.html +++ b/classBoolField-members.html @@ -2,29 +2,37 @@ +ArduinoLibs: Member List + + - + + - - - -
    + +
    +
    -

    Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing.

    +

    Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing.

    If len is less than zero, then the actual length of str will be used.

    -
    See also:
    drawText(), charWidth(), textHeight()
    +
    See Also
    drawText(), charWidth(), textHeight()
    -

    Definition at line 665 of file Bitmap.cpp.

    +

    Definition at line 675 of file Bitmap.cpp.

    - +
    @@ -1521,54 +1628,67 @@ class  -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    +
    +
    -

    Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing.

    +

    Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing.

    If len is less than zero, then the actual length of str will be used.

    -
    See also:
    drawText(), charWidth(), textHeight()
    +
    See Also
    drawText(), charWidth(), textHeight()
    -

    Definition at line 687 of file Bitmap.cpp.

    +

    Definition at line 697 of file Bitmap.cpp.

    - +
    + + + + + +
    - +
    int Bitmap::width ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the width of the bitmap in pixels.

    -
    See also:
    height(), stride(), bitsPerPixel()
    +
    See Also
    height(), stride(), bitsPerPixel()
    -

    Definition at line 46 of file Bitmap.h.

    +

    Definition at line 48 of file Bitmap.h.

    -

    Member Data Documentation

    - +

    Member Data Documentation

    +
    + + + + + +
    - +
    Bitmap::White = 1 [static]Bitmap::White = 1
    - -
    +
    +static
    +

    Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a different physical color.

    Note: while the value of this constant is 1, the bitmap itself stores white pixels as 0 and black as 1 because the DMD display uses 1 to indicate a pixel being off.

    -

    Definition at line 43 of file Bitmap.h.

    +

    Definition at line 45 of file Bitmap.h.

    @@ -1576,23 +1696,12 @@ class 
    Bitmap.h
  • Bitmap.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classBitmap.png b/classBitmap.png index a1725e8eafa05de4f638640a16ad528c1d3eb1e5..73ac3b30defca94032ce684f882f5c99d79d00d3 100644 GIT binary patch delta 249 zcmVnt_jp6uhb-m)MlC zuZW0*KmY=~&d6g}1A`ieu`f|$3HZoMuhQ9X7lvP+vRV24NbK%ozm7U*qwR6zd7*$& zjW1{n_EGk{eU&GjX9aLgmGqB{cmAS8L?QrmNdO_jMoLj7Y;r6@P>CCVGOK9-++-R6 z_m~F2J*ENBVrJGOnVI##R8<4K((pfDe<*<});G$s<*c`+Lf^=RTccJkjNBof~>%K8r=00000NkvXXu0mjf#a(rL delta 223 zcmV<503iR(0Jh0npH@BhfVs0GaI*jb`6j1wgW`}G&S z233L3G#%k>0EmH)M$|^_N5 Z^#bcO3w5;Pkt+ZI002ovPDHLkV1ib(Yoh=F diff --git a/classBlinkLED-members.html b/classBlinkLED-members.html index 0add7fc1..754f3e2d 100644 --- a/classBlinkLED-members.html +++ b/classBlinkLED-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    BlinkLED Member List
    -
    -
    -This is the complete list of members for BlinkLED, including all inherited members. - - - - - - - - - - -
    BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)BlinkLED
    isPaused() const BlinkLED [inline]
    loop()BlinkLED
    offTime() const BlinkLED [inline]
    onTime() const BlinkLED [inline]
    pause()BlinkLED [inline]
    resume()BlinkLED
    setBlinkRate(unsigned long onTime, unsigned long offTime)BlinkLED
    setState(bool state)BlinkLED
    state() const BlinkLED [inline]
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -90,8 +80,31 @@ This is the complete list of members for
    - + +
    +
    +
    BlinkLED Member List
    +
    +
    + +

    This is the complete list of members for BlinkLED, including all inherited members.

    + + + + + + + + + + + +
    BlinkLED(uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)BlinkLED
    isPaused() const BlinkLEDinline
    loop()BlinkLED
    offTime() const BlinkLEDinline
    onTime() const BlinkLEDinline
    pause()BlinkLEDinline
    resume()BlinkLED
    setBlinkRate(unsigned long onTime, unsigned long offTime)BlinkLED
    setState(bool state)BlinkLED
    state() const BlinkLEDinline
    + + diff --git a/classBlinkLED.html b/classBlinkLED.html index be5ec775..9a7ebf94 100644 --- a/classBlinkLED.html +++ b/classBlinkLED.html @@ -2,29 +2,37 @@ + ArduinoLibs: BlinkLED Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    BlinkLED Class Reference
    -
    +
    - +

    Blink a LED on a digital output pin. More...

    #include <BlinkLED.h>

    - -

    List of all members.

    - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     BlinkLED (uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)
     Initialize a blinking LED on the specified pin.
    void loop ()
    unsigned long onTime () const
     Returns the number of milliseconds the LED will be on.
    unsigned long offTime () const
     Returns the number of milliseconds the LED will be off.
    void setBlinkRate (unsigned long onTime, unsigned long offTime)
     Sets the onTime and offTime (in milliseconds).
    bool state () const
     Returns the current state of the LED; true is on, false is off.
    void setState (bool state)
     Sets the current state of the LED, where true is on, false is off.
    void pause ()
     Pauses the LED blink cycle in its current state().
    void resume ()
     Resumes the LED blink cycle after a pause().
    bool isPaused () const
     Returns true if the LED blink cycle is paused; false otherwise.
     BlinkLED (uint8_t pin, unsigned long onTime, unsigned long offTime, bool initialState=false)
     Initialize a blinking LED on the specified pin.
    void loop ()
    unsigned long onTime () const
     Returns the number of milliseconds the LED will be on.
    unsigned long offTime () const
     Returns the number of milliseconds the LED will be off.
    void setBlinkRate (unsigned long onTime, unsigned long offTime)
     Sets the onTime and offTime (in milliseconds).
    bool state () const
     Returns the current state of the LED; true is on, false is off.
    void setState (bool state)
     Sets the current state of the LED, where true is on, false is off.
    void pause ()
     Pauses the LED blink cycle in its current state().
    void resume ()
     Resumes the LED blink cycle after a pause().
    bool isPaused () const
     Returns true if the LED blink cycle is paused; false otherwise.
    -

    Detailed Description

    +

    Detailed Description

    Blink a LED on a digital output pin.

    BlinkLED simplies the process of blinking a LED by encapsulating the control logic into a single class. The following example strobes the status LED on D13 with a period of 70 milliseconds on, 930 milliseconds off (the LED is initially off):

    -
     #include <BlinkLED.h>
    -
    - BlinkLED statusBlink(13, 70, 930);
    -
    - void setup() {}
    -
    - void loop() {
    -     statusBlink.loop();
    - }
    -

    The current state() of the LED can be changed immediately by calling setState(). The blink rate can be modified with setBlinkRate(). And the blink cycle can be suspended and restarted with pause() and resume().

    +
    #include <BlinkLED.h>
    +
    +
    BlinkLED statusBlink(13, 70, 930);
    +
    +
    void setup() {}
    +
    +
    void loop() {
    +
    statusBlink.loop();
    +
    }
    +

    The current state() of the LED can be changed immediately by calling setState(). The blink rate can be modified with setBlinkRate(). And the blink cycle can be suspended and restarted with pause() and resume().

    Definition at line 28 of file BlinkLED.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    @@ -146,8 +167,7 @@ Public Member Functions
    -
    -
    +

    Initialize a blinking LED on the specified pin.

    The LED will blink with a rate defined by onTime and offTime (in milliseconds). Initially the LED's state is given by initialState, where true means initially on and false means initially off.

    @@ -156,29 +176,36 @@ Public Member Functions
    + + + + +
    - +
    bool BlinkLED::isPaused ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns true if the LED blink cycle is paused; false otherwise.

    -
    See also:
    pause(), resume()
    +
    See Also
    pause(), resume()

    Definition at line 44 of file BlinkLED.h.

    - +
    @@ -189,78 +216,98 @@ Public Member Functions
    -
    -
    +

    Perform a single iteration of the blink loop for this LED.

    Definition at line 79 of file BlinkLED.cpp.

    - +
    + + + + + +
    - +
    unsigned long BlinkLED::offTime ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the number of milliseconds the LED will be off.

    -
    See also:
    onTime(), setBlinkRate()
    +
    See Also
    onTime(), setBlinkRate()

    Definition at line 36 of file BlinkLED.h.

    - +
    + + + + + +
    - +
    unsigned long BlinkLED::onTime ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the number of milliseconds the LED will be on.

    -
    See also:
    offTime(), setBlinkRate()
    +
    See Also
    offTime(), setBlinkRate()

    Definition at line 35 of file BlinkLED.h.

    - +
    + + + + + +
    - +
    void BlinkLED::pause ( ) [inline]
    - -
    +
    +inline
    +

    Pauses the LED blink cycle in its current state().

    -
    See also:
    resume(), isPaused()
    +
    See Also
    resume(), isPaused()

    Definition at line 42 of file BlinkLED.h.

    - +
    @@ -271,18 +318,17 @@ Public Member Functions
    -
    -
    +

    Resumes the LED blink cycle after a pause().

    The LED will complete its current onTime() or offTime() and then will switch to the opposite state(). If onTime() or offTime() has already expired, then the LED will immediately switch state.

    -
    See also:
    pause(), isPaused()
    +
    See Also
    pause(), isPaused()

    Definition at line 170 of file BlinkLED.cpp.

    - +
    @@ -304,18 +350,17 @@ Public Member Functions
    -
    -
    +

    Sets the onTime and offTime (in milliseconds).

    The change takes effect immediately. If the current onTime() or offTime() has now expired, then the LED will immediately switch to the opposite state().

    -
    See also:
    onTime(), offTime()
    +
    See Also
    onTime(), offTime()

    Definition at line 122 of file BlinkLED.cpp.

    - +
    @@ -327,33 +372,39 @@ Public Member Functions
    -
    -
    +

    Sets the current state of the LED, where true is on, false is off.

    If the LED is already set to state, then it will complete its current cycle of onTime() or offTime(). Otherwise the LED is immediately set to state and a new cycle begins.

    -
    See also:
    state()
    +
    See Also
    state()

    Definition at line 145 of file BlinkLED.cpp.

    - +
    + + + + + +
    - +
    bool BlinkLED::state ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the current state of the LED; true is on, false is off.

    -
    See also:
    setState()
    +
    See Also
    setState()

    Definition at line 39 of file BlinkLED.h.

    @@ -363,23 +414,12 @@ Public Member Functions
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    BoolField Member List
    -
    -
    -This is the complete list of members for BoolField, including all inherited members. - - - - - - - - - - - - - - - - - - - - -
    BoolField(const String &label)BoolField [explicit]
    BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)BoolField
    dispatch(int event)BoolField [virtual]
    enterField(bool reverse)BoolField [virtual]
    exitField()Field [virtual]
    falseLabel() const BoolField [inline]
    Field(const String &label)Field [explicit]
    Field(Form &form, const String &label)Field
    form() const Field [inline]
    isCurrent() const Field
    label() const Field [inline]
    lcd() const Field [inline, protected]
    setFalseLabel(const String &falseLabel)BoolField
    setLabel(const String &label)Field
    setTrueLabel(const String &trueLabel)BoolField
    setValue(bool value)BoolField
    trueLabel() const BoolField [inline]
    updateCursor()Field [protected, virtual]
    value() const BoolField [inline]
    ~Field()Field
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -100,8 +80,41 @@ This is the complete list of members for +
    +
    +
    +
    BoolField Member List
    +
    +
    + +

    This is the complete list of members for BoolField, including all inherited members.

    + + + + + + + + + + + + + + + + + + + + + +
    BoolField(const String &label)BoolFieldexplicit
    BoolField(Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)BoolField
    dispatch(int event)BoolFieldvirtual
    enterField(bool reverse)BoolFieldvirtual
    exitField()Fieldvirtual
    falseLabel() const BoolFieldinline
    Field(const String &label)Fieldexplicit
    Field(Form &form, const String &label)Field
    form() const Fieldinline
    isCurrent() const Field
    label() const Fieldinline
    lcd() const Fieldinlineprotected
    setFalseLabel(const String &falseLabel)BoolField
    setLabel(const String &label)Field
    setTrueLabel(const String &trueLabel)BoolField
    setValue(bool value)BoolField
    trueLabel() const BoolFieldinline
    updateCursor()Fieldprotectedvirtual
    value() const BoolFieldinline
    ~Field()Field
    + + diff --git a/classBoolField.html b/classBoolField.html index 4d721b8a..b216c79a 100644 --- a/classBoolField.html +++ b/classBoolField.html @@ -2,29 +2,37 @@ + ArduinoLibs: BoolField Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    BoolField Class Reference
    -
    +
    - +

    Field that manages the input of a boolean value. More...

    @@ -80,82 +103,115 @@ Inheritance diagram for BoolField:
    Field - -

    List of all members.

    - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     BoolField (const String &label)
     Constructs a new boolean field with a specific label.
     BoolField (Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)
     Constructs a new boolean field with a specific label and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    bool value () const
     Returns the current value of this field, true or false.
    void setValue (bool value)
     Sets the current value of this field to value.
    const String & trueLabel () const
     Returns the string that is displayed when value() is true.
    void setTrueLabel (const String &trueLabel)
     Sets the string that is displayed when value() is true to trueLabel.
    const String & falseLabel () const
     Returns the string that is displayed when value() is false.
    void setFalseLabel (const String &falseLabel)
     Sets the string that is displayed when value() is false to falseLabel.
     BoolField (const String &label)
     Constructs a new boolean field with a specific label.
     BoolField (Form &form, const String &label, const String &trueLabel, const String &falseLabel, bool value)
     Constructs a new boolean field with a specific label and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    bool value () const
     Returns the current value of this field, true or false.
    void setValue (bool value)
     Sets the current value of this field to value.
    const String & trueLabel () const
     Returns the string that is displayed when value() is true.
    void setTrueLabel (const String &trueLabel)
     Sets the string that is displayed when value() is true to trueLabel.
    const String & falseLabel () const
     Returns the string that is displayed when value() is false.
    void setFalseLabel (const String &falseLabel)
     Sets the string that is displayed when value() is false to falseLabel.
    - Public Member Functions inherited from Field
     Field (const String &label)
     Constructs a new field with a specific label.
    Field (Form &form, const String &label)
     Constructs a new field with a specific label and attaches it to a form.
     ~Field ()
     Destroys this field and removes it from its owning Form.
    +Formform () const
     Returns the Form that owns this field; null if not associated with a Form.
    virtual void exitField ()
     Exits the field due to form navigation.
    const String & label () const
     Returns the label to display in the first line of this field.
    void setLabel (const String &label)
     Sets the label to display in the first line of this field.
    bool isCurrent () const
     Returns true if this field is the currently-displayed field in its owning form; false otherwise.
    + + + + + +

    +Additional Inherited Members

    - Protected Member Functions inherited from Field
    +LiquidCrystal * lcd () const
     Returns the LCD that this field is being drawn on.
    virtual void updateCursor ()
     Updates the cursor position after the label has been drawn by setLabel().
    -

    Detailed Description

    +

    Detailed Description

    Field that manages the input of a boolean value.

    BoolField is intended for field values that are modifiable by the user. Pressing one of Up or Down will toggle the field's current value.

    The following example creates a boolean field that shows the state of the status LED on D13. When the LED is on (the default), the string "On" will be displayed on the LCD screen. When the LED is off, the string "Off" will be displayed instead.

    -
     Form mainForm(lcd);
    - BoolField ledField(mainForm, "Status LED", "On", "Off", true);
    -
    +
    Form mainForm(lcd);
    +
    BoolField ledField(mainForm, "Status LED", "On", "Off", true);
    +
    FormBool.png

    To actually toggle the LED, the application's main loop() function should contain the following code:

    -
     int event = lcd.getButton();
    - if (mainForm.dispatch(event) == FORM_CHANGED) {
    -     if (mainForm.isCurrent(ledField)) {
    -         if (ledField.value())
    -             digitalWrite(STATUS_LED, HIGH);
    -         else
    -             digitalWrite(STATUS_LED, LOW);
    -     }
    - }
    -

    Use TextField for read-only fields that report boolean values but which are not modifiable by the user.

    +
    int event = lcd.getButton();
    +
    if (mainForm.dispatch(event) == FORM_CHANGED) {
    +
    if (mainForm.isCurrent(ledField)) {
    +
    if (ledField.value())
    +
    digitalWrite(STATUS_LED, HIGH);
    +
    else
    +
    digitalWrite(STATUS_LED, LOW);
    +
    }
    +
    }
    +

    Use TextField for read-only fields that report boolean values but which are not modifiable by the user.

    ListField can be used to select between more than two items.

    -
    See also:
    Field, ListField, TextField
    +
    See Also
    Field, ListField, TextField

    Definition at line 28 of file BoolField.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    BoolField::BoolField ( const String &  label) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new boolean field with a specific label.

    The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

    The initial value() will be false.

    -
    See also:
    Form::addField()
    +
    See Also
    Form::addField()

    Definition at line 77 of file BoolField.cpp.

    - +
    @@ -195,39 +251,45 @@ Public Member Functions
    -
    -
    +

    Constructs a new boolean field with a specific label and attaches it to a form.

    The initial value() of the field is set to the parameter value. When value() is true, trueLabel will be displayed on the screen. When value() is false, falseLabel will be displayed on the screen.

    -
    See also:
    value()
    +
    See Also
    value()

    Definition at line 94 of file BoolField.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int BoolField::dispatch ( int  event) [virtual]
    - -
    +
    +virtual
    +

    Dispatches event via this field.

    The event is usually obtained from LCD::getButton().

    Returns zero if the event has been handled and no further action is required.

    Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

    Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

    -
    See also:
    Form::dispatch(), LCD::getButton()
    +
    See Also
    Form::dispatch(), LCD::getButton()

    Reimplemented from Field.

    @@ -235,26 +297,33 @@ Public Member Functions
    + + + + +
    - +
    void BoolField::enterField ( bool  reverse) [virtual]
    - -
    +
    +virtual
    +

    Enters the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

    This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

    The default implementation prints the label().

    -
    See also:
    exitField()
    +
    See Also
    exitField()

    Reimplemented from Field.

    @@ -262,28 +331,35 @@ Public Member Functions
    + + + + +
    - +
    const String & BoolField::falseLabel ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the string that is displayed when value() is false.

    -
    See also:
    setFalseLabel(), trueLabel()
    +
    See Also
    setFalseLabel(), trueLabel()

    Definition at line 43 of file BoolField.h.

    - +
    @@ -295,17 +371,16 @@ Public Member Functions
    -
    -
    +

    Sets the string that is displayed when value() is false to falseLabel.

    -
    See also:
    falseLabel(), setTrueLabel()
    +
    See Also
    falseLabel(), setTrueLabel()

    Definition at line 173 of file BoolField.cpp.

    - +
    @@ -317,17 +392,16 @@ Public Member Functions
    -
    -
    +

    Sets the string that is displayed when value() is true to trueLabel.

    -
    See also:
    trueLabel(), setFalseLabel()
    +
    See Also
    trueLabel(), setFalseLabel()

    Definition at line 153 of file BoolField.cpp.

    - +
    @@ -339,53 +413,66 @@ Public Member Functions
    -
    -
    +

    Sets the current value of this field to value.

    -
    See also:
    value()
    +
    See Also
    value()

    Definition at line 131 of file BoolField.cpp.

    - +
    + + + + + +
    - +
    const String & BoolField::trueLabel ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the string that is displayed when value() is true.

    -
    See also:
    setTrueLabel(), falseLabel()
    +
    See Also
    setTrueLabel(), falseLabel()

    Definition at line 40 of file BoolField.h.

    - +
    + + + + + +
    - +
    bool BoolField::value ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the current value of this field, true or false.

    -
    See also:
    setValue()
    +
    See Also
    setValue()

    Definition at line 37 of file BoolField.h.

    @@ -395,23 +482,12 @@ Public Member Functions
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Charlieplex Member List
    -
    -
    -This is the complete list of members for Charlieplex, including all inherited members. - - - - - - - - - - - -
    Charlieplex(const uint8_t *pins, uint8_t numPins)Charlieplex
    count() const Charlieplex [inline]
    holdTime() const Charlieplex [inline]
    led(int index) const Charlieplex [inline]
    loop()Charlieplex
    pwmLed(int index) const Charlieplex [inline]
    refresh()Charlieplex
    setHoldTime(unsigned long us)Charlieplex [inline]
    setLed(int index, bool value)Charlieplex [inline]
    setPwmLed(int index, uint8_t value)Charlieplex [inline]
    ~Charlieplex()Charlieplex
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -91,8 +80,32 @@ This is the complete list of members for +
    +
    +
    +
    Charlieplex Member List
    +
    +
    + +

    This is the complete list of members for Charlieplex, including all inherited members.

    + + + + + + + + + + + + +
    Charlieplex(const uint8_t *pins, uint8_t numPins)Charlieplex
    count() const Charlieplexinline
    holdTime() const Charlieplexinline
    led(int index) const Charlieplexinline
    loop()Charlieplex
    pwmLed(int index) const Charlieplexinline
    refresh()Charlieplex
    setHoldTime(unsigned long us)Charlieplexinline
    setLed(int index, bool value)Charlieplexinline
    setPwmLed(int index, uint8_t value)Charlieplexinline
    ~Charlieplex()Charlieplex
    + + diff --git a/classCharlieplex.html b/classCharlieplex.html index c455d900..66a2377e 100644 --- a/classCharlieplex.html +++ b/classCharlieplex.html @@ -2,29 +2,37 @@ + ArduinoLibs: Charlieplex Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    Charlieplex Class Reference
    -
    +
    - +

    Manage an array of LED's in a charlieplexed arrangement. More...

    #include <Charlieplex.h>

    - -

    List of all members.

    - - - - + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     Charlieplex (const uint8_t *pins, uint8_t numPins)
     Constructs a new charliexplexing array where the output pins are specified by the numPins entries in pins.
    +
     Charlieplex (const uint8_t *pins, uint8_t numPins)
     Constructs a new charliexplexing array where the output pins are specified by the numPins entries in pins.
     ~Charlieplex ()
     Destroys this charlieplexed array.
    int count () const
     Returns the number of LED's in this charlieplexed array based on the number of pins.
    bool led (int index) const
     Returns the value of the LED at index in the charplexed array; true if lit; false if not lit.
    void setLed (int index, bool value)
     Sets the value of the LED at index in the charliplexed array.
    uint8_t pwmLed (int index) const
     Returns the PWM value of the LED at index in the charplexed array; between 0 and 255.
    void setPwmLed (int index, uint8_t value)
     Sets the PWM value of the LED at index in the charliplexed array; between 0 and 255.
    unsigned long holdTime () const
     Returns the number of microseconds that each LED should be held on for before moving onto the next in loop().
    void setHoldTime (unsigned long us)
     Sets the number of microseconds that each LED should be held on for before moving onto the next in loop() to us.
    void loop ()
     Runs the multiplexing loop, to display the LED states on the charlieplexed array.
    void refresh ()
     Refreshes the charlieplexed array by advancing to the next LED that needs to be lit.
     Destroys this charlieplexed array.
    int count () const
     Returns the number of LED's in this charlieplexed array based on the number of pins.
    bool led (int index) const
     Returns the value of the LED at index in the charplexed array; true if lit; false if not lit.
    void setLed (int index, bool value)
     Sets the value of the LED at index in the charliplexed array.
    uint8_t pwmLed (int index) const
     Returns the PWM value of the LED at index in the charplexed array; between 0 and 255.
    void setPwmLed (int index, uint8_t value)
     Sets the PWM value of the LED at index in the charliplexed array; between 0 and 255.
    unsigned long holdTime () const
     Returns the number of microseconds that each LED should be held on for before moving onto the next in loop().
    void setHoldTime (unsigned long us)
     Sets the number of microseconds that each LED should be held on for before moving onto the next in loop() to us.
    void loop ()
     Runs the multiplexing loop, to display the LED states on the charlieplexed array.
    void refresh ()
     Refreshes the charlieplexed array by advancing to the next LED that needs to be lit.
    -

    Detailed Description

    +

    Detailed Description

    Manage an array of LED's in a charlieplexed arrangement.

    Charlieplexing is a technique for multiplexing large numbers of LED's on a small number of microcontroller output pins. LED's are arranged in complementary pairs; the simplest being for two output pins:

    @@ -112,21 +133,21 @@ Public Member Functions
    @@ -170,8 +191,8 @@ byte pins[3] = {9, 10, 11};

    Definition at line 28 of file Charlieplex.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    @@ -193,31 +214,37 @@ byte pins[3] = {9, 10, 11};
    -
    -
    +

    Constructs a new charliexplexing array where the output pins are specified by the numPins entries in pins.

    Note: numPins must be 2 or greater for correct operation.

    -
    See also:
    count(), setLed()
    +
    See Also
    count(), setLed()

    Definition at line 121 of file Charlieplex.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int Charlieplex::count ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the number of LED's in this charlieplexed array based on the number of pins.

    @@ -244,58 +271,72 @@ byte pins[3] = {9, 10, 11};
    nn * (n - 1)
    -
    See also:
    led()
    +
    See Also
    led()

    Definition at line 34 of file Charlieplex.h.

    - +
    + + + + + +
    - +
    unsigned long Charlieplex::holdTime ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the number of microseconds that each LED should be held on for before moving onto the next in loop().

    The default value is calculated so that all LED's can be refreshed with a rate of at least 200 Hz, which is necessary for handling PWM output on multiple LED's. The less LED's that are lit at once, the faster the display will refresh.

    -
    See also:
    setHoldTime(), loop()
    +
    See Also
    setHoldTime(), loop()

    Definition at line 42 of file Charlieplex.h.

    - +
    + + + + + +
    - +
    bool Charlieplex::led ( int  index) const [inline] const
    - -
    +
    +inline
    +

    Returns the value of the LED at index in the charplexed array; true if lit; false if not lit.

    If the LED is displaying a PWM value, then this function will return true for any non-zero PWM value.

    -
    See also:
    setLed(), pwmLed()
    +
    See Also
    setLed(), pwmLed()

    Definition at line 36 of file Charlieplex.h.

    - +
    @@ -306,42 +347,48 @@ byte pins[3] = {9, 10, 11};
    -
    -
    +

    Runs the multiplexing loop, to display the LED states on the charlieplexed array.

    If holdTime() microseconds have elapsed since the last call to loop(), then the current LED is turned off and the next LED that needs to be lit is turned on.

    LED's that do not need to be lit are skipped. The total time for a single pass through all lit LED's may be very short if only a few LED's are lit at once. If all LED's are lit, then the total time for a single pass will be count() * holdTime() microseconds.

    If the application is using timer interrupts to drive the multiplexing process, then use refresh() instead of loop().

    -
    See also:
    led(), pwmLed(), holdTime(), refresh()
    +
    See Also
    led(), pwmLed(), holdTime(), refresh()

    Definition at line 277 of file Charlieplex.cpp.

    - +
    + + + + + +
    - +
    uint8_t Charlieplex::pwmLed ( int  index) const [inline] const
    - -
    +
    +inline
    +

    Returns the PWM value of the LED at index in the charplexed array; between 0 and 255.

    -
    See also:
    setPwmLed(), led()
    +
    See Also
    setPwmLed(), led()

    Definition at line 39 of file Charlieplex.h.

    - +
    @@ -352,42 +399,51 @@ byte pins[3] = {9, 10, 11};
    -
    -
    +

    Refreshes the charlieplexed array by advancing to the next LED that needs to be lit.

    This function is intended to be called from a timer interrupt service routine to advance the multiplexing state without the main application having to explicitly call loop().

    -
    See also:
    loop()
    +
    See Also
    loop()

    Definition at line 296 of file Charlieplex.cpp.

    - +
    + + + + + +
    - +
    void Charlieplex::setHoldTime ( unsigned long  us) [inline]
    - -
    +
    +inline
    +

    Sets the number of microseconds that each LED should be held on for before moving onto the next in loop() to us.

    -
    See also:
    holdTime(), loop()
    +
    See Also
    holdTime(), loop()

    Definition at line 43 of file Charlieplex.h.

    - +
    + + + + + +
    @@ -404,23 +460,30 @@ byte pins[3] = {9, 10, 11}; - +
    void Charlieplex::setLed
    ) [inline]
    - -
    +
    +inline
    +

    Sets the value of the LED at index in the charliplexed array.

    The brightness of the LED will be proportional to the number of LED's that are currently lit, as the holdTime() refresh rate will cause the LED to appear to dim; the more LED's that are lit the less overall time each individual LED is held on. For best results, only a single LED should be lit at once or higher-brightness LED's should be used.

    -
    See also:
    led(), setPwmLed()
    +
    See Also
    led(), setPwmLed()

    Definition at line 37 of file Charlieplex.h.

    - +
    + + + + + +
    @@ -437,16 +500,20 @@ byte pins[3] = {9, 10, 11}; - +
    void Charlieplex::setPwmLed
    ) [inline]
    - -
    +
    +inline
    +

    Sets the PWM value of the LED at index in the charliplexed array; between 0 and 255.

    If this function is used, then it is assumed that the output pins are capable of PWM output.

    The PWM-specified brightness of the LED will also be affected to the number of LED's that are currently lit, as the holdTime() refresh rate will cause the LED to appear to dim; the more LED's that are lit the less overall time each individual LED is held on. For best results, only a single LED should be lit at once or higher-brightness LED's should be used.

    -
    See also:
    pwmLed(), setLed()
    +
    See Also
    pwmLed(), setLed()

    Definition at line 40 of file Charlieplex.h.

    @@ -456,23 +523,12 @@ byte pins[3] = {9, 10, 11};
  • Charlieplex.h
  • Charlieplex.cpp
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/classChaseLEDs-members.html b/classChaseLEDs-members.html index 1b620df9..aff58bc5 100644 --- a/classChaseLEDs-members.html +++ b/classChaseLEDs-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    ChaseLEDs Member List
    -
    -
    -This is the complete list of members for ChaseLEDs, including all inherited members. - - - - - - -
    advance(uint8_t prevPin, uint8_t nextPin)ChaseLEDs [protected, virtual]
    advanceTime() const ChaseLEDs [inline]
    ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)ChaseLEDs
    loop()ChaseLEDs
    previousPin(int n) const ChaseLEDs [inline, protected]
    setAdvanceTime(unsigned long advanceTime)ChaseLEDs [inline]
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -86,8 +80,27 @@ This is the complete list of members for +
    +
    +
    +
    ChaseLEDs Member List
    +
    +
    + +

    This is the complete list of members for ChaseLEDs, including all inherited members.

    + + + + + + + +
    advance(uint8_t prevPin, uint8_t nextPin)ChaseLEDsprotectedvirtual
    advanceTime() const ChaseLEDsinline
    ChaseLEDs(const uint8_t *pins, int num, unsigned long advanceTime)ChaseLEDs
    loop()ChaseLEDs
    previousPin(int n) const ChaseLEDsinlineprotected
    setAdvanceTime(unsigned long advanceTime)ChaseLEDsinline
    + + diff --git a/classChaseLEDs.html b/classChaseLEDs.html index 0b6078ef..c2a3bc36 100644 --- a/classChaseLEDs.html +++ b/classChaseLEDs.html @@ -2,29 +2,37 @@ + ArduinoLibs: ChaseLEDs Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    ChaseLEDs Class Reference
    -
    +
    - +

    Chase LED's on output pins in a defined sequence. More...

    #include <ChaseLEDs.h>

    - -

    List of all members.

    - - - - - - - - - + + + + + + +

    +

    Public Member Functions

     ChaseLEDs (const uint8_t *pins, int num, unsigned long advanceTime)
     Initializes the LED chaser.
    void loop ()
    unsigned long advanceTime () const
     Returns the number of milliseconds that each LED will be lit in the chase sequence.
    void setAdvanceTime (unsigned long advanceTime)
     Sets the number of milliseconds to advance between LED's to advanceTime.

    +

     ChaseLEDs (const uint8_t *pins, int num, unsigned long advanceTime)
     Initializes the LED chaser.
    void loop ()
    unsigned long advanceTime () const
     Returns the number of milliseconds that each LED will be lit in the chase sequence.
    void setAdvanceTime (unsigned long advanceTime)
     Sets the number of milliseconds to advance between LED's to advanceTime.
    + - - - - + + + +

    Protected Member Functions

    virtual void advance (uint8_t prevPin, uint8_t nextPin)
     Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.
    uint8_t previousPin (int n) const
     Returns the pin that is n steps back in the sequence.
    virtual void advance (uint8_t prevPin, uint8_t nextPin)
     Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.
    uint8_t previousPin (int n) const
     Returns the pin that is n steps back in the sequence.
    -

    Detailed Description

    +

    Detailed Description

    Chase LED's on output pins in a defined sequence.

    The following example performs a LED chase over the 6 PWM outputs on the Arduino Uno, with a 150 millisecond delay between each LED:

    -
     uint8_t pins[] = {3, 5, 6, 9, 10, 11};
    - ChaseLEDs chaser(pins, sizeof(pins), 150);
    -
    - void loop() {
    -     chaser.loop();
    - }
    -

    After pin 11 is lit, the pattern will repeat at pin 3. To cause the chase to oscillate back and forth instead, extend the sequence as follows:

    -
     uint8_t pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
    - ChaseLEDs chaser(pins, sizeof(pins), 150);
    -

    See the Cylon example for more information on how to use the ChaseLEDs class in a practical application.

    +
    uint8_t pins[] = {3, 5, 6, 9, 10, 11};
    +
    ChaseLEDs chaser(pins, sizeof(pins), 150);
    +
    +
    void loop() {
    +
    chaser.loop();
    +
    }
    +

    After pin 11 is lit, the pattern will repeat at pin 3. To cause the chase to oscillate back and forth instead, extend the sequence as follows:

    +
    uint8_t pins[] = {3, 5, 6, 9, 10, 11, 10, 9, 6, 5};
    +
    ChaseLEDs chaser(pins, sizeof(pins), 150);
    +

    See the Cylon example for more information on how to use the ChaseLEDs class in a practical application.

    Definition at line 28 of file ChaseLEDs.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    @@ -135,22 +157,24 @@ Protected Member Functions
    -
    -
    +

    Initializes the LED chaser.

    The chase sequence consists of num pins, whose names are given by the pins array. Each LED is lit for advanceTime milliseconds before advancing to the next LED.

    This constructor configures all of the pins for output and sets their state to be LOW. The first LED will be lit when the program first calls loop().

    -
    See also:
    loop()
    +
    See Also
    loop()

    Definition at line 71 of file ChaseLEDs.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    @@ -167,45 +191,56 @@ Protected Member Functions - +
    void ChaseLEDs::advance
    ) [protected, virtual]
    - -
    +
    +protectedvirtual
    +

    Advances to the next LED in sequence, turning off prevPin, and turning on nextPin.

    The default implementation is equivalent to the following code:

    -
     digitalWrite(prevPin, LOW);
    - digitalWrite(nextPin, HIGH);
    -

    This method may be overridden in subclasses to provide special effects. See the documentation for previousPin() for some example effects.

    -
    See also:
    previousPin()
    +
    digitalWrite(prevPin, LOW);
    +
    digitalWrite(nextPin, HIGH);
    +

    This method may be overridden in subclasses to provide special effects. See the documentation for previousPin() for some example effects.

    +
    See Also
    previousPin()

    Definition at line 136 of file ChaseLEDs.cpp.

    - +
    + + + + + +
    - +
    unsigned long ChaseLEDs::advanceTime ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the number of milliseconds that each LED will be lit in the chase sequence.

    -
    See also:
    setAdvanceTime(), advance()
    +
    See Also
    setAdvanceTime(), advance()

    Definition at line 35 of file ChaseLEDs.h.

    - +
    @@ -216,70 +251,83 @@ Protected Member Functions
    -
    -
    +

    Perform a single iteration of the control loop for this LED chaser.

    Definition at line 87 of file ChaseLEDs.cpp.

    - +
    + + + + + +
    - +
    uint8_t ChaseLEDs::previousPin ( int  n) const [inline, protected] const
    - -
    +
    +inlineprotected
    +

    Returns the pin that is n steps back in the sequence.

    If n is zero, then the current pin is returned; if n is 1, then the previous pin is returned; and so on.

    This function may be called by subclasses in their advance() method to manipulate pins that are further back in the chase sequence than the immediately previous pin.

    For example, the following code implements a LED chaser that lights two pins at a time:

    -
     void DoubleChaser::advance(uint8_t prevPin, uint8_t nextPin)
    - {
    -      digitalWrite(previousPin(2), LOW);
    -      digitalWrite(prevPin, HIGH);
    -      digitalWrite(nextPin, HIGH);
    - }
    -

    As another exmaple, the following code uses PWM outputs to fade out the previous pin rather than turn it off immediately:

    -
     void FadingChaser::advance(uint8_t prevPin, uint8_t nextPin)
    - {
    -      digitalWrite(previousPin(2), LOW);
    -      analogWrite(prevPin, 32);
    -      digitalWrite(nextPin, HIGH);
    - }
    -

    Note: it is possible to retrieve the following pin in sequence using previousPin(-1). This could be used to fade in the LED that follows nextPin.

    -
    See also:
    advance()
    +
    void DoubleChaser::advance(uint8_t prevPin, uint8_t nextPin)
    +
    {
    +
    digitalWrite(previousPin(2), LOW);
    +
    digitalWrite(prevPin, HIGH);
    +
    digitalWrite(nextPin, HIGH);
    +
    }
    +

    As another exmaple, the following code uses PWM outputs to fade out the previous pin rather than turn it off immediately:

    +
    void FadingChaser::advance(uint8_t prevPin, uint8_t nextPin)
    +
    {
    +
    digitalWrite(previousPin(2), LOW);
    +
    analogWrite(prevPin, 32);
    +
    digitalWrite(nextPin, HIGH);
    +
    }
    +

    Note: it is possible to retrieve the following pin in sequence using previousPin(-1). This could be used to fade in the LED that follows nextPin.

    +
    See Also
    advance()

    Definition at line 40 of file ChaseLEDs.h.

    - +
    + + + + + +
    - +
    void ChaseLEDs::setAdvanceTime ( unsigned long  advanceTime) [inline]
    - -
    +
    +inline
    +

    Sets the number of milliseconds to advance between LED's to advanceTime.

    -
    See also:
    advanceTime(), advance()
    +
    See Also
    advanceTime(), advance()

    Definition at line 36 of file ChaseLEDs.h.

    @@ -289,23 +337,12 @@ Protected Member Functions
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    DMD Member List
    -
    -
    -This is the complete list of members for DMD, including all inherited members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bitmap(int width, int height)Bitmap
    bitsPerPixel() const Bitmap [inline]
    BlackBitmap [static]
    charWidth(char ch) const Bitmap
    clear(Color color=Black)Bitmap
    Color typedefBitmap
    copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)Bitmap
    data()Bitmap [inline]
    data() const Bitmap [inline]
    disableTimer1()DMD
    disableTimer2()DMD
    DMD(int widthPanels=1, int heightPanels=1)DMD [explicit]
    doubleBuffer() const DMD [inline]
    drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)Bitmap
    drawBitmap(int x, int y, const prog_uint8_t *bitmap, Color color=White)Bitmap
    drawChar(int x, int y, char ch)Bitmap
    drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)Bitmap
    drawFilledCircle(int centerX, int centerY, int radius, Color color=White)Bitmap [inline]
    drawFilledRect(int x1, int y1, int x2, int y2, Color color=White)Bitmap [inline]
    drawInvertedBitmap(int x, int y, const Bitmap &bitmap)Bitmap [inline]
    drawInvertedBitmap(int x, int y, const prog_uint8_t *bitmap)Bitmap [inline]
    drawLine(int x1, int y1, int x2, int y2, Color color=White)Bitmap
    drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)Bitmap
    drawText(int x, int y, const char *str, int len=-1)Bitmap
    drawText(int x, int y, const String &str, int start=0, int len=-1)Bitmap
    enableTimer1()DMD
    enableTimer2()DMD
    fill(int x, int y, int width, int height, Color color)Bitmap
    fill(int x, int y, int width, int height, const prog_uint8_t *pattern, Color color=White)Bitmap
    font() const Bitmap [inline]
    fromRGB(uint8_t r, uint8_t g, uint8_t b)DMD [static]
    height() const Bitmap [inline]
    invert(int x, int y, int width, int height)Bitmap
    isValid() const Bitmap [inline]
    loop()DMD
    NoFillBitmap [static]
    pixel(int x, int y) const Bitmap
    refresh()DMD
    scroll(int dx, int dy, Color fillColor=Black)Bitmap [inline]
    scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)Bitmap
    setDoubleBuffer(bool doubleBuffer)DMD
    setFont(const prog_uint8_t *font)Bitmap [inline]
    setPixel(int x, int y, Color color)Bitmap
    setTextColor(Color color)Bitmap [inline]
    stride() const Bitmap [inline]
    swapBuffers()DMD
    swapBuffersAndCopy()DMD
    textColor() const Bitmap [inline]
    textHeight() const Bitmap
    textWidth(const char *str, int len=-1) const Bitmap
    textWidth(const String &str, int start=0, int len=-1) const Bitmap
    WhiteBitmap [static]
    width() const Bitmap [inline]
    ~Bitmap()Bitmap
    ~DMD()DMD
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -135,8 +80,78 @@ This is the complete list of members for DMD<
    - + +
    +
    +
    DMD Member List
    +
    +
    + +

    This is the complete list of members for DMD, including all inherited members.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Bitmap(int width, int height)Bitmap
    bitsPerPixel() const Bitmapinline
    BlackBitmapstatic
    charWidth(char ch) const Bitmap
    clear(Color color=Black)Bitmap
    Color typedefBitmap
    copy(int x, int y, int width, int height, Bitmap *dest, int destX, int destY)Bitmap
    data()Bitmapinline
    data() const Bitmapinline
    disableTimer1()DMD
    disableTimer2()DMD
    DMD(int widthPanels=1, int heightPanels=1)DMDexplicit
    doubleBuffer() const DMDinline
    drawBitmap(int x, int y, const Bitmap &bitmap, Color color=White)Bitmap
    drawBitmap(int x, int y, Bitmap::ProgMem bitmap, Color color=White)Bitmap
    drawChar(int x, int y, char ch)Bitmap
    drawCircle(int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)Bitmap
    drawFilledCircle(int centerX, int centerY, int radius, Color color=White)Bitmapinline
    drawFilledRect(int x1, int y1, int x2, int y2, Color color=White)Bitmapinline
    drawInvertedBitmap(int x, int y, const Bitmap &bitmap)Bitmapinline
    drawInvertedBitmap(int x, int y, Bitmap::ProgMem bitmap)Bitmapinline
    drawLine(int x1, int y1, int x2, int y2, Color color=White)Bitmap
    drawRect(int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)Bitmap
    drawText(int x, int y, const char *str, int len=-1)Bitmap
    drawText(int x, int y, const String &str, int start=0, int len=-1)Bitmap
    enableTimer1()DMD
    enableTimer2()DMD
    fill(int x, int y, int width, int height, Color color)Bitmap
    fill(int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)Bitmap
    font() const Bitmapinline
    Font typedefBitmap
    fromRGB(uint8_t r, uint8_t g, uint8_t b)DMDstatic
    height() const Bitmapinline
    invert(int x, int y, int width, int height)Bitmap
    isValid() const Bitmapinline
    loop()DMD
    NoFillBitmapstatic
    pixel(int x, int y) const Bitmap
    ProgMem typedefBitmap
    refresh()DMD
    scroll(int dx, int dy, Color fillColor=Black)Bitmapinline
    scroll(int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)Bitmap
    setDoubleBuffer(bool doubleBuffer)DMD
    setFont(Font font)Bitmapinline
    setPixel(int x, int y, Color color)Bitmap
    setTextColor(Color color)Bitmapinline
    stride() const Bitmapinline
    swapBuffers()DMD
    swapBuffersAndCopy()DMD
    textColor() const Bitmapinline
    textHeight() const Bitmap
    textWidth(const char *str, int len=-1) const Bitmap
    textWidth(const String &str, int start=0, int len=-1) const Bitmap
    WhiteBitmapstatic
    width() const Bitmapinline
    ~Bitmap()Bitmap
    ~DMD()DMD
    + + diff --git a/classDMD.html b/classDMD.html index a3938d29..8ebb8eda 100644 --- a/classDMD.html +++ b/classDMD.html @@ -2,29 +2,37 @@ + ArduinoLibs: DMD Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    DMD Class Reference
    -
    +
    - +

    Handle large dot matrix displays composed of LED's. More...

    @@ -81,135 +104,234 @@ Inheritance diagram for DMD:
    Bitmap - -

    List of all members.

    - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     DMD (int widthPanels=1, int heightPanels=1)
     Constructs a new dot matrix display handler for a display that is widthPanels x heightPanels in size.
    +
     DMD (int widthPanels=1, int heightPanels=1)
     Constructs a new dot matrix display handler for a display that is widthPanels x heightPanels in size.
     ~DMD ()
     Destroys this dot matrix display handler.
    bool doubleBuffer () const
     Returns true if the display is double-buffered; false if single-buffered. The default is false.
    void setDoubleBuffer (bool doubleBuffer)
     Enables or disables double-buffering according to doubleBuffer.
    void swapBuffers ()
     Swaps the buffers that are used for rendering to the display.
    void swapBuffersAndCopy ()
     Swaps the buffers that are used for rendering to the display and copies the former back buffer contents to the new back buffer.
    void loop ()
     Performs regular display refresh activities from the application's main loop.
    void refresh ()
     Refresh the display.
    void enableTimer1 ()
     Enables Timer1 overflow interrupts for updating this display.
    void disableTimer1 ()
     Disables Timer1 overflow interrupts.
    void enableTimer2 ()
     Enables Timer2 overflow interrupts for updating this display.
    void disableTimer2 ()
     Disables Timer2 overflow interrupts.

    +

     Destroys this dot matrix display handler.
    bool doubleBuffer () const
     Returns true if the display is double-buffered; false if single-buffered. The default is false.
    void setDoubleBuffer (bool doubleBuffer)
     Enables or disables double-buffering according to doubleBuffer.
    void swapBuffers ()
     Swaps the buffers that are used for rendering to the display.
    void swapBuffersAndCopy ()
     Swaps the buffers that are used for rendering to the display and copies the former back buffer contents to the new back buffer.
    void loop ()
     Performs regular display refresh activities from the application's main loop.
    void refresh ()
     Refresh the display.
    void enableTimer1 ()
     Enables Timer1 overflow interrupts for updating this display.
    void disableTimer1 ()
     Disables Timer1 overflow interrupts.
    void enableTimer2 ()
     Enables Timer2 overflow interrupts for updating this display.
    void disableTimer2 ()
     Disables Timer2 overflow interrupts.
    - Public Member Functions inherited from Bitmap
     Bitmap (int width, int height)
     Constructs a new in-memory bitmap that is width x height pixels in size.
    ~Bitmap ()
     Destroys this bitmap.
    bool isValid () const
     Returns true if the memory for this bitmap is valid; false otherwise.
    int width () const
     Returns the width of the bitmap in pixels.
    int height () const
     Returns the height of the bitmap in pixels.
    int stride () const
     Returns the number of bytes in each line of the bitmap's data() buffer.
    int bitsPerPixel () const
     Returns the number of bits per pixel for the bitmap; always 1.
    uint8_t * data ()
     Returns a pointer to the start of the bitmap's data buffer.
    +const uint8_t * data () const
     Returns a constant pointer to the start of the bitmap's data buffer.This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
    void clear (Color color=Black)
     Clears the entire bitmap to the specified color.
    Color pixel (int x, int y) const
     Returns the color of the pixel at (x, y); either Black or White.
    void setPixel (int x, int y, Color color)
     Sets the pixel at (x, y) to color.
    void drawLine (int x1, int y1, int x2, int y2, Color color=White)
     Draws a line from (x1, y1) to (x2, y2) in color.
    void drawRect (int x1, int y1, int x2, int y2, Color borderColor=White, Color fillColor=NoFill)
     Draws a rectangle from (x1, y1) to (x2, y2), with the outline in borderColor and the interior filled with fillColor.
    void drawFilledRect (int x1, int y1, int x2, int y2, Color color=White)
     Draws a filled rectangle from (x1, y1) to (x2, y2) in color.
    void drawCircle (int centerX, int centerY, int radius, Color borderColor=White, Color fillColor=NoFill)
     Draws a circle with a specific center (centerX, centerY) and radius, with the outline in borderColor and the interior filled with fillColor.
    void drawFilledCircle (int centerX, int centerY, int radius, Color color=White)
     Draws a filled circle with a specific center (centerX, centerY) and radius in color.
    void drawBitmap (int x, int y, const Bitmap &bitmap, Color color=White)
     Draws bitmap at (x, y) in color.
    void drawBitmap (int x, int y, Bitmap::ProgMem bitmap, Color color=White)
     Draws bitmap at (x, y) in color.
    void drawInvertedBitmap (int x, int y, const Bitmap &bitmap)
     Draws bitmap at (x, y) in inverted colors.
    void drawInvertedBitmap (int x, int y, Bitmap::ProgMem bitmap)
     Draws bitmap at (x, y) in inverted colors.
    Font font () const
     Returns the currently selected font, or null if none selected.
    void setFont (Font font)
     Sets the font for use with drawText() and drawChar().
    Color textColor () const
     Returns the color that will be used for drawing text with drawText() and drawChar(). The default is White.
    void setTextColor (Color color)
     Sets the color that will be used for drawing text with drawText() and drawChar().
    void drawText (int x, int y, const char *str, int len=-1)
     Draws the len characters of str at (x, y).
    void drawText (int x, int y, const String &str, int start=0, int len=-1)
     Draws len characters starting at start from str to the screen at (x, y).
    int drawChar (int x, int y, char ch)
     Draws a single character ch at (x, y).
    int charWidth (char ch) const
     Returns the width in pixels of ch in the current font().
    int textWidth (const char *str, int len=-1) const
     Returns the width in pixels of the len characters of str in the current font(), including inter-character spacing.
    int textWidth (const String &str, int start=0, int len=-1) const
     Returns the width in pixels of the len characters of str in the current font(), starting at start, including inter-character spacing.
    int textHeight () const
     Returns the height in pixels of the current text drawing font(); or zero if font() is not set.
    void copy (int x, int y, int width, int height, Bitmap *dest, int destX, int destY)
     Copies the width x height pixels starting at top-left corner (x, y) to (destX, destY) in the bitmap dest.
    void fill (int x, int y, int width, int height, Color color)
     Fills the width x height pixels starting at top-left corner (x, y) with color.
    void fill (int x, int y, int width, int height, Bitmap::ProgMem pattern, Color color=White)
     Fills the width x height pixels starting at top-left corner (x, y) with the contents of pattern.
    void scroll (int dx, int dy, Color fillColor=Black)
     Scrolls the entire contents of the bitmap by dx and dy.
    void scroll (int x, int y, int width, int height, int dx, int dy, Color fillColor=Black)
     Scrolls the width x height pixels starting at top-left corner (x, y) by dx and dy.
    void invert (int x, int y, int width, int height)
     Inverts the width x height pixels starting at top-left corner (x, y).
    + - - + + +

    Static Public Member Functions

    static Color fromRGB (uint8_t r, uint8_t g, uint8_t b)
     Converts an RGB value into a pixel color value.
    static Color fromRGB (uint8_t r, uint8_t g, uint8_t b)
     Converts an RGB value into a pixel color value.
    + + + + + + + + + + + + + + +

    +Additional Inherited Members

    - Public Types inherited from Bitmap
    typedef uint8_t Color
     Type that represents the color of a pixel in a bitmap.
    +typedef PGM_VOID_P ProgMem
     Type that represents a bitmap within program memory.
    +typedef PGM_VOID_P Font
     Type that represents a font within program memory.
    - Static Public Attributes inherited from Bitmap
    +static const Color Black = 0
     Color value corresponding to "black".
    static const Color White = 1
     Color value corresponding to "white". If the bitmap is displayed on a LED array, then it may have a different physical color.
    +static const Color NoFill = 2
     Special color value that is used with drawRect() and drawCircle() to indicate that the interior of the shape should not be filled. For all other uses, NoFill is equivalent to White.
    -

    Detailed Description

    +

    Detailed Description

    Handle large dot matrix displays composed of LED's.

    This class is designed for use with Freetronics Large Dot Matrix Displays. These displays have 512 LED's arranged in a 32x16 matrix and controlled by an SPI interface. The displays are available in red, blue, green, yellow, and white variations (for which this class always uses the constant White regardless of the physical color).

    -

    -Drawing

    +

    +Drawing

    DMD inherits from Bitmap so that any of the drawing functions in that class can be used to draw directly to dot matrix displays. The following example initializes a single display panel and draws a rectangle and a circle into it at setup time:

    -
     #include <DMD.h>
    -
    - DMD display;
    -
    - void setup() {
    -     display.drawRect(5, 2, 27, 13);
    -     display.drawCircle(16, 8, 4);
    - }
    -

    The display must be updated frequently from the application's main loop:

    -
     void loop() {
    -     display.loop();
    - }
    -

    -Interrupt-driven display refresh

    +
    #include <DMD.h>
    +
    +
    DMD display;
    +
    +
    void setup() {
    +
    display.drawRect(5, 2, 27, 13);
    +
    display.drawCircle(16, 8, 4);
    +
    }
    +

    The display must be updated frequently from the application's main loop:

    +
    void loop() {
    +
    display.loop();
    +
    }
    +

    +Interrupt-driven display refresh

    The loop() method simplifies updating the display from the application's main loop but it can sometimes be inconvenient to arrange for it to be called regularly, especially if the application wishes to use delay() or delayMicroseconds().

    DMD provides an asynchronous display update mechanism using Timer1 interrupts. The application turns on interrupts using enableTimer1() and then calls refresh() from the interrupt service routine:

    -
     #include <DMD.h>
    -
    - DMD display;
    -
    - ISR(TIMER1_OVF_vect)
    - {
    -     display.refresh();
    - }
    -
    - void setup() {
    -     display.enableTimer1();
    - }
    -

    If Timer1 is already in use by some other part of your application, then Timer2 can be used as an alternative interrupt source:

    -
     #include <DMD.h>
    -
    - DMD display;
    -
    - ISR(TIMER2_OVF_vect)
    - {
    -     display.refresh();
    - }
    -
    - void setup() {
    -     display.enableTimer2();
    - }
    -

    DMD can also be used with third-party timer libraries such as TimerOne:

    -
     #include <DMD.h>
    - #include <TimerOne.h>
    -
    - DMD display;
    -
    - void refreshDisplay()
    - {
    -     display.refresh();
    - }
    -
    - void setup() {
    -     Timer1.initialize(5000);
    -     Timer1.attachInterrupt(refreshDisplay);
    - }
    -

    -Double buffering

    +
    #include <DMD.h>
    +
    +
    DMD display;
    +
    +
    ISR(TIMER1_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.enableTimer1();
    +
    }
    +

    If Timer1 is already in use by some other part of your application, then Timer2 can be used as an alternative interrupt source:

    +
    #include <DMD.h>
    +
    +
    DMD display;
    +
    +
    ISR(TIMER2_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.enableTimer2();
    +
    }
    +

    DMD can also be used with third-party timer libraries such as TimerOne:

    +
    #include <DMD.h>
    +
    #include <TimerOne.h>
    +
    +
    DMD display;
    +
    +
    void refreshDisplay()
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    Timer1.initialize(5000);
    +
    Timer1.attachInterrupt(refreshDisplay);
    +
    }
    +

    +Double buffering

    When using interrupts, the system can sometimes exhibit "tearing" artifacts where half-finished images are displayed because an interrupt fired in the middle of a screen update.

    This problem can be alleviated using double buffering: all rendering is done to an off-screen buffer that is swapped onto the screen once it is ready for display. Rendering then switches to the other buffer that is now off-screen. The following example demonstrates this:

    -
     #include <DMD.h>
    -
    - DMD display;
    -
    - ISR(TIMER1_OVF_vect)
    - {
    -     display.refresh();
    - }
    -
    - void setup() {
    -     display.setDoubleBuffer(true);
    -     display.enableTimer1();
    - }
    -
    - void loop() {
    -     updateDisplay();
    -     display.swapBuffers();
    -     delay(50);   // Delay between frames.
    - }
    -
    - void updateDisplay() {
    -     // Draw the new display contents into the off-screen buffer.
    -     display.clear();
    -     ...
    - }
    -

    The downside of double buffering is that it uses twice as much main memory to manage the contents of the screen.

    -

    -Multiple panels

    +
    #include <DMD.h>
    +
    +
    DMD display;
    +
    +
    ISR(TIMER1_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.setDoubleBuffer(true);
    +
    display.enableTimer1();
    +
    }
    +
    +
    void loop() {
    +
    updateDisplay();
    +
    display.swapBuffers();
    +
    delay(50); // Delay between frames.
    +
    }
    +
    +
    void updateDisplay() {
    +
    // Draw the new display contents into the off-screen buffer.
    +
    display.clear();
    +
    ...
    +
    }
    +

    The downside of double buffering is that it uses twice as much main memory to manage the contents of the screen.

    +

    +Multiple panels

    Multiple panels can be daisy-chained together using ribbon cables. If there is a single row of panels, then they must be connected to the Arduino board as follows:

    dmd-4x1.png @@ -223,15 +345,18 @@ Multiple panels dmd-4x3.png

    DMD automatically takes care of flipping the data for panels in the alternating rows. No special action is required by the user except to physically connect the panels as shown and to initialize the DMD class appropriately:

    -
     #include <DMD.h>
    -
    - DMD display(4, 2);   // 4 panels wide, 2 panels high
    -
    +
    #include <DMD.h>
    +
    +
    DMD display(4, 2); // 4 panels wide, 2 panels high
    +

    Definition at line 28 of file DMD.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    @@ -248,22 +373,26 @@ Multiple panels - +
    DMD::DMD
    ) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new dot matrix display handler for a display that is widthPanels x heightPanels in size.

    Note: the parameters to this constructor are specified in panels, whereas width() and height() are specified in pixels.

    -
    See also:
    width(), height()
    +
    See Also
    width(), height()

    Definition at line 237 of file DMD.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    @@ -274,17 +403,16 @@ Multiple panels
    -
    -
    +

    Disables Timer1 overflow interrupts.

    -
    See also:
    enableTimer1()
    +
    See Also
    enableTimer1()

    Definition at line 614 of file DMD.cpp.

    - +
    @@ -295,38 +423,44 @@ Multiple panels
    -
    -
    +

    Disables Timer2 overflow interrupts.

    -
    See also:
    enableTimer2()
    +
    See Also
    enableTimer2()

    Definition at line 674 of file DMD.cpp.

    - +
    + + + + + +
    - +
    bool DMD::doubleBuffer ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns true if the display is double-buffered; false if single-buffered. The default is false.

    -
    See also:
    setDoubleBuffer(), swapBuffers(), refresh()
    +
    See Also
    setDoubleBuffer(), swapBuffers(), refresh()

    Definition at line 34 of file DMD.h.

    - +
    @@ -337,31 +471,30 @@ Multiple panels
    -
    -
    +

    Enables Timer1 overflow interrupts for updating this display.

    The application must also provide an interrupt service routine for Timer1 that calls refresh():

    -
     #include <DMD.h>
    -
    - DMD display;
    -
    - ISR(TIMER1_OVF_vect)
    - {
    -     display.refresh();
    - }
    -
    - void setup() {
    -     display.enableTimer1();
    - }
    -

    If timer interrupts are being used to update the display, then it is unnecessary to call loop().

    -
    See also:
    refresh(), disableTimer1(), enableTimer2(), setDoubleBuffer()
    +
    #include <DMD.h>
    +
    +
    DMD display;
    +
    +
    ISR(TIMER1_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.enableTimer1();
    +
    }
    +

    If timer interrupts are being used to update the display, then it is unnecessary to call loop().

    +
    See Also
    refresh(), disableTimer1(), enableTimer2(), setDoubleBuffer()

    Definition at line 563 of file DMD.cpp.

    - +
    @@ -372,33 +505,35 @@ Multiple panels
    -
    -
    +

    Enables Timer2 overflow interrupts for updating this display.

    The application must also provide an interrupt service routine for Timer2 that calls refresh():

    -
     #include <DMD.h>
    -
    - DMD display;
    -
    - ISR(TIMER2_OVF_vect)
    - {
    -     display.refresh();
    - }
    -
    - void setup() {
    -     display.enableTimer2();
    - }
    -

    If timer interrupts are being used to update the display, then it is unnecessary to call loop().

    -
    See also:
    refresh(), disableTimer2(), enableTimer1(), setDoubleBuffer()
    +
    #include <DMD.h>
    +
    +
    DMD display;
    +
    +
    ISR(TIMER2_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.enableTimer2();
    +
    }
    +

    If timer interrupts are being used to update the display, then it is unnecessary to call loop().

    +
    See Also
    refresh(), disableTimer2(), enableTimer1(), setDoubleBuffer()

    Definition at line 646 of file DMD.cpp.

    - +
    + + + + + +
    @@ -421,11 +556,15 @@ Multiple panels - +
    DMD::Color DMD::fromRGB
    ) [static]
    - -
    +
    +static
    +

    Converts an RGB value into a pixel color value.

    Returns White if any of r, g, or b are non-zero; otherwise returns Black.

    @@ -435,7 +574,7 @@ Multiple panels
    - +
    @@ -446,23 +585,22 @@ Multiple panels
    -
    -
    +

    Performs regular display refresh activities from the application's main loop.

    -
     DMD display;
    -
    - void loop() {
    -     display.loop();
    - }
    -

    If you are using a timer interrupt service routine, then call refresh() in response to the interrupt instead of calling loop().

    -
    See also:
    refresh()
    +
    DMD display;
    +
    +
    void loop() {
    +
    display.loop();
    +
    }
    +

    If you are using a timer interrupt service routine, then call refresh() in response to the interrupt instead of calling loop().

    +
    See Also
    refresh()

    Definition at line 420 of file DMD.cpp.

    - +
    @@ -473,19 +611,18 @@ Multiple panels
    -
    -
    +

    Refresh the display.

    This function must be called at least once every 5 milliseconds for smooth non-flickering update of the display. It is usually called by loop(), but can also be called in response to a timer interrupt.

    If this function is called from an interrupt service routine, then it is recommended that double-buffering be enabled with setDoubleBuffer() to prevent "tearing" artifacts that result from simultaneous update of a single shared buffer.

    -
    See also:
    loop(), setDoubleBuffer(), enableTimer1()
    +
    See Also
    loop(), setDoubleBuffer(), enableTimer1()

    Definition at line 478 of file DMD.cpp.

    - +
    @@ -497,20 +634,19 @@ Multiple panels
    -
    -
    +

    Enables or disables double-buffering according to doubleBuffer.

    When double-buffering is enabled, rendering operations are sent to a memory buffer that isn't currently displayed on-screen. Once the application has completed the screen update, it calls swapBuffers() to display the current buffer and switch rendering to the other now invisible buffer.

    Double-buffering is recommended if refresh() is being called from an interrupt service routine, to prevent "tearing" artifacts that result from simultaneous update of a single shared buffer.

    This function will allocate memory for the extra buffer when doubleBuffer is true. If there is insufficient memory for the second screen buffer, then this class will revert to single-buffered mode.

    -
    See also:
    doubleBuffer(), swapBuffers(), refresh()
    +
    See Also
    doubleBuffer(), swapBuffers(), refresh()

    Definition at line 314 of file DMD.cpp.

    - +
    @@ -521,19 +657,18 @@ Multiple panels
    -
    -
    +

    Swaps the buffers that are used for rendering to the display.

    When doubleBuffer() is false, this function does nothing. Otherwise the front and back rendering buffers are swapped. See the description of setDoubleBuffer() for more information.

    The new rendering back buffer will have undefined contents and will probably need to be re-inialized with clear() or fill() before drawing to it. The swapBuffersAndCopy() function can be used instead to preserve the screen contents from one frame to the next.

    -
    See also:
    swapBuffersAndCopy(), setDoubleBuffer()
    +
    See Also
    swapBuffersAndCopy(), setDoubleBuffer()

    Definition at line 363 of file DMD.cpp.

    - +
    @@ -544,13 +679,12 @@ Multiple panels
    -
    -
    +

    Swaps the buffers that are used for rendering to the display and copies the former back buffer contents to the new back buffer.

    Normally when swapBuffers() is called, the new rendering back buffer will have undefined contents from two frames prior and must be cleared with clear() or fill() before writing new contents to it. This function instead copies the previous frame into the new rendering buffer so that it can be updated in-place.

    This function is useful if the screen does not change much from one frame to the next. If the screen changes a lot between frames, then it is usually better to explicitly clear() or fill() the new back buffer.

    -
    See also:
    swapBuffers(), setDoubleBuffer()
    +
    See Also
    swapBuffers(), setDoubleBuffer()

    Definition at line 396 of file DMD.cpp.

    @@ -560,23 +694,12 @@ Multiple panels
  • DMD.h
  • DMD.cpp
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/classDMD.png b/classDMD.png index 98a95a03cf01b4185ba8314d9762af210254c0b8..910fc7e45d6a62f7eee7aef9868488f4c0f1bd0c 100644 GIT binary patch delta 245 zcmVj#Y9IC1lno%dOA)#8B%T}%&mx&Qa49QmdUP@2SQAf*jH2NAXE+%pq zyY@MalXH|a=eLTTJN8OdbXUdKg!I^1Hh0Cz=hk`Hg2!tHr|3$@f$zs)iMAs zvJ8N0ECb*g%K+#R5pjV4IC!LyS`l~4uWfH^lqtuArOPljQsUm|gN8<`ls?{O)bLx3 v^gfl7UhVIr7$5Hg;FM(mT;nT4M8v}jl+X(}a&xA;00000NkvXXu0mjf4;yh~ delta 219 zcmV<103`p(0J1Yqt=c>hP$~Vd=!fA zciPlQ8?~5D002mW#7z+wRe%79$mN;g<1_?80z@dg_tc$r#Bq%CE$SRcKlu1JMNvLc zT&%;_yw8eg*6KWpEgDG7`9;b9KE24@Cy$AoRU(U=RicZZ)KqGTC6-uXH~}>h#N1N~ zD@97thN7)4{Id4}inhM6fooBBY6{C_KVK8k{S{&JiSwdX<$kz0-H-o$cSjOxd;pZt V3pghTPM!b&002ovPDHLkV1kX2W%B?4 diff --git a/classDS1307RTC-members.html b/classDS1307RTC-members.html index 2ac50773..047f055e 100644 --- a/classDS1307RTC-members.html +++ b/classDS1307RTC-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    DS1307RTC Member List
    -
    -
    -This is the complete list of members for DS1307RTC, including all inherited members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    adjustDays(RTCDate *date, uint8_t flags)RTC [static]
    adjustMonths(RTCDate *date, uint8_t flags)RTC [static]
    adjustYears(RTCDate *date, uint8_t flags)RTC [static]
    ALARM_COUNTRTC [static]
    byteCount() const DS1307RTC [virtual]
    dayOfWeek(const RTCDate *date)RTC [static]
    DayOfWeek enum nameRTC
    DECREMENTRTC [static]
    DS1307RTC(I2CMaster &bus, uint8_t oneHzPin=255)DS1307RTC
    Friday enum value (defined in RTC)RTC
    hasUpdates()DS1307RTC [virtual]
    INCREMENTRTC [static]
    isRealTime() const DS1307RTC [inline]
    Monday enum value (defined in RTC)RTC
    NO_TEMPERATURERTC [static]
    readAlarm(uint8_t alarmNum, RTCAlarm *value)DS1307RTC [virtual]
    readByte(uint8_t offset)DS1307RTC [virtual]
    readDate(RTCDate *value)DS1307RTC [virtual]
    readTemperature()RTC [virtual]
    readTime(RTCTime *value)DS1307RTC [virtual]
    RTC()RTC
    Saturday enum value (defined in RTC)RTC
    Sunday enum value (defined in RTC)RTC
    Thursday enum value (defined in RTC)RTC
    Tuesday enum value (defined in RTC)RTC
    Wednesday enum value (defined in RTC)RTC
    WRAPRTC [static]
    writeAlarm(uint8_t alarmNum, const RTCAlarm *value)DS1307RTC [virtual]
    writeByte(uint8_t offset, uint8_t value)DS1307RTC [virtual]
    writeDate(const RTCDate *value)DS1307RTC [virtual]
    writeTime(const RTCTime *value)DS1307RTC [virtual]
    ~RTC() (defined in RTC)RTC
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -112,8 +80,53 @@ This is the complete list of members for +
    +
    +
    +
    DS1307RTC Member List
    +
    +
    + +

    This is the complete list of members for DS1307RTC, including all inherited members.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    adjustDays(RTCDate *date, uint8_t flags)RTCstatic
    adjustMonths(RTCDate *date, uint8_t flags)RTCstatic
    adjustYears(RTCDate *date, uint8_t flags)RTCstatic
    ALARM_COUNTRTCstatic
    byteCount() const DS1307RTCvirtual
    dayOfWeek(const RTCDate *date)RTCstatic
    DayOfWeek enum nameRTC
    DECREMENTRTCstatic
    DS1307RTC(I2CMaster &bus, uint8_t oneHzPin=255)DS1307RTC
    Friday enum value (defined in RTC)RTC
    hasUpdates()DS1307RTCvirtual
    INCREMENTRTCstatic
    isRealTime() const DS1307RTCinline
    Monday enum value (defined in RTC)RTC
    NO_TEMPERATURERTCstatic
    readAlarm(uint8_t alarmNum, RTCAlarm *value)DS1307RTCvirtual
    readByte(uint8_t offset)DS1307RTCvirtual
    readDate(RTCDate *value)DS1307RTCvirtual
    readTemperature()RTCvirtual
    readTime(RTCTime *value)DS1307RTCvirtual
    RTC()RTC
    Saturday enum value (defined in RTC)RTC
    Sunday enum value (defined in RTC)RTC
    Thursday enum value (defined in RTC)RTC
    Tuesday enum value (defined in RTC)RTC
    Wednesday enum value (defined in RTC)RTC
    WRAPRTCstatic
    writeAlarm(uint8_t alarmNum, const RTCAlarm *value)DS1307RTCvirtual
    writeByte(uint8_t offset, uint8_t value)DS1307RTCvirtual
    writeDate(const RTCDate *value)DS1307RTCvirtual
    writeTime(const RTCTime *value)DS1307RTCvirtual
    ~RTC() (defined in RTC)RTC
    + + diff --git a/classDS1307RTC.html b/classDS1307RTC.html index 76aa4e59..38627ee4 100644 --- a/classDS1307RTC.html +++ b/classDS1307RTC.html @@ -2,29 +2,37 @@ + ArduinoLibs: DS1307RTC Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    DS1307RTC Class Reference
    -
    +
    - +

    Communicates with a DS1307 realtime clock chip via I2C. More...

    @@ -80,48 +103,92 @@ Inheritance diagram for DS1307RTC:
    RTC - -

    List of all members.

    - - - - + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     DS1307RTC (I2CMaster &bus, uint8_t oneHzPin=255)
     Attaches to a realtime clock slave device on bus.
    +
     DS1307RTC (I2CMaster &bus, uint8_t oneHzPin=255)
     Attaches to a realtime clock slave device on bus.
    bool isRealTime () const
     Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
    bool hasUpdates ()
     Returns true if the realtime clock has updated since the last call to this function.
    void readTime (RTCTime *value)
     Reads the current time from the realtime clock into value.
    void readDate (RTCDate *value)
     Reads the current date from the realtime clock into value.
    void writeTime (const RTCTime *value)
     Updates the time in the realtime clock to match value.
    void writeDate (const RTCDate *value)
     Updates the date in the realtime clock to match value.
    void readAlarm (uint8_t alarmNum, RTCAlarm *value)
     Reads the details of the alarm with index alarmNum into value.
    void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
     Updates the details of the alarm with index alarmNum from value.
    int byteCount () const
     Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.
    uint8_t readByte (uint8_t offset)
     Reads the byte at offset within the realtime clock's non-volatile memory.
    void writeByte (uint8_t offset, uint8_t value)
     Writes value to offset within the realtime clock's non-volatile memory.
     Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
    bool hasUpdates ()
     Returns true if the realtime clock has updated since the last call to this function.
    void readTime (RTCTime *value)
     Reads the current time from the realtime clock into value.
    void readDate (RTCDate *value)
     Reads the current date from the realtime clock into value.
    void writeTime (const RTCTime *value)
     Updates the time in the realtime clock to match value.
    void writeDate (const RTCDate *value)
     Updates the date in the realtime clock to match value.
    void readAlarm (uint8_t alarmNum, RTCAlarm *value)
     Reads the details of the alarm with index alarmNum into value.
    void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
     Updates the details of the alarm with index alarmNum from value.
    int byteCount () const
     Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.
    uint8_t readByte (uint8_t offset)
     Reads the byte at offset within the realtime clock's non-volatile memory.
    void writeByte (uint8_t offset, uint8_t value)
     Writes value to offset within the realtime clock's non-volatile memory.
    - Public Member Functions inherited from RTC
     RTC ()
     Constructs a new realtime clock handler.
    virtual int readTemperature ()
     Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.
    + + + + + + + + + + + + + + + + + + + + + + + +

    +Additional Inherited Members

    - Public Types inherited from RTC
    enum  DayOfWeek {
    +  Monday = 1, +Tuesday, +Wednesday, +Thursday, +
    +  Friday, +Saturday, +Sunday +
    + }
     Day of the week corresponding to a date. More...
    - Static Public Member Functions inherited from RTC
    static void adjustDays (RTCDate *date, uint8_t flags)
     Adjusts date up or down one day according to flags.
    static void adjustMonths (RTCDate *date, uint8_t flags)
     Adjusts date up or down one month according to flags.
    static void adjustYears (RTCDate *date, uint8_t flags)
     Adjusts date up or down one year according to flags.
    static DayOfWeek dayOfWeek (const RTCDate *date)
     Returns the day of the week corresponding to date.
    - Static Public Attributes inherited from RTC
    +static const uint8_t ALARM_COUNT = 4
     Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
    +static const int NO_TEMPERATURE = 32767
     Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
    +static const uint8_t INCREMENT = 0x0000
     Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    +static const uint8_t DECREMENT = 0x0001
     Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    +static const uint8_t WRAP = 0x0002
     Wrap around to the beginning of the current month/year rather than advance to the next one.
    -

    Detailed Description

    +

    Detailed Description

    Communicates with a DS1307 realtime clock chip via I2C.

    This class simplifies the process of reading and writing the time and date information in a DS1307 realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.

    If there is no DS1307 chip on the I2C bus, this class will fall back to the RTC class to simulate the current time and date based on the value of millis().

    The DS1307 uses a 2-digit year so this class is limited to dates between 2000 and 2099 inclusive.

    Note: if this class has not been used with the DS1307 chip before, then the contents of NVRAM will be cleared. Any previous contents will be lost.

    -
    See also:
    RTC, DS3232RTC
    +
    See Also
    RTC, DS3232RTC

    Definition at line 30 of file DS1307RTC.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    @@ -143,34 +210,40 @@ bool 
    + -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int DS1307RTC::byteCount ( ) const [virtual] const
    - -
    +
    +virtual
    +

    Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.

    -
    See also:
    readByte(), writeByte()
    +
    See Also
    readByte(), writeByte()

    Reimplemented from RTC.

    @@ -178,19 +251,26 @@ bool 
    +
    + + + + + +
    - +
    bool DS1307RTC::hasUpdates ( ) [virtual]
    - -
    +
    +virtual
    +

    Returns true if the realtime clock has updated since the last call to this function.

    The default implementation returns true, indicating that an update is always available to be read.

    @@ -201,9 +281,12 @@ bool 
    +
    + + +
    @@ -220,16 +303,20 @@ bool  + + +
    void DS1307RTC::readAlarm + +virtual
    +

    Reads the details of the alarm with index alarmNum into value.

    The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

    Alarm details are stored at the end of the realtime clock's non-volatile memory.

    -
    See also:
    writeAlarm(), alarmCount()
    +
    See Also
    writeAlarm(), alarmCount()

    Reimplemented from RTC.

    @@ -237,24 +324,31 @@ bool 
    +
    + + + + + +
    - +
    uint8_t DS1307RTC::readByte ( uint8_t  offset) [virtual]
    - -
    +
    +virtual
    +

    Reads the byte at offset within the realtime clock's non-volatile memory.

    The offset parameter must be between 0 and byteCount() - 1.

    -
    See also:
    writeByte(), byteCount()
    +
    See Also
    writeByte(), byteCount()

    Reimplemented from RTC.

    @@ -262,24 +356,31 @@ bool 
    +
    + + + + + +
    - +
    void DS1307RTC::readDate ( RTCDate value) [virtual]
    - -
    +
    +virtual
    +

    Reads the current date from the realtime clock into value.

    The time should be read first with readTime() as the default implementation only advances the date when the time is read and it crosses midnight.

    -
    See also:
    writeDate(), readTime()
    +
    See Also
    writeDate(), readTime()

    Reimplemented from RTC.

    @@ -287,23 +388,30 @@ bool 
    +
    + + + + + +
    - +
    void DS1307RTC::readTime ( RTCTime value) [virtual]
    - -
    +
    +virtual
    +

    Reads the current time from the realtime clock into value.

    -
    See also:
    writeTime(), readDate()
    +
    See Also
    writeTime(), readDate()

    Reimplemented from RTC.

    @@ -311,9 +419,12 @@ bool 
    +
    + + +
    @@ -330,16 +441,20 @@ bool  + + +
    void DS1307RTC::writeAlarm + +virtual
    +

    Updates the details of the alarm with index alarmNum from value.

    The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

    Alarm details are stored at the end of the realtime clock's non-volatile memory.

    -
    See also:
    readAlarm(), alarmCount()
    +
    See Also
    readAlarm(), alarmCount()

    Reimplemented from RTC.

    @@ -347,9 +462,12 @@ bool 
    +
    + + +
    @@ -366,15 +484,19 @@ bool  + + +
    void DS1307RTC::writeByte + +virtual
    +

    Writes value to offset within the realtime clock's non-volatile memory.

    The offset parameter must be between 0 and byteCount() - 1.

    -
    See also:
    readByte(), byteCount()
    +
    See Also
    readByte(), byteCount()

    Reimplemented from RTC.

    @@ -382,23 +504,30 @@ bool 
    +
    + + + + + +
    - +
    void DS1307RTC::writeDate ( const RTCDate value) [virtual]
    - -
    +
    +virtual
    +

    Updates the date in the realtime clock to match value.

    -
    See also:
    readDate(), writeTime()
    +
    See Also
    readDate(), writeTime()

    Reimplemented from RTC.

    @@ -406,23 +535,30 @@ bool 
    +
    + + + + + +
    - +
    void DS1307RTC::writeTime ( const RTCTime value) [virtual]
    - -
    +
    +virtual
    +

    Updates the time in the realtime clock to match value.

    -
    See also:
    readTime(), writeDate()
    +
    See Also
    readTime(), writeDate()

    Reimplemented from RTC.

    @@ -434,23 +570,12 @@ bool 
    DS1307RTC.h
  • DS1307RTC.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classDS1307RTC.png b/classDS1307RTC.png index 20719b8f269e41eeed01de1c1026eba45bf8a08e..dcd4436a2c2534d37710913cad42b4914fe29e3d 100644 GIT binary patch delta 288 zcmV+*0pI?{0`dZoTYmuoNklLrL%*?oN`cRUtc+WUV?~jbFZjm|08-KNq@n;=y zA0_Ec(kMyme5}#kJraPI*Z@KaH*QTH>X#`lO86U?~qw=i`f4VZO@7nv5u{JfRrZQ?f)KS;;;lbEucdw4d ze%HNgWV|J}H$HxA#n_yeIo6`~bLPh5#Iy0Tf=}ysT0HvKnQ^eLGafU0cGfT5$AR(k mJ_3Z0Mu2rb)){DK7ReXB+7dore{%Q6TYmu6Nkl=``|84xfG(KXfpf2O?nCo zsjul^M>=lYkoXnR%*?zp^MUuobAe5cI9c8%vE+@pM!xvbJo3+)a3A%hkoawp{_naP zd3okGF=sYO7jtHleDN>NTB1aW5+zEMxKT8ABqQ%dB3XPKQ*5;SH}5_xpM_N!Z^S5~ z5t8@H8=?mVHY>5rhM`)-x1Oz$m|*?BZFF7{i`iXcBo*h(#d=~Zb~AXH$L8VDUT5Oq tIS}iWU7hvPeH@70`=~F4#NQCvaR + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    DS3232RTC Member List
    -
    -
    -This is the complete list of members for DS3232RTC, including all inherited members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    adjustDays(RTCDate *date, uint8_t flags)RTC [static]
    adjustMonths(RTCDate *date, uint8_t flags)RTC [static]
    adjustYears(RTCDate *date, uint8_t flags)RTC [static]
    ALARM_COUNTRTC [static]
    byteCount() const DS3232RTC [virtual]
    dayOfWeek(const RTCDate *date)RTC [static]
    DayOfWeek enum nameRTC
    DECREMENTRTC [static]
    disable32kHzOutput()DS3232RTC
    disableAlarmInterrupts()DS3232RTC
    DS3232RTC(I2CMaster &bus, uint8_t oneHzPin=255)DS3232RTC
    enable32kHzOutput()DS3232RTC
    enableAlarmInterrupts()DS3232RTC
    firedAlarm()DS3232RTC
    Friday enum value (defined in RTC)RTC
    hasUpdates()DS3232RTC [virtual]
    INCREMENTRTC [static]
    isRealTime() const DS3232RTC [inline]
    Monday enum value (defined in RTC)RTC
    NO_TEMPERATURERTC [static]
    readAlarm(uint8_t alarmNum, RTCAlarm *value)DS3232RTC [virtual]
    readByte(uint8_t offset)DS3232RTC [virtual]
    readDate(RTCDate *value)DS3232RTC [virtual]
    readTemperature()DS3232RTC [virtual]
    readTime(RTCTime *value)DS3232RTC [virtual]
    RTC()RTC
    Saturday enum value (defined in RTC)RTC
    Sunday enum value (defined in RTC)RTC
    Thursday enum value (defined in RTC)RTC
    Tuesday enum value (defined in RTC)RTC
    Wednesday enum value (defined in RTC)RTC
    WRAPRTC [static]
    writeAlarm(uint8_t alarmNum, const RTCAlarm *value)DS3232RTC [virtual]
    writeByte(uint8_t offset, uint8_t value)DS3232RTC [virtual]
    writeDate(const RTCDate *value)DS3232RTC [virtual]
    writeTime(const RTCTime *value)DS3232RTC [virtual]
    ~RTC() (defined in RTC)RTC
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -117,8 +80,58 @@ This is the complete list of members for +
    +
    +
    +
    DS3232RTC Member List
    +
    +
    + +

    This is the complete list of members for DS3232RTC, including all inherited members.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    adjustDays(RTCDate *date, uint8_t flags)RTCstatic
    adjustMonths(RTCDate *date, uint8_t flags)RTCstatic
    adjustYears(RTCDate *date, uint8_t flags)RTCstatic
    ALARM_COUNTRTCstatic
    byteCount() const DS3232RTCvirtual
    dayOfWeek(const RTCDate *date)RTCstatic
    DayOfWeek enum nameRTC
    DECREMENTRTCstatic
    disable32kHzOutput()DS3232RTC
    disableAlarmInterrupts()DS3232RTC
    DS3232RTC(I2CMaster &bus, uint8_t oneHzPin=255)DS3232RTC
    enable32kHzOutput()DS3232RTC
    enableAlarmInterrupts()DS3232RTC
    firedAlarm()DS3232RTC
    Friday enum value (defined in RTC)RTC
    hasUpdates()DS3232RTCvirtual
    INCREMENTRTCstatic
    isRealTime() const DS3232RTCinline
    Monday enum value (defined in RTC)RTC
    NO_TEMPERATURERTCstatic
    readAlarm(uint8_t alarmNum, RTCAlarm *value)DS3232RTCvirtual
    readByte(uint8_t offset)DS3232RTCvirtual
    readDate(RTCDate *value)DS3232RTCvirtual
    readTemperature()DS3232RTCvirtual
    readTime(RTCTime *value)DS3232RTCvirtual
    RTC()RTC
    Saturday enum value (defined in RTC)RTC
    Sunday enum value (defined in RTC)RTC
    Thursday enum value (defined in RTC)RTC
    Tuesday enum value (defined in RTC)RTC
    Wednesday enum value (defined in RTC)RTC
    WRAPRTCstatic
    writeAlarm(uint8_t alarmNum, const RTCAlarm *value)DS3232RTCvirtual
    writeByte(uint8_t offset, uint8_t value)DS3232RTCvirtual
    writeDate(const RTCDate *value)DS3232RTCvirtual
    writeTime(const RTCTime *value)DS3232RTCvirtual
    ~RTC() (defined in RTC)RTC
    + + diff --git a/classDS3232RTC.html b/classDS3232RTC.html index 41cb8451..7068c425 100644 --- a/classDS3232RTC.html +++ b/classDS3232RTC.html @@ -2,29 +2,37 @@ + ArduinoLibs: DS3232RTC Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    DS3232RTC Class Reference
    -
    +
    - +

    Communicates with a DS3232 realtime clock chip via I2C. More...

    @@ -80,61 +103,103 @@ Inheritance diagram for DS3232RTC:
    RTC - -

    List of all members.

    - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     DS3232RTC (I2CMaster &bus, uint8_t oneHzPin=255)
     Attaches to a realtime clock slave device on bus.
    +
     DS3232RTC (I2CMaster &bus, uint8_t oneHzPin=255)
     Attaches to a realtime clock slave device on bus.
    bool isRealTime () const
     Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
    bool hasUpdates ()
     Returns true if the realtime clock has updated since the last call to this function.
    void readTime (RTCTime *value)
     Reads the current time from the realtime clock into value.
    void readDate (RTCDate *value)
     Reads the current date from the realtime clock into value.
    void writeTime (const RTCTime *value)
     Updates the time in the realtime clock to match value.
    void writeDate (const RTCDate *value)
     Updates the date in the realtime clock to match value.
    void readAlarm (uint8_t alarmNum, RTCAlarm *value)
     Reads the details of the alarm with index alarmNum into value.
    void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
     Updates the details of the alarm with index alarmNum from value.
    int byteCount () const
     Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.
    uint8_t readByte (uint8_t offset)
     Reads the byte at offset within the realtime clock's non-volatile memory.
    void writeByte (uint8_t offset, uint8_t value)
     Writes value to offset within the realtime clock's non-volatile memory.
    int readTemperature ()
     Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.
    void enableAlarmInterrupts ()
     Enables the generation of interrupts for alarms 0 and 1.
    void disableAlarmInterrupts ()
     Disables the generation of interrupts for alarms 0 and 1.
    int firedAlarm ()
     Determines which of alarms 0 or 1 have fired since the last call.
    void enable32kHzOutput ()
     Enables the 32 kHz output on the DS3232 chip.
    void disable32kHzOutput ()
     Disables the 32 kHz output on the DS3232 chip.
     Returns true if the realtime clock is on the I2C bus; false if the time and date are simulated.
    bool hasUpdates ()
     Returns true if the realtime clock has updated since the last call to this function.
    void readTime (RTCTime *value)
     Reads the current time from the realtime clock into value.
    void readDate (RTCDate *value)
     Reads the current date from the realtime clock into value.
    void writeTime (const RTCTime *value)
     Updates the time in the realtime clock to match value.
    void writeDate (const RTCDate *value)
     Updates the date in the realtime clock to match value.
    void readAlarm (uint8_t alarmNum, RTCAlarm *value)
     Reads the details of the alarm with index alarmNum into value.
    void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
     Updates the details of the alarm with index alarmNum from value.
    int byteCount () const
     Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.
    uint8_t readByte (uint8_t offset)
     Reads the byte at offset within the realtime clock's non-volatile memory.
    void writeByte (uint8_t offset, uint8_t value)
     Writes value to offset within the realtime clock's non-volatile memory.
    int readTemperature ()
     Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.
    void enableAlarmInterrupts ()
     Enables the generation of interrupts for alarms 0 and 1.
    void disableAlarmInterrupts ()
     Disables the generation of interrupts for alarms 0 and 1.
    int firedAlarm ()
     Determines which of alarms 0 or 1 have fired since the last call.
    void enable32kHzOutput ()
     Enables the 32 kHz output on the DS3232 chip.
    void disable32kHzOutput ()
     Disables the 32 kHz output on the DS3232 chip.
    - Public Member Functions inherited from RTC
     RTC ()
     Constructs a new realtime clock handler.
    + + + + + + + + + + + + + + + + + + + + + + + +

    +Additional Inherited Members

    - Public Types inherited from RTC
    enum  DayOfWeek {
    +  Monday = 1, +Tuesday, +Wednesday, +Thursday, +
    +  Friday, +Saturday, +Sunday +
    + }
     Day of the week corresponding to a date. More...
    - Static Public Member Functions inherited from RTC
    static void adjustDays (RTCDate *date, uint8_t flags)
     Adjusts date up or down one day according to flags.
    static void adjustMonths (RTCDate *date, uint8_t flags)
     Adjusts date up or down one month according to flags.
    static void adjustYears (RTCDate *date, uint8_t flags)
     Adjusts date up or down one year according to flags.
    static DayOfWeek dayOfWeek (const RTCDate *date)
     Returns the day of the week corresponding to date.
    - Static Public Attributes inherited from RTC
    +static const uint8_t ALARM_COUNT = 4
     Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
    +static const int NO_TEMPERATURE = 32767
     Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
    +static const uint8_t INCREMENT = 0x0000
     Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    +static const uint8_t DECREMENT = 0x0001
     Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    +static const uint8_t WRAP = 0x0002
     Wrap around to the beginning of the current month/year rather than advance to the next one.
    -

    Detailed Description

    +

    Detailed Description

    Communicates with a DS3232 realtime clock chip via I2C.

    This class simplifies the process of reading and writing the time and date information in a DS3232 realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.

    If there is no DS3232 chip on the I2C bus, this class will fall back to the RTC class to simulate the current time and date based on the value of millis().

    Alarms 0 and 1 can be set to generate an interrupt when they fire using enableAlarmInterrupts(). The firedAlarm() function can be used to determine which alarm has fired. Alarms 2 and 3 cannot be monitored with interrupts.

    The DS3232 uses a 2-digit year so this class is limited to dates between 2000 and 2099 inclusive.

    Note: if this class has not been used with the DS3232 chip before, then the contents of NVRAM will be cleared. Any previous contents will be lost.

    -
    See also:
    RTC, DS1307RTC
    +
    See Also
    RTC, DS1307RTC

    Definition at line 30 of file DS3232RTC.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    @@ -156,35 +221,41 @@ bool 
    + -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int DS3232RTC::byteCount ( ) const [virtual] const
    - -
    +
    +virtual
    +

    Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.

    -
    See also:
    readByte(), writeByte()
    +
    See Also
    readByte(), writeByte()

    Reimplemented from RTC.

    @@ -192,7 +263,7 @@ bool 
    +
    @@ -203,17 +274,16 @@ bool 
    + - +
    @@ -224,17 +294,16 @@ bool 
    + - +
    @@ -245,17 +314,16 @@ bool 
    + - +
    @@ -266,19 +334,18 @@ bool 
    +

    Enables the generation of interrupts for alarms 0 and 1.

    When the interrupt occurs, use firedAlarm() to determine which alarm has fired. The application is responsible for implementing the interrupt service routine to watch for the interrupt.

    Note: this function does nothing if the 1 Hz pin was enabled in the constructor, but firedAlarm() can still be used to determine which alarm has fired when hasUpdates() reports that there is an update available.

    -
    See also:
    disableAlarmInterrupts(), firedAlarm()
    +
    See Also
    disableAlarmInterrupts(), firedAlarm()

    Definition at line 380 of file DS3232RTC.cpp.

    - +
    @@ -289,32 +356,38 @@ bool 
    + - +
    + + + + + +
    - +
    bool DS3232RTC::hasUpdates ( ) [virtual]
    - -
    +
    +virtual
    +

    Returns true if the realtime clock has updated since the last call to this function.

    The default implementation returns true, indicating that an update is always available to be read.

    @@ -325,9 +398,12 @@ bool 
    +
    + + +
    @@ -344,16 +420,20 @@ bool  + + +
    void DS3232RTC::readAlarm + +virtual
    +

    Reads the details of the alarm with index alarmNum into value.

    The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

    Alarm details are stored at the end of the realtime clock's non-volatile memory.

    -
    See also:
    writeAlarm(), alarmCount()
    +
    See Also
    writeAlarm(), alarmCount()

    Reimplemented from RTC.

    @@ -361,24 +441,31 @@ bool 
    +
    + + + + + +
    - +
    uint8_t DS3232RTC::readByte ( uint8_t  offset) [virtual]
    - -
    +
    +virtual
    +

    Reads the byte at offset within the realtime clock's non-volatile memory.

    The offset parameter must be between 0 and byteCount() - 1.

    -
    See also:
    writeByte(), byteCount()
    +
    See Also
    writeByte(), byteCount()

    Reimplemented from RTC.

    @@ -386,24 +473,31 @@ bool 
    +
    + + + + + +
    - +
    void DS3232RTC::readDate ( RTCDate value) [virtual]
    - -
    +
    +virtual
    +

    Reads the current date from the realtime clock into value.

    The time should be read first with readTime() as the default implementation only advances the date when the time is read and it crosses midnight.

    -
    See also:
    writeDate(), readTime()
    +
    See Also
    writeDate(), readTime()

    Reimplemented from RTC.

    @@ -411,19 +505,26 @@ bool 
    +
    + + + + + +
    - +
    int DS3232RTC::readTemperature ( ) [virtual]
    - -
    +
    +virtual
    +

    Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.

    Returns the value NO_TEMPERATURE if the realtime clock chip cannot determine the temperature.

    @@ -434,23 +535,30 @@ bool 
    +
    + + + + + +
    - +
    void DS3232RTC::readTime ( RTCTime value) [virtual]
    - -
    +
    +virtual
    +

    Reads the current time from the realtime clock into value.

    -
    See also:
    writeTime(), readDate()
    +
    See Also
    writeTime(), readDate()

    Reimplemented from RTC.

    @@ -458,9 +566,12 @@ bool 
    +
    + + +
    @@ -477,16 +588,20 @@ bool  + + +
    void DS3232RTC::writeAlarm + +virtual
    +

    Updates the details of the alarm with index alarmNum from value.

    The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

    Alarm details are stored at the end of the realtime clock's non-volatile memory.

    -
    See also:
    readAlarm(), alarmCount()
    +
    See Also
    readAlarm(), alarmCount()

    Reimplemented from RTC.

    @@ -494,9 +609,12 @@ bool 
    +
    + + + -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    @@ -513,15 +631,19 @@ bool  + + +
    void DS3232RTC::writeByte + +virtual
    +

    Writes value to offset within the realtime clock's non-volatile memory.

    The offset parameter must be between 0 and byteCount() - 1.

    -
    See also:
    readByte(), byteCount()
    +
    See Also
    readByte(), byteCount()

    Reimplemented from RTC.

    @@ -529,23 +651,30 @@ bool 
    +
    + + + + + +
    - +
    void DS3232RTC::writeDate ( const RTCDate value) [virtual]
    - -
    +
    +virtual
    +

    Updates the date in the realtime clock to match value.

    -
    See also:
    readDate(), writeTime()
    +
    See Also
    readDate(), writeTime()

    Reimplemented from RTC.

    @@ -553,23 +682,30 @@ bool 
    +
    + + + + + +
    - +
    void DS3232RTC::writeTime ( const RTCTime value) [virtual]
    - -
    +
    +virtual
    +

    Updates the time in the realtime clock to match value.

    -
    See also:
    readTime(), writeDate()
    +
    See Also
    readTime(), writeDate()

    Reimplemented from RTC.

    @@ -581,23 +717,12 @@ bool 
    DS3232RTC.h
  • DS3232RTC.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classDS3232RTC.png b/classDS3232RTC.png index b667620664d46b4f3cf5fb65d12a9906af55b8ed..0dc8cb0d27b9455be93031bde754574d2ccc3bc3 100644 GIT binary patch delta 290 zcmV+-0p0$_0`vlqTYmuqNklN|d5_nx-1*Vk68! zVm|=x?xEn46i6B+X`PADp4T3p$#*76V`j#FX;VqM;+}Exdw*ms=N9>o@y1_0$M{|c z%%ddTB#n}^&c_pPwCSdL`RhoM>8^kgj6<$KrRWb6*^ z)%e&!nf>ljb9d9&I=lKtQ4jq+W4F&*Uhn#BX1wT3b)4HcH4b_`GY)z^n8#+~nn8Tg oT+Aat2x$aZ=Nn^T^L&aWS&j0`b07*qoM6N<$f~&rZHUIzs delta 243 zcmV%Q6TYmu6Nkl}opzs$ zl6fr$I?D0D2E|)M5fQOT#6I{;%tK5u;$nH5#I|q9HR8pu?jyd}fb+;V1;x8X_`mDb z(94zEL{&5i7gf + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    EEPROM24 Member List
    -
    -
    -This is the complete list of members for EEPROM24, including all inherited members. - - - - - - - - -
    available()EEPROM24
    EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank=0)EEPROM24
    pageSize() const EEPROM24 [inline]
    read(unsigned long address)EEPROM24
    read(unsigned long address, void *data, size_t length)EEPROM24
    size() const EEPROM24 [inline]
    write(unsigned long address, uint8_t value)EEPROM24
    write(unsigned long address, const void *data, size_t length)EEPROM24
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -88,8 +80,29 @@ This is the complete list of members for
    - + +
    +
    +
    EEPROM24 Member List
    +
    +
    + +

    This is the complete list of members for EEPROM24, including all inherited members.

    + + + + + + + + + +
    available()EEPROM24
    EEPROM24(I2CMaster &bus, unsigned long type, uint8_t bank=0)EEPROM24
    pageSize() const EEPROM24inline
    read(unsigned long address)EEPROM24
    read(unsigned long address, void *data, size_t length)EEPROM24
    size() const EEPROM24inline
    write(unsigned long address, uint8_t value)EEPROM24
    write(unsigned long address, const void *data, size_t length)EEPROM24
    + + diff --git a/classEEPROM24.html b/classEEPROM24.html index c7eac890..f9d908df 100644 --- a/classEEPROM24.html +++ b/classEEPROM24.html @@ -2,29 +2,37 @@ + ArduinoLibs: EEPROM24 Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    EEPROM24 Class Reference
    -
    +
    - +

    Reading and writing EEPROM's from the 24LCXX family. More...

    #include <EEPROM24.h>

    - -

    List of all members.

    - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     EEPROM24 (I2CMaster &bus, unsigned long type, uint8_t bank=0)
     Constructs a new EEPROM access object on bus for an EEPROM of the specified type.
    unsigned long size () const
     Returns the size of the EEPROM in bytes.
    unsigned long pageSize () const
     Returns the size of a single EEPROM page in bytes.
    bool available ()
     Returns true if the EEPROM is available on the I2C bus; false otherwise.
    uint8_t read (unsigned long address)
     Reads a single byte from the EEPROM at address.
    size_t read (unsigned long address, void *data, size_t length)
     Reads a block of length bytes from the EEPROM at address into the specified data buffer.
    bool write (unsigned long address, uint8_t value)
     Writes a byte value to address in the EEPROM.
    size_t write (unsigned long address, const void *data, size_t length)
     Writes length bytes from a data buffer to address in the EEPROM.
     EEPROM24 (I2CMaster &bus, unsigned long type, uint8_t bank=0)
     Constructs a new EEPROM access object on bus for an EEPROM of the specified type.
    unsigned long size () const
     Returns the size of the EEPROM in bytes.
    unsigned long pageSize () const
     Returns the size of a single EEPROM page in bytes.
    bool available ()
     Returns true if the EEPROM is available on the I2C bus; false otherwise.
    uint8_t read (unsigned long address)
     Reads a single byte from the EEPROM at address.
    size_t read (unsigned long address, void *data, size_t length)
     Reads a block of length bytes from the EEPROM at address into the specified data buffer.
    bool write (unsigned long address, uint8_t value)
     Writes a byte value to address in the EEPROM.
    size_t write (unsigned long address, const void *data, size_t length)
     Writes length bytes from a data buffer to address in the EEPROM.
    -

    Detailed Description

    +

    Detailed Description

    Reading and writing EEPROM's from the 24LCXX family.

    The 24LCXX family of EEPROM's provide a variety of memory sizes from 16 bytes up to 128 kBytes that can be accessed via the I2C protocol. These chips can be used to augment the 1 kByte or so of builtin EEPROM memory that is typical on Arduino boards. The EEPROM should be wired to an Arduino Uno as follows:

    eeprom_circuit.png

    Access to a 24LCXX chip is initialized as follows:

    -
     SoftI2C i2c(A4, A5);
    - EEPROM24 eeprom(i2c, EEPROM_24LC256);
    -

    Once initialized, read() and write() can be used to manipulate the contents of the EEPROM's memory.

    +
    SoftI2C i2c(A4, A5);
    +
    EEPROM24 eeprom(i2c, EEPROM_24LC256);
    +

    Once initialized, read() and write() can be used to manipulate the contents of the EEPROM's memory.

    The following EEPROM types are supported by this class:

    @@ -141,14 +162,14 @@ Public Member Functions
    24lc1026EEPROM_24LC1026 128 kBytes

    There can be multiple 24LCXX chips on the same I2C bus, as long as their A0, A1, and A2 address pins are set to different values. For example, two 24LC256 chips can be used to provide the same memory capacity as a single 24LC512 chip. The optional bank parameter to the constructor is used to assign different bank addresses to each chip:

    -
     SoftI2C i2c(A4, A5);
    - EEPROM24 eeprom0(i2c, EEPROM_24LC256, 0);
    - EEPROM24 eeprom1(i2c, EEPROM_24LC256, 1);
    -
    See also:
    I2CMaster
    +
    SoftI2C i2c(A4, A5);
    +
    EEPROM24 eeprom0(i2c, EEPROM_24LC256, 0);
    +
    EEPROM24 eeprom1(i2c, EEPROM_24LC256, 1);
    +
    See Also
    I2CMaster

    Definition at line 60 of file EEPROM24.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    @@ -176,8 +197,7 @@ Public Member Functions
    -
    -
    +

    Constructs a new EEPROM access object on bus for an EEPROM of the specified type.

    The bank can be used to choose between multiple EEPROM's on bus of the specified type. The bank corresponds to the value that is set on the EEPROM's A0, A1, and A2 address pins. Note that some EEPROM's have less than 3 address pins; consult the datasheet for more information.

    @@ -186,8 +206,8 @@ Public Member Functions
    @@ -198,40 +218,46 @@ Public Member Functions
    -
    -
    +

    Returns true if the EEPROM is available on the I2C bus; false otherwise.

    This function can be used to probe the I2C bus to determine if the EEPROM is present or not.

    -
    See also:
    read(), write()
    +
    See Also
    read(), write()

    Definition at line 152 of file EEPROM24.cpp.

    - +
    + + + + + +
    - +
    unsigned long EEPROM24::pageSize ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the size of a single EEPROM page in bytes.

    Writes that are a multiple of the page size and aligned on a page boundary will typically be more efficient than non-aligned writes.

    -
    See also:
    size()
    +
    See Also
    size()

    Definition at line 66 of file EEPROM24.h.

    - +
    @@ -243,17 +269,16 @@ Public Member Functions
    -
    -
    +

    Reads a single byte from the EEPROM at address.

    -
    See also:
    write()
    +
    See Also
    write()

    Definition at line 167 of file EEPROM24.cpp.

    - +
    @@ -281,39 +306,77 @@ Public Member Functions
    -
    -
    +

    Reads a block of length bytes from the EEPROM at address into the specified data buffer.

    Returns the number of bytes that were read, which may be short if address + length is greater than size() or the EEPROM is not available on the I2C bus.

    -
    See also:
    write(), available()
    +
    See Also
    write(), available()

    Definition at line 187 of file EEPROM24.cpp.

    - +
    + + + + + +
    - +
    unsigned long EEPROM24::size ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the size of the EEPROM in bytes.

    -
    See also:
    pageSize()
    +
    See Also
    pageSize()

    Definition at line 65 of file EEPROM24.h.

    - + +
    +
    + + + + + + + + + + + + + + + + + + +
    bool EEPROM24::write (unsigned long address,
    uint8_t value 
    )
    +
    + +

    Writes a byte value to address in the EEPROM.

    +

    Returns true if the byte was written successfully, or false if address is out of range or the EEPROM is not available on the I2C bus.

    +
    See Also
    read(), available()
    + +

    Definition at line 213 of file EEPROM24.cpp.

    + +
    +
    +
    @@ -341,72 +404,27 @@ Public Member Functions
    -
    -
    +

    Writes length bytes from a data buffer to address in the EEPROM.

    Returns the number of bytes that were written, which may be short if address + length is greater than size() or the EEPROM is not available on the I2C bus.

    Best performance will be achieved if address and length are a multiple of pageSize().

    -
    See also:
    read(), available(), pageSize()
    +
    See Also
    read(), available(), pageSize()

    Definition at line 235 of file EEPROM24.cpp.

    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - -
    bool EEPROM24::write (unsigned long address,
    uint8_t value 
    )
    -
    -
    - -

    Writes a byte value to address in the EEPROM.

    -

    Returns true if the byte was written successfully, or false if address is out of range or the EEPROM is not available on the I2C bus.

    -
    See also:
    read(), available()
    - -

    Definition at line 213 of file EEPROM24.cpp.

    -

    The documentation for this class was generated from the following files: - - - - - -
    - -
    - - + + + diff --git a/classField-members.html b/classField-members.html index 14f3c730..3c94db79 100644 --- a/classField-members.html +++ b/classField-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Field Member List
    -
    -
    -This is the complete list of members for Field, including all inherited members. - - - - - - - - - - - - - -
    dispatch(int event)Field [virtual]
    enterField(bool reverse)Field [virtual]
    exitField()Field [virtual]
    Field(const String &label)Field [explicit]
    Field(Form &form, const String &label)Field
    form() const Field [inline]
    Form (defined in Field)Field [friend]
    isCurrent() const Field
    label() const Field [inline]
    lcd() const Field [inline, protected]
    setLabel(const String &label)Field
    updateCursor()Field [protected, virtual]
    ~Field()Field
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -93,8 +80,34 @@ This is the complete list of members for Fi
    - + +
    +
    +
    Field Member List
    +
    +
    + +

    This is the complete list of members for Field, including all inherited members.

    + + + + + + + + + + + + + + +
    dispatch(int event)Fieldvirtual
    enterField(bool reverse)Fieldvirtual
    exitField()Fieldvirtual
    Field(const String &label)Fieldexplicit
    Field(Form &form, const String &label)Field
    form() const Fieldinline
    Form (defined in Field)Fieldfriend
    isCurrent() const Field
    label() const Fieldinline
    lcd() const Fieldinlineprotected
    setLabel(const String &label)Field
    updateCursor()Fieldprotectedvirtual
    ~Field()Field
    + + diff --git a/classField.html b/classField.html index 2e99a858..efefc82a 100644 --- a/classField.html +++ b/classField.html @@ -2,29 +2,37 @@ + ArduinoLibs: Field Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    Field Class Reference
    -
    +
    - +

    Manages a single data input/output field within a Form. More...

    @@ -86,75 +109,82 @@ Inheritance diagram for Field:
    TimeField - -

    List of all members.

    - - - - - - - - + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + +

    +

    Public Member Functions

     Field (const String &label)
     Constructs a new field with a specific label.
    Field (Form &form, const String &label)
     Constructs a new field with a specific label and attaches it to a form.
     ~Field ()
     Destroys this field and removes it from its owning Form.
    +
     Field (const String &label)
     Constructs a new field with a specific label.
    Field (Form &form, const String &label)
     Constructs a new field with a specific label and attaches it to a form.
     ~Field ()
     Destroys this field and removes it from its owning Form.
    Formform () const
     Returns the Form that owns this field; null if not associated with a Form.
    virtual int dispatch (int event)
     Dispatches event via this field.
    virtual void enterField (bool reverse)
     Enters the field due to form navigation.
    virtual void exitField ()
     Exits the field due to form navigation.
    const String & label () const
     Returns the label to display in the first line of this field.
    void setLabel (const String &label)
     Sets the label to display in the first line of this field.
    bool isCurrent () const
     Returns true if this field is the currently-displayed field in its owning form; false otherwise.

    +

     Returns the Form that owns this field; null if not associated with a Form.
    virtual int dispatch (int event)
     Dispatches event via this field.
    virtual void enterField (bool reverse)
     Enters the field due to form navigation.
    virtual void exitField ()
     Exits the field due to form navigation.
    const String & label () const
     Returns the label to display in the first line of this field.
    void setLabel (const String &label)
     Sets the label to display in the first line of this field.
    bool isCurrent () const
     Returns true if this field is the currently-displayed field in its owning form; false otherwise.
    + - - - - - + + +

    Protected Member Functions

    +
    LiquidCrystal * lcd () const
     Returns the LCD that this field is being drawn on.
    virtual void updateCursor ()
     Updates the cursor position after the label has been drawn by setLabel().

    +

     Returns the LCD that this field is being drawn on.
    virtual void updateCursor ()
     Updates the cursor position after the label has been drawn by setLabel().
    + - +

    Friends

    -class Form
    +class Form
    -

    Detailed Description

    +

    Detailed Description

    Manages a single data input/output field within a Form.

    -
    See also:
    Form, BoolField, IntField, ListField, TextField, TimeField
    +
    See Also
    Form, BoolField, IntField, ListField, TextField, TimeField

    Definition at line 28 of file Field.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    Field::Field ( const String &  label) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new field with a specific label.

    The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

    -
    See also:
    Form::addField()
    +
    See Also
    Form::addField()

    Definition at line 40 of file Field.cpp.

    - +
    @@ -165,89 +195,109 @@ class ",""],legend:[1,"
    ","
    "],thead:[1,"
    + -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int Field::dispatch ( int  event) [virtual]
    - -
    +
    +virtual
    +

    Dispatches event via this field.

    The event is usually obtained from LCD::getButton().

    Returns zero if the event has been handled and no further action is required.

    Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

    Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

    -
    See also:
    Form::dispatch(), LCD::getButton()
    +
    See Also
    Form::dispatch(), LCD::getButton()
    -

    Reimplemented in BoolField, IntField, ListField, and TimeField.

    +

    Reimplemented in ListField, TimeField, IntField, and BoolField.

    Definition at line 96 of file Field.cpp.

    - +
    + + + + + +
    - +
    void Field::enterField ( bool  reverse) [virtual]
    - -
    +
    +virtual
    +

    Enters the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

    This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

    The default implementation prints the label().

    -
    See also:
    exitField()
    +
    See Also
    exitField()
    -

    Reimplemented in BoolField, IntField, ListField, TextField, and TimeField.

    +

    Reimplemented in ListField, TimeField, IntField, BoolField, and TextField.

    Definition at line 116 of file Field.cpp.

    - +
    + + + + + +
    - +
    void Field::exitField ( ) [virtual]
    - -
    +
    +virtual
    +

    Exits the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate from the field.

    -
    See also:
    enterField()
    +
    See Also
    enterField()

    Reimplemented in TimeField.

    @@ -255,7 +305,7 @@ class 
    +
    @@ -266,8 +316,7 @@ class "&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}}); -/* - * Sizzle CSS Selector Engine - v0.9.3 - * Copyright 2009, The Dojo Foundation - * Released under the MIT, BSD, and GPL Licenses. - * More information: http://sizzlejs.com/ - */ -(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return UT[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="

    ";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="
    ";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0) -{I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("
    ").append(M.responseText.replace(//g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function() -{G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='
    +

    Returns true if this field is the currently-displayed field in its owning form; false otherwise.

    This function should be called from property setters in subclasses to determine if the screen should be updated when a property is modified.

    @@ -276,28 +325,35 @@ class 
    +
    + + + + + +
    - +
    const String & Field::label ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the label to display in the first line of this field.

    -
    See also:
    setLabel()
    +
    See Also
    setLabel()

    Definition at line 41 of file Field.h.

    - +
    @@ -309,33 +365,39 @@ class ","
    + - +
    + + + + + +
    - +
    void Field::updateCursor ( ) [protected, virtual]
    - -
    +
    +protectedvirtual
    +

    Updates the cursor position after the label has been drawn by setLabel().

    The default implementation does nothing. Subclasses that use an LCD cursor may override this to ensure that the cursor position stays valid after the label is modified.

    -
    See also:
    setLabel()
    +
    See Also
    setLabel()

    Definition at line 191 of file Field.cpp.

    @@ -345,23 +407,12 @@ class 
    Field.h
  • Field.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classField.png b/classField.png index c4a747e5bd0471771c0635a93dd4b497d8e5d1d6..7dcee8095ffd7a3443edd94df3bbbaae667447c8 100644 GIT binary patch delta 772 zcmeBYy}~vjrv9;~i(^Oy3L(o0Z+3VK7-I)6R?MVhU1;mZGkS4OiVvH1eBN@I2PRnULb7`1vP>)X2F4#E#tn=s4xMDwnwf6Su5kp& z_^J8s8AGXsrGp_KUqIJn<|&V!Ff0XfHT{sd^$`B4`Z+c8p5Hw4*+!kw;<)Wsux#tKYvpgUCY7|ked}>aa^K;nK9fWqJeef&2!iWDj4972*6iA& zvhwls$*&tvm;HX2wz=B+F6+Y72UT{)E2~TIuB-YrP4jm5>vdJWVz;h6S%1HNr@ZH@ zAE8B_uPo;LS)upT>(;%U_paRgFMRmPX^A^#vwuhS-~DEEvfghOZ(z>~!JNZ3F|D^fC{QB9w3x9w3$SkWGf4)y=<&*Z3-|PNO>dBq)$10+B z*TlD}y7j*Mih-VlkY1n$$6~#etk#I@nwHL##qd=+4Mww+M2ux zf8O4kMfiEql!-Uzc?2BZ;JMYrOWrkpT2+V->0Z~+pnyDdiveZ zt$%7O6D@a5)91hWHB#E{obbu(lgo7%`@H7=wofjlq`Ch7E`~euwT-${Yl`2V_~xPK zxj$Kdr;6-T>zH#Yo{WBao{C7ga!$-7Cm7zRQklJWZc?%J+O1_>`2~L&kIeDRmX-;r PX8;0ES3j3^P6S;%29E`hTz?)(L_t(|0qxz}j;k;Xh2fe?eg8+^7YQUG2d|XEu+eXgRMfy4 z_;8)u*ImmF*KHr|w&Z^v06FB4Lk>CQk03WQGt1ZFQS)RBe?i{+2J*AXEp+^L1o;)@ z(L4S@e(Ef5kkjRtbosWCLVn?3Df%69X8GgDU)xlFnbGB^k$+zs06FB4Lk>CQkW-LD zPTAqY@YnT$0P@F+e=vvq`Qn&E&h|+`4mkxmOUZ%>a>!wV{4wNaW>zg* zT(D(Hi}7gvqJMWg#RYE4AZvf77*}V7t9DN*rBzvLR88ilCGz_D!wV9CFAZhn%dM{BUKrLzYng0K}Y0YcGGSq5uE@ M07*qoM6N<$f<6=}00000 diff --git a/classForm-members.html b/classForm-members.html index 002461a6..cee8afd3 100644 --- a/classForm-members.html +++ b/classForm-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Form Member List
    -
    -
    -This is the complete list of members for Form, including all inherited members. - - - - - - - - - - - - - - - -
    addField(Field *field)Form
    currentField() const Form [inline]
    defaultField()Form
    dispatch(int event)Form
    Field (defined in Form)Form [friend]
    Form(LiquidCrystal &lcd)Form [explicit]
    hide()Form
    isCurrent(Field &field) const Form [inline]
    isVisible() const Form [inline]
    nextField()Form
    prevField()Form
    removeField(Field *field)Form
    setCurrentField(Field *field)Form
    show()Form
    ~Form()Form
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -95,8 +80,36 @@ This is the complete list of members for For
    - + +
    +
    +
    Form Member List
    +
    +
    + +

    This is the complete list of members for Form, including all inherited members.

    + + + + + + + + + + + + + + + + +
    addField(Field *field)Form
    currentField() const Forminline
    defaultField()Form
    dispatch(int event)Form
    Field (defined in Form)Formfriend
    Form(LiquidCrystal &lcd)Formexplicit
    hide()Form
    isCurrent(Field &field) const Forminline
    isVisible() const Forminline
    nextField()Form
    prevField()Form
    removeField(Field *field)Form
    setCurrentField(Field *field)Form
    show()Form
    ~Form()Form
    + + diff --git a/classForm.html b/classForm.html index 84f45b51..c3c76351 100644 --- a/classForm.html +++ b/classForm.html @@ -2,29 +2,37 @@ + ArduinoLibs: Form Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    Form Class Reference
    -
    +
    - +

    Manager for a form containing data input/output fields. More...

    #include <Form.h>

    - -

    List of all members.

    - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     Form (LiquidCrystal &lcd)
     Constructs a new form and associates it with lcd.
    +
     Form (LiquidCrystal &lcd)
     Constructs a new form and associates it with lcd.
     ~Form ()
     Detaches all remaining fields and destroys this form.
    int dispatch (int event)
     Dispatches event to the currently active field using Field::dispatch().
    void nextField ()
     Changes to the next field in the "tab order".
    void prevField ()
     Changes to the previous field in the "tab order".
    void defaultField ()
     Changes to default field (i.e., the first field).
    void addField (Field *field)
     Adds field to this form.
    void removeField (Field *field)
     Removes field from this form.
    FieldcurrentField () const
     Returns the current field that is displayed on-screen.
    void setCurrentField (Field *field)
     Sets the current field that is displayed on-screen.
    bool isCurrent (Field &field) const
     Returns true if field is currently displayed on-screen, false otherwise.
    void show ()
     Shows the form, or does nothing if the form is already on-screen.
    void hide ()
     Hides the form, or does nothing if the form is not on-screen.
    bool isVisible () const
     Returns true if the form is shown; false if the form is hidden.

    +

     Detaches all remaining fields and destroys this form.
    int dispatch (int event)
     Dispatches event to the currently active field using Field::dispatch().
    void nextField ()
     Changes to the next field in the "tab order".
    void prevField ()
     Changes to the previous field in the "tab order".
    void defaultField ()
     Changes to default field (i.e., the first field).
    void addField (Field *field)
     Adds field to this form.
    void removeField (Field *field)
     Removes field from this form.
    FieldcurrentField () const
     Returns the current field that is displayed on-screen.
    void setCurrentField (Field *field)
     Sets the current field that is displayed on-screen.
    bool isCurrent (Field &field) const
     Returns true if field is currently displayed on-screen, false otherwise.
    void show ()
     Shows the form, or does nothing if the form is already on-screen.
    void hide ()
     Hides the form, or does nothing if the form is not on-screen.
    bool isVisible () const
     Returns true if the form is shown; false if the form is hidden.
    + - +

    Friends

    -class Field
    +class Field
    -

    Detailed Description

    +

    Detailed Description

    Manager for a form containing data input/output fields.

    See the Form example for more information on creating an application that uses forms and fields.

    Definition at line 32 of file Form.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    Form::Form ( LiquidCrystal &  lcd) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new form and associates it with lcd.

    This constructor is typically followed by calls to construct Field values for each of the fields on the form. For example:

    -
     Form mainForm(lcd);
    - TextField welcomeField(mainForm, "Form example", "v1.0");
    -
    +
    Form mainForm(lcd);
    +
    TextField welcomeField(mainForm, "Form example", "v1.0");
    +
    FormText.png
    @@ -144,8 +173,8 @@ class 
    +

    Member Function Documentation

    +
    @@ -157,40 +186,46 @@ class ","
    + - +
    + + + + + +
    - +
    Field * Form::currentField ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the current field that is displayed on-screen.

    Returns null if the form has no fields, or setCurrentField() explicitly set the current field to null.

    -
    See also:
    setCurrentField(), isCurrent()
    +
    See Also
    setCurrentField(), isCurrent()

    Definition at line 46 of file Form.h.

    - +
    @@ -201,17 +236,16 @@ class 
  • ListField.h
  • ListField.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classListField.png b/classListField.png index 78b21f138fcac917c35252ed12baa71f116f93ba..c2b62b4fd0e679934ba9af04bed6aa41b2114de4 100644 GIT binary patch delta 249 zcmV8}f1jlPB|9|qe1U0~2QZSVwU5S`FBAu{y zK7hM>5L}W%EZ5TYsK-uKE?r5g7@Gs00000NkvXXu0mjfOuu^- delta 212 zcmV;_04x8^0;mFzTz|JoL_t(|0qxz<4uv2H24H^Mc>hQ4f{vmVC7#w+FgMSz?}#+J zro|t$ByWTT03aolOf{Ld`~PtZsUiOwv>V*U6)VT>?C8F^YYy91f9rWC`W*M@Wp?5l zYX;lPcUfjXp0Lb*JYyg0bJ(z9!-jp%!XE^8QJ=N-M10u72!xoRW; O0000 + ArduinoLibs: Member List + + - + + - - - -
    + +
    + - +
    @@ -223,28 +257,27 @@ class  - +
    +
    +

    Dispatches event to the currently active field using Field::dispatch().

    The event is usually obtained from LCD::getButton().

    Returns zero if the event has been handled and no further action is required.

    Returns FORM_CHANGED if one of the fields on the form has changed value due to the event, perhaps requiring the application to take further action based on the new field value. Use currentField() or isCurrent() to determine which field has changed.

    -
     int event = lcd.getButton();
    - if (mainForm.dispatch(event) == FORM_CHANGED) {
    -     if (mainForm.isCurrent(volumeField)) {
    -         // Adjust the volume to match the field.
    -         setVolume(volumeField.value());
    -     }
    - }
    -

    This function handles the Left and Right buttons to navigate between fields.

    -
    See also:
    Field::dispatch(), LCD::getButton(), currentField(), isCurrent()
    +
    int event = lcd.getButton();
    +
    if (mainForm.dispatch(event) == FORM_CHANGED) {
    +
    if (mainForm.isCurrent(volumeField)) {
    +
    // Adjust the volume to match the field.
    +
    setVolume(volumeField.value());
    +
    }
    +
    }
    +

    This function handles the Left and Right buttons to navigate between fields.

    +
    See Also
    Field::dispatch(), LCD::getButton(), currentField(), isCurrent()

    Definition at line 99 of file Form.cpp.

    - +
    @@ -255,62 +288,75 @@ class  - +
    +
    + - +
    + + + + + +
    - +
    bool Form::isCurrent ( Field field) const [inline] const
    - -
    +
    +inline
    +

    Returns true if field is currently displayed on-screen, false otherwise.

    This function is typically called after dispatch() returns FORM_CHANGED to determine which field has changed.

    -
    See also:
    currentField(), setCurrentField()
    +
    See Also
    currentField(), setCurrentField()

    Definition at line 49 of file Form.h.

    - +
    + + + + + +
    - +
    bool Form::isVisible ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns true if the form is shown; false if the form is hidden.

    -
    See also:
    show(), hide()
    +
    See Also
    show(), hide()

    Definition at line 53 of file Form.h.

    - +
    @@ -321,17 +367,16 @@ class 
  • LCD_BUTTON_SELECT_RELEASED - Select button was released.
  • For convenience, all RELEASED button codes are the negation of their pressed counterparts. That is, LCD_BUTTON_LEFT_RELEASED == -LCD_BUTTON_LEFT. LCD_BUTTON_NONE is defined to be zero. Thus, you can check if a generic button has been pressed with button > 0 and if a generic button has been released with button < 0.

    -

    -Support for DFRobot LCD Shield

    +

    +Support for DFRobot LCD Shield

    The DFRobot LCD Shield is almost identical to the Freetronics shield, except it uses pin 10 for the back light instead of pin 3. This can be specified in the application's setup() function:

    -
     LCD lcd;
    -
    - void setup() {
    -     lcd.setBacklightPin(10);
    - }
    -

    The back light pin is configured for output the first time the application calls getButton().

    -
    See also:
    Form, Hello World Example
    +
    LCD lcd;
    +
    +
    void setup() {
    +
    lcd.setBacklightPin(10);
    +
    }
    +

    The back light pin is configured for output the first time the application calls getButton().

    +
    See Also
    Form, Hello World Example

    Definition at line 48 of file LCD.h.

    -

    Member Enumeration Documentation

    - +

    Member Enumeration Documentation

    +
    + - +
    @@ -342,17 +387,16 @@ class 
  • IntField.h
  • IntField.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classIntField.png b/classIntField.png index 8661f1767538d0db9fccbec1838bb1344b2b691d..1afe07410ce15d4b593189ea06866605696403f8 100644 GIT binary patch delta 227 zcmV<90383J0=EK?Tz|$%L_t(|0qxxZ3d0}_hS4txc>g2MTG83rVPve(TKbbG0m^8)oo3`!~W>1zN0002ovPDHLkV1gqJb9ev% delta 205 zcmV;;05bo#0-*wsTz{}hL_t(|0qx!43d0}_1YplX-v5#JBQ91OiyktzHK9;ZzMiI~ zzth1~I`VowL;(PhGwMup8>q`;R}?hYM$@X0a@{LE)OqIwwL{P!#B z&o(Z(S=+2c7)B`(hH>hnJq#5pRH%n3FqJ^;;_p?(c=xrNY({Rba-Kd?NYETp(D!L0 zS82*As|@SBn^jjWp;7)0y)5g?lIoYI)zrBbdKlmQuPCNo^+pUzWnL6A00000NkvXX Hu0mjf9%NvT diff --git a/classLCD-members.html b/classLCD-members.html index 470f233e..2dbcc7ca 100644 --- a/classLCD-members.html +++ b/classLCD-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    + - +
    @@ -364,18 +408,17 @@ class  - +
    +
    + - +
    @@ -387,18 +430,17 @@ class  - +
    +
    + - +
    @@ -409,13 +451,12 @@ class  -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    +
    +

    Shows the form, or does nothing if the form is already on-screen.

    When the form is shown, the screen will be cleared and the currentField() will be drawn.

    If the form was previously hidden, then the field that was previously current will be shown again. Call defaultField() before show() to reset the form to show the first field instead.

    -
    See also:
    hide(), isVisible(), defaultField()
    +
    See Also
    hide(), isVisible(), defaultField()

    Definition at line 274 of file Form.cpp.

    @@ -425,23 +466,12 @@ class 
    Form.h
  • Form.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classI2CMaster-members.html b/classI2CMaster-members.html index 327a1e86..ccc4e238 100644 --- a/classI2CMaster-members.html +++ b/classI2CMaster-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    I2CMaster Member List
    -
    -
    -This is the complete list of members for I2CMaster, including all inherited members. - - - - - - - -
    available()=0I2CMaster [pure virtual]
    endWrite()=0I2CMaster [pure virtual]
    maxTransferSize() const =0I2CMaster [pure virtual]
    read()=0I2CMaster [pure virtual]
    startRead(unsigned int address, unsigned int count)=0I2CMaster [pure virtual]
    startWrite(unsigned int address)I2CMaster [virtual]
    write(uint8_t value)=0I2CMaster [pure virtual]
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -87,8 +80,28 @@ This is the complete list of members for +
    +
    +
    +
    I2CMaster Member List
    +
    +
    + +

    This is the complete list of members for I2CMaster, including all inherited members.

    + + + + + + + + +
    available()=0I2CMasterpure virtual
    endWrite()=0I2CMasterpure virtual
    maxTransferSize() const =0I2CMasterpure virtual
    read()=0I2CMasterpure virtual
    startRead(unsigned int address, unsigned int count)=0I2CMasterpure virtual
    startWrite(unsigned int address)I2CMastervirtual
    write(uint8_t value)=0I2CMasterpure virtual
    + + diff --git a/classI2CMaster.html b/classI2CMaster.html index 9898a2ea..75fc5de9 100644 --- a/classI2CMaster.html +++ b/classI2CMaster.html @@ -2,29 +2,37 @@ + ArduinoLibs: I2CMaster Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    I2CMaster Class Reference
    -
    +
    - +

    Abstract base class for I2C master implementations. More...

    @@ -80,100 +103,122 @@ Inheritance diagram for I2CMaster:
    SoftI2C - -

    List of all members.

    - - - - - - - - - - - - - - - + + + + + + + + + + + + +

    +

    Public Member Functions

    +
    virtual unsigned int maxTransferSize () const =0
     Returns the maximum number of bytes that can be read or written in a single request by this bus master.
    virtual void startWrite (unsigned int address)
     Starts a write operation by sending a start condition and the I2C control byte.
    virtual void write (uint8_t value)=0
     Writes a single byte value on the I2C bus.
    virtual bool endWrite ()=0
     Ends the current write operation.
    virtual bool startRead (unsigned int address, unsigned int count)=0
     Starts a read operation for count bytes by sending the start condition and the I2C control byte.
    virtual unsigned int available ()=0
     Returns the number of bytes that are still available for reading.
    virtual uint8_t read ()=0
     Reads a single byte from the I2C bus.
     Returns the maximum number of bytes that can be read or written in a single request by this bus master.
    virtual void startWrite (unsigned int address)
     Starts a write operation by sending a start condition and the I2C control byte.
    virtual void write (uint8_t value)=0
     Writes a single byte value on the I2C bus.
    virtual bool endWrite ()=0
     Ends the current write operation.
    virtual bool startRead (unsigned int address, unsigned int count)=0
     Starts a read operation for count bytes by sending the start condition and the I2C control byte.
    virtual unsigned int available ()=0
     Returns the number of bytes that are still available for reading.
    virtual uint8_t read ()=0
     Reads a single byte from the I2C bus.
    -

    Detailed Description

    +

    Detailed Description

    Abstract base class for I2C master implementations.

    -
    See also:
    SoftI2C
    +
    See Also
    SoftI2C

    Definition at line 28 of file I2CMaster.h.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    unsigned int I2CMaster::available ( ) [pure virtual]
    - -
    +
    +pure virtual
    +

    Returns the number of bytes that are still available for reading.

    -
    See also:
    startRead(), read()
    +
    See Also
    startRead(), read()

    Implemented in SoftI2C.

    - +
    + + + + + +
    - +
    bool I2CMaster::endWrite ( ) [pure virtual]
    - -
    +
    +pure virtual
    +

    Ends the current write operation.

    Returns true if the write operation was acknowledged; false otherwise.

    -
    See also:
    startWrite(), write()
    +
    See Also
    startWrite(), write()

    Implemented in SoftI2C.

    - +
    + + + + + +
    - +
    uint8_t I2CMaster::read ( ) [pure virtual]
    - -
    +
    +pure virtual
    +

    Reads a single byte from the I2C bus.

    -
    See also:
    startRead(), available()
    +
    See Also
    startRead(), available()

    Implemented in SoftI2C.

    - +
    + + + + + +
    @@ -190,61 +235,79 @@ virtual unsigned int  - +
    bool I2CMaster::startRead ) [pure virtual]
    - -
    +
    +pure virtual
    +

    Starts a read operation for count bytes by sending the start condition and the I2C control byte.

    The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

    Returns true if the read request was acknowledged by the I2C slave or false otherwise. If true, this function should be followed by count calls to read() to fetch the bytes.

    -
    See also:
    available(), read(), startWrite()
    +
    See Also
    available(), read(), startWrite()

    Implemented in SoftI2C.

    - +
    + + + + + +
    - +
    void I2CMaster::startWrite ( unsigned int  address) [virtual]
    - -
    +
    +virtual
    +

    Starts a write operation by sending a start condition and the I2C control byte.

    The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

    -
    See also:
    write(), endWrite(), startRead()
    +
    See Also
    write(), endWrite(), startRead()

    Reimplemented in SoftI2C.

    - +
    + + + + + +
    - +
    void I2CMaster::write ( uint8_t  value) [pure virtual]
    - -
    +
    +pure virtual
    +

    Writes a single byte value on the I2C bus.

    -
    See also:
    startWrite(), endWrite()
    +
    See Also
    startWrite(), endWrite()

    Implemented in SoftI2C.

    @@ -254,23 +317,12 @@ virtual unsigned int 
    I2CMaster.h
  • I2CMaster.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classI2CMaster.png b/classI2CMaster.png index 8d9b48bc5456c6a7f89aa061a019782ced4ce848..74b8b7cbb56ccd420acf1228443edb380f5cce39 100644 GIT binary patch delta 355 zcmV-p0i6E)0=5H?Tz^GLL_t(|0qvdJl7t`(L=T-R|NoO$xr~WkmoUGqQWFDk zqKN_UH8B9bCI-OQ!~ppEw-__C8!cvL*TN*}sU}8}d>t`i{q3e&r`t+d9}IjjvAM_^j8OYX89X(8 zm@tFTIsc`^W9qO{r0Obb>B3SJ4>JTY_1j>2r@F}7+ISdIYJcxduO$o9%vz`N(@e}) zn3x~Tfz=4XQJ7joI5C)7LpVX0KkHOt5|fz3BqlMx!(7i+pSRFe0xU6aFaR*P1*L!& zybV4EZD=lIWHxWuVI(LIU_r9D2)RvalF<)0F-Ika(Qh$sI=fDd=S^XbF&c8g^zuYt v4m;JZ1;6;h6e4a~TX?=V`DrHR3=?7>VSx|D8JD0900000NkvXXu0mjf-sXZ* diff --git a/classIRreceiver-members.html b/classIRreceiver-members.html index f8e4fc0c..baa5d5de 100644 --- a/classIRreceiver-members.html +++ b/classIRreceiver-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    IRreceiver Member List
    -
    -
    -This is the complete list of members for IRreceiver, including all inherited members. - - - - - - - -
    _IR_receive_interrupt (defined in IRreceiver)IRreceiver [friend]
    AUTO_REPEATIRreceiver [static]
    command()IRreceiver
    IRreceiver(int interruptNumber=0)IRreceiver [explicit]
    setSystemFilter(int system)IRreceiver [inline]
    system() const IRreceiver [inline]
    systemFilter() const IRreceiver [inline]
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -87,8 +80,28 @@ This is the complete list of members for +
    +
    +
    +
    IRreceiver Member List
    +
    +
    + +

    This is the complete list of members for IRreceiver, including all inherited members.

    + + + + + + + + +
    _IR_receive_interrupt (defined in IRreceiver)IRreceiverfriend
    AUTO_REPEATIRreceiverstatic
    command()IRreceiver
    IRreceiver(int interruptNumber=0)IRreceiverexplicit
    setSystemFilter(int system)IRreceiverinline
    system() const IRreceiverinline
    systemFilter() const IRreceiverinline
    + + diff --git a/classIRreceiver.html b/classIRreceiver.html index 6bec2988..c9dc8138 100644 --- a/classIRreceiver.html +++ b/classIRreceiver.html @@ -2,29 +2,37 @@ + ArduinoLibs: IRreceiver Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    IRreceiver Class Reference
    -
    +
    - +

    Manages the reception of RC-5 commands from an infrared remote control. More...

    #include <IRreceiver.h>

    - -

    List of all members.

    - - - - - - - - - - - - + + + + + + + + +

    +

    Public Member Functions

    +
     IRreceiver (int interruptNumber=0)
     Constructs a new infrared remote control receiver that is attached to interruptNumber.
    int command ()
     Returns the next command from the remote control.
    int system () const
     Returns the system number of the previous command(), indicating whether the command was for a TV, VCR, CD player, etc.
    int systemFilter () const
     Returns the system to filter commands against, or -1 if no filter is set.
    void setSystemFilter (int system)
     Sets the system to filter commands against, or -1 to turn off the system filter.

    +

     Constructs a new infrared remote control receiver that is attached to interruptNumber.
    int command ()
     Returns the next command from the remote control.
    int system () const
     Returns the system number of the previous command(), indicating whether the command was for a TV, VCR, CD player, etc.
    int systemFilter () const
     Returns the system to filter commands against, or -1 if no filter is set.
    void setSystemFilter (int system)
     Sets the system to filter commands against, or -1 to turn off the system filter.
    + - - - +

    Static Public Attributes

    +
    static const int AUTO_REPEAT = 128
     Flag that is added to the output of command() when the command is an auto-repeated button press rather than the original button press.

    +

     Flag that is added to the output of command() when the command is an auto-repeated button press rather than the original button press.
    + -

    Friends

    +
    void _IR_receive_interrupt (void)
    -

    Detailed Description

    +

    Detailed Description

    Manages the reception of RC-5 commands from an infrared remote control.

    IRreceiver recognizes commands in the Philips RC-5 protocol. This is a fairly common infrared protocol, supported by most universal remote controls. Program the universal remote to simulate a Philips TV, VCR, CD player, etc.

    This class uses interrupts to process incoming bits from a standard 3-pin infrared receiver:

    @@ -108,74 +131,74 @@ void 
    _IR_receive_interrupt

    Typically, pin 1 of the receiver should be connected to the Arduino interrupt pin (e.g. D2), pin 2 should be connected to GND, and pin 3 should be connected to 5V. Consult the datasheet for your receiver to be sure though; some receivers may have different pin assignments.

    The receiver is initialized by constructing an instance of the IRreceiver class:

    -
     IRreceiver ir;
    -

    By default, interrupt 0 on pin D2 is used. To change to another interrupt, pass its number to the constructor:

    -
     IRreceiver ir(1);    // Interrupt 1 on pin D3
    -

    Currently this class can only handle a single instance of IRreceiver being active in the application. It isn't possible to have separate IRreceiver instances on different pins. Usually this won't be a problem because the same receiver can process inputs from multiple remotes.

    +

    By default, interrupt 0 on pin D2 is used. To change to another interrupt, pass its number to the constructor:

    +
    IRreceiver ir(1); // Interrupt 1 on pin D3
    +

    Currently this class can only handle a single instance of IRreceiver being active in the application. It isn't possible to have separate IRreceiver instances on different pins. Usually this won't be a problem because the same receiver can process inputs from multiple remotes.

    The application retrieves incoming infrared commands by calling the command() function. The return value indicates the type of command:

    -
     void loop() {
    -     switch (ir.command()) {
    -     case RC5_0: case RC5_1: case RC5_2: case RC5_3: case RC5_4:
    -     case RC5_5: case RC5_6: case RC5_7: case RC5_8: case RC5_9:
    -         // Process a digit
    -         ...
    -         break;
    -
    -     case RC5_ERASE:
    -         // Backspace/erase last digit.
    -         ...
    -         break;
    -
    -     case RC5_STANDBY:
    -         // Power on/off button.
    -         ...
    -         break;
    -     }
    - }
    -

    If the command is an auto-repeat of a previous button press, then the AUTO_REPEAT flag will be set in the value returned from command(). The application can choose to ignore all auto-repeats, process all auto-repeats, or choose which button to auto-repeat based on its code:

    -
     void loop() {
    -     switch (ir.command()) {
    -     case RC5_INC_VOLUME:
    -     case IRreceiver::AUTO_REPEAT | RC5_INC_VOLUME:
    -         // Volume increase button pressed or held.
    -         ...
    -         break;
    -
    -     case RC5_DEC_VOLUME:
    -     case IRreceiver::AUTO_REPEAT | RC5_DEC_VOLUME:
    -         // Volume decrease button pressed or held.
    -         ...
    -         break;
    -
    -     case RC5_MUTE:
    -         // Mute button (ignore auto-repeat).
    -         ...
    -         break;
    -     }
    - }
    -

    By default, command codes will be generated for every type of RC-5 remote control, be it a TV, VCR, CD player, or something else. The application can distinguish between the remote controls using system(); noting that command() must be called before system() for the system value to be valid. For example, the following code could be used in a two-player video game where the first player's remote is configured as a TV and the second player's remote is configured as a VCR:

    -
     void loop() {
    -     int cmd = ir.command();
    -     int sys = ir.system();
    -     if (sys == RC5_SYS_TV)
    -         player1(cmd);
    -     else if (sys == RC5_SYS_VCR)
    -         player2(cmd);
    -
    -     ...
    - }
    -

    If the application only cares about a single system and wishes to ignore all other systems, it can configure a system filter at startup:

    -
     IRreceiver ir;
    -
    - void setup() {
    -     ir.setSystemFilter(RC5_SYS_VCR);
    - }
    -

    The complete list of RC-5 system numbers and command codes is given in the RC5.h header file.

    -
    See also:
    DumpIR Example
    +
    void loop() {
    +
    switch (ir.command()) {
    +
    case RC5_0: case RC5_1: case RC5_2: case RC5_3: case RC5_4:
    +
    case RC5_5: case RC5_6: case RC5_7: case RC5_8: case RC5_9:
    +
    // Process a digit
    +
    ...
    +
    break;
    +
    +
    case RC5_ERASE:
    +
    // Backspace/erase last digit.
    +
    ...
    +
    break;
    +
    +
    case RC5_STANDBY:
    +
    // Power on/off button.
    +
    ...
    +
    break;
    +
    }
    +
    }
    +

    If the command is an auto-repeat of a previous button press, then the AUTO_REPEAT flag will be set in the value returned from command(). The application can choose to ignore all auto-repeats, process all auto-repeats, or choose which button to auto-repeat based on its code:

    +
    void loop() {
    +
    switch (ir.command()) {
    +
    case RC5_INC_VOLUME:
    +
    case IRreceiver::AUTO_REPEAT | RC5_INC_VOLUME:
    +
    // Volume increase button pressed or held.
    +
    ...
    +
    break;
    +
    +
    case RC5_DEC_VOLUME:
    +
    case IRreceiver::AUTO_REPEAT | RC5_DEC_VOLUME:
    +
    // Volume decrease button pressed or held.
    +
    ...
    +
    break;
    +
    +
    case RC5_MUTE:
    +
    // Mute button (ignore auto-repeat).
    +
    ...
    +
    break;
    +
    }
    +
    }
    +

    By default, command codes will be generated for every type of RC-5 remote control, be it a TV, VCR, CD player, or something else. The application can distinguish between the remote controls using system(); noting that command() must be called before system() for the system value to be valid. For example, the following code could be used in a two-player video game where the first player's remote is configured as a TV and the second player's remote is configured as a VCR:

    +
    void loop() {
    +
    int cmd = ir.command();
    +
    int sys = ir.system();
    +
    if (sys == RC5_SYS_TV)
    +
    player1(cmd);
    +
    else if (sys == RC5_SYS_VCR)
    +
    player2(cmd);
    +
    +
    ...
    +
    }
    +

    If the application only cares about a single system and wishes to ignore all other systems, it can configure a system filter at startup:

    +
    +
    +
    void setup() {
    +
    ir.setSystemFilter(RC5_SYS_VCR);
    +
    }
    +

    The complete list of RC-5 system numbers and command codes is given in the RC5.h header file.

    +
    See Also
    DumpIR Example

    Definition at line 29 of file IRreceiver.h.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    @@ -186,85 +209,105 @@ void 
    _IR_receive_interrupt
    -
    -
    +

    Returns the next command from the remote control.

    Returns -1 if there is no new command, or the number between 0 and 127 corresponding to the command. If the command is an auto-repeat button press rather than an original button press, then the AUTO_REPEAT flag will be set.

    The companion function system() will return the system number for the command indicating whether the command is for a TV, VCR, CD player, etc. By default, all systems are reported; use setSystemFilter() to filter out commands from all but a specific system.

    The next call to command() will return -1 or the code for the next button press.

    The header file RC5.h contains a list of command codes for common remote controls.

    -
    See also:
    system(), setSystemFilter()
    +
    See Also
    system(), setSystemFilter()

    Definition at line 220 of file IRreceiver.cpp.

    - +
    + + + + + +
    - +
    void IRreceiver::setSystemFilter ( int  system) [inline]
    - -
    +
    +inline
    +

    Sets the system to filter commands against, or -1 to turn off the system filter.

    If system is -1, then all received systems are returned via command() and system() irrespective of whether they are for a TV, VCR, CD player, or some other type of system. If system is set to anything other than -1, then only commands for that system are returned via command(). For example:

    -
     IRreceiver ir;
    - ir.setSystemFilter(RC5_SYS_VCR);
    -
    See also:
    systemFilter(), system(), command()
    +
    +
    ir.setSystemFilter(RC5_SYS_VCR);
    +
    See Also
    systemFilter(), system(), command()

    Definition at line 40 of file IRreceiver.h.

    - +
    + + + + + +
    - +
    int IRreceiver::system ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the system number of the previous command(), indicating whether the command was for a TV, VCR, CD player, etc.

    The return value from this function is valid only after a call to command(). The next call to command() will clear the system value, possibly to -1 if there is no new command.

    The header file RC5.h contains a list of system numbers for common remote controls.

    -
    See also:
    command(), setSystemFilter()
    +
    See Also
    command(), setSystemFilter()

    Definition at line 37 of file IRreceiver.h.

    - +
    + + + + + +
    - +
    int IRreceiver::systemFilter ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the system to filter commands against, or -1 if no filter is set.

    If this value is -1, then all received systems are returned via command() and system() irrespective of whether they are for a TV, VCR, CD player, or some other type of system. If this value is set to anything other than -1, then only commands for that system are returned via command().

    -
    See also:
    setSystemFilter(), system(), command()
    +
    See Also
    setSystemFilter(), system(), command()

    Definition at line 39 of file IRreceiver.h.

    @@ -274,23 +317,12 @@ void 
    _IR_receive_interrupt
  • IRreceiver.h
  • IRreceiver.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classIntField-members.html b/classIntField-members.html index 8c94db04..db1996fa 100644 --- a/classIntField-members.html +++ b/classIntField-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    IntField Member List
    -
    -
    -This is the complete list of members for IntField, including all inherited members. - - - - - - - - - - - - - - - - - - - - - - - - - -
    dispatch(int event)IntField [virtual]
    enterField(bool reverse)IntField [virtual]
    exitField()Field [virtual]
    Field(const String &label)Field [explicit]
    Field(Form &form, const String &label)Field
    form() const Field [inline]
    IntField(const String &label)IntField [explicit]
    IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)IntField
    IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)IntField
    isCurrent() const Field
    label() const Field [inline]
    lcd() const Field [inline, protected]
    maxValue() const IntField [inline]
    minValue() const IntField [inline]
    setLabel(const String &label)Field
    setMaxValue(int value)IntField [inline]
    setMinValue(int value)IntField [inline]
    setStepValue(int value)IntField [inline]
    setSuffix(const String &suffix)IntField
    setValue(int value)IntField
    stepValue() const IntField [inline]
    suffix() const IntField [inline]
    updateCursor()Field [protected, virtual]
    value() const IntField [inline]
    ~Field()Field
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -105,8 +80,46 @@ This is the complete list of members for
    - + +
    +
    +
    IntField Member List
    +
    +
    + +

    This is the complete list of members for IntField, including all inherited members.

    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    dispatch(int event)IntFieldvirtual
    enterField(bool reverse)IntFieldvirtual
    exitField()Fieldvirtual
    Field(const String &label)Fieldexplicit
    Field(Form &form, const String &label)Field
    form() const Fieldinline
    IntField(const String &label)IntFieldexplicit
    IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)IntField
    IntField(Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)IntField
    isCurrent() const Field
    label() const Fieldinline
    lcd() const Fieldinlineprotected
    maxValue() const IntFieldinline
    minValue() const IntFieldinline
    setLabel(const String &label)Field
    setMaxValue(int value)IntFieldinline
    setMinValue(int value)IntFieldinline
    setStepValue(int value)IntFieldinline
    setSuffix(const String &suffix)IntField
    setValue(int value)IntField
    stepValue() const IntFieldinline
    suffix() const IntFieldinline
    updateCursor()Fieldprotectedvirtual
    value() const IntFieldinline
    ~Field()Field
    + + diff --git a/classIntField.html b/classIntField.html index a7418259..785c3e78 100644 --- a/classIntField.html +++ b/classIntField.html @@ -2,29 +2,37 @@ + ArduinoLibs: IntField Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    IntField Class Reference
    -
    +
    - +

    Field that manages the input of an integer value. More...

    @@ -80,85 +103,118 @@ Inheritance diagram for IntField:
    Field - -

    List of all members.

    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     IntField (const String &label)
     Constructs a new integer field with a specific label.
     IntField (Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)
     Constructs a new integer field with a specific label, minValue, maxValue, stepValue, and value, and attaches it to a form.
    IntField (Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)
     Constructs a new integer field with a specific label, minValue, maxValue, stepValue, value, and suffix and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    int minValue () const
     Returns the minimum value for the input field.
    void setMinValue (int value)
     Sets the minimum value for the input field.
    int maxValue () const
     Returns the maximum value for the input field.
    void setMaxValue (int value)
     Sets the maximum value for the input field.
    int stepValue () const
     Returns the step value to use when increasing or decreasing the value() due to Up and Down button presses.
    void setStepValue (int value)
     Sets the step value value to use when increasing or decreasing the value() due to Up and Down button presses.
    int value () const
     Returns the current value of this field.
    void setValue (int value)
     Sets the current value of this field.
    const String & suffix () const
     Returns the suffix string to be displayed after the field's value.
    void setSuffix (const String &suffix)
     Sets the suffix string to be displayed after the field's value.
     IntField (const String &label)
     Constructs a new integer field with a specific label.
     IntField (Form &form, const String &label, int minValue, int maxValue, int stepValue, int value)
     Constructs a new integer field with a specific label, minValue, maxValue, stepValue, and value, and attaches it to a form.
    IntField (Form &form, const String &label, int minValue, int maxValue, int stepValue, int value, const String &suffix)
     Constructs a new integer field with a specific label, minValue, maxValue, stepValue, value, and suffix and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    int minValue () const
     Returns the minimum value for the input field.
    void setMinValue (int value)
     Sets the minimum value for the input field.
    int maxValue () const
     Returns the maximum value for the input field.
    void setMaxValue (int value)
     Sets the maximum value for the input field.
    int stepValue () const
     Returns the step value to use when increasing or decreasing the value() due to Up and Down button presses.
    void setStepValue (int value)
     Sets the step value value to use when increasing or decreasing the value() due to Up and Down button presses.
    int value () const
     Returns the current value of this field.
    void setValue (int value)
     Sets the current value of this field.
    const String & suffix () const
     Returns the suffix string to be displayed after the field's value.
    void setSuffix (const String &suffix)
     Sets the suffix string to be displayed after the field's value.
    - Public Member Functions inherited from Field
     Field (const String &label)
     Constructs a new field with a specific label.
    Field (Form &form, const String &label)
     Constructs a new field with a specific label and attaches it to a form.
     ~Field ()
     Destroys this field and removes it from its owning Form.
    +Formform () const
     Returns the Form that owns this field; null if not associated with a Form.
    virtual void exitField ()
     Exits the field due to form navigation.
    const String & label () const
     Returns the label to display in the first line of this field.
    void setLabel (const String &label)
     Sets the label to display in the first line of this field.
    bool isCurrent () const
     Returns true if this field is the currently-displayed field in its owning form; false otherwise.
    + + + + + +

    +Additional Inherited Members

    - Protected Member Functions inherited from Field
    +LiquidCrystal * lcd () const
     Returns the LCD that this field is being drawn on.
    virtual void updateCursor ()
     Updates the cursor position after the label has been drawn by setLabel().
    -

    Detailed Description

    +

    Detailed Description

    Field that manages the input of an integer value.

    IntField is intended for field values that are modifiable by the user. Pressing Up adds stepValue() to the current value and pressing Down subtracts stepValue() from the current value. The value is clamped to the range minValue() to maxValue().

    The following example creates an integer field with the label "Iterations", that ranges between 1 and 5, with a stepValue() of 1, and an initial default value() of 2:

    -
     Form mainForm(lcd);
    - IntField iterField(mainForm, "Iterations", 1, 5, 1, 2);
    -

    IntField can be configured to show a suffix() on the screen after the integer value(). This is intended for communicating the units in which the value is expressed. For example:

    -
     IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
    - IntField speedField(mainForm, "Speed", 0, 2000, 15, 450, " rpm");
    -
    +
    Form mainForm(lcd);
    +
    IntField iterField(mainForm, "Iterations", 1, 5, 1, 2);
    +

    IntField can be configured to show a suffix() on the screen after the integer value(). This is intended for communicating the units in which the value is expressed. For example:

    +
    IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
    +
    IntField speedField(mainForm, "Speed", 0, 2000, 15, 450, " rpm");
    +
    FormInt.png

    Use TextField for read-only fields that report integer values but which are not modifiable by the user.

    -
    See also:
    Field, TextField
    +
    See Also
    Field, TextField

    Definition at line 28 of file IntField.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    IntField::IntField ( const String &  label) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new integer field with a specific label.

    The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

    Initially, value() is 0, minValue() is 0, maxValue() is 100, stepValue() is 1, and suffix() is an empty string.

    -
    See also:
    Form::addField()
    +
    See Also
    Form::addField()

    Definition at line 71 of file IntField.cpp.

    - +
    @@ -204,8 +260,7 @@ Public Member Functions
    -
    -
    +

    Constructs a new integer field with a specific label, minValue, maxValue, stepValue, and value, and attaches it to a form.

    The suffix() is initially set to an empty string.

    @@ -214,28 +269,35 @@ Public Member Functions
    + + + + +
    - +
    int IntField::dispatch ( int  event) [virtual]
    - -
    +
    +virtual
    +

    Dispatches event via this field.

    The event is usually obtained from LCD::getButton().

    Returns zero if the event has been handled and no further action is required.

    Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

    Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

    -
    See also:
    Form::dispatch(), LCD::getButton()
    +
    See Also
    Form::dispatch(), LCD::getButton()

    Reimplemented from Field.

    @@ -243,26 +305,33 @@ Public Member Functions
    + + + + +
    - +
    void IntField::enterField ( bool  reverse) [virtual]
    - -
    +
    +virtual
    +

    Enters the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

    This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

    The default implementation prints the label().

    -
    See also:
    exitField()
    +
    See Also
    exitField()

    Reimplemented from Field.

    @@ -270,117 +339,152 @@ Public Member Functions
    + + + + +
    - +
    int IntField::maxValue ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the maximum value for the input field.

    -
    See also:
    setMaxValue(), minValue(), stepValue(), value()
    +
    See Also
    setMaxValue(), minValue(), stepValue(), value()

    Definition at line 41 of file IntField.h.

    - +
    + + + + + +
    - +
    int IntField::minValue ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the minimum value for the input field.

    -
    See also:
    setMinValue(), maxValue(), stepValue(), value()
    +
    See Also
    setMinValue(), maxValue(), stepValue(), value()

    Definition at line 38 of file IntField.h.

    - +
    + + + + + +
    - +
    void IntField::setMaxValue ( int  value) [inline]
    - -
    +
    +inline
    +

    Sets the maximum value for the input field.

    The new maximum value will be used to clamp the field's value the next time setValue() is called.

    -
    See also:
    maxValue(), setMinValue(), setStepValue(), setValue()
    +
    See Also
    maxValue(), setMinValue(), setStepValue(), setValue()

    Definition at line 42 of file IntField.h.

    - +
    + + + + + +
    - +
    void IntField::setMinValue ( int  value) [inline]
    - -
    +
    +inline
    +

    Sets the minimum value for the input field.

    The new minimum value will be used to clamp the field's value the next time setValue() is called.

    -
    See also:
    minValue(), setMaxValue(), setStepValue(), setValue()
    +
    See Also
    minValue(), setMaxValue(), setStepValue(), setValue()

    Definition at line 39 of file IntField.h.

    - +
    + + + + + +
    - +
    void IntField::setStepValue ( int  value) [inline]
    - -
    +
    +inline
    +

    Sets the step value value to use when increasing or decreasing the value() due to Up and Down button presses.

    -
    See also:
    stepValue(), setMinValue(), setMaxValue(), setValue()
    +
    See Also
    stepValue(), setMinValue(), setMaxValue(), setValue()

    Definition at line 45 of file IntField.h.

    - +
    @@ -392,20 +496,19 @@ Public Member Functions
    -
    -
    +

    Sets the suffix string to be displayed after the field's value.

    Suffixes are typically used to indicate the units that the value() is expressed in. For example:

    -
     field.setSuffix("%");
    - field.setSuffix(" rpm");
    -
    See also:
    suffix()
    +
    field.setSuffix("%");
    +
    field.setSuffix(" rpm");
    +
    See Also
    suffix()

    Definition at line 231 of file IntField.cpp.

    - +
    @@ -417,75 +520,95 @@ Public Member Functions
    -
    -
    +

    Sets the current value of this field.

    The value will be clamped to the range defined by minValue() and maxValue().

    -
    See also:
    value(), setMinValue(), setMaxValue(), setStepValue()
    +
    See Also
    value(), setMinValue(), setMaxValue(), setStepValue()

    Definition at line 198 of file IntField.cpp.

    - +
    + + + + + +
    - +
    int IntField::stepValue ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the step value to use when increasing or decreasing the value() due to Up and Down button presses.

    -
    See also:
    setStepValue(), minValue(), maxValue(), value()
    +
    See Also
    setStepValue(), minValue(), maxValue(), value()

    Definition at line 44 of file IntField.h.

    - +
    + + + + + +
    - +
    const String & IntField::suffix ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the suffix string to be displayed after the field's value.

    -
    See also:
    setSuffix()
    +
    See Also
    setSuffix()

    Definition at line 50 of file IntField.h.

    - +
    + + + + + +
    - +
    int IntField::value ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the current value of this field.

    -
    See also:
    setValue(), minValue(), maxValue(), stepValue()
    +
    See Also
    setValue(), minValue(), maxValue(), stepValue()

    Definition at line 47 of file IntField.h.

    @@ -495,23 +618,12 @@ Public Member Functions
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    LCD Member List
    -
    -
    -This is the complete list of members for LCD, including all inherited members. - - - - - - - - - - - - - - - - -
    BacklightOff enum valueLCD
    BacklightOnSelect enum valueLCD
    backlightPin() const LCD [inline]
    disableScreenSaver()LCD
    display()LCD
    DisplayOff enum valueLCD
    enableScreenSaver(int timeoutSecs=10)LCD
    getButton()LCD
    isScreenSaved() const LCD [inline]
    LCD()LCD [inline]
    LCD(uint8_t pin9)LCD [inline]
    noDisplay()LCD
    ScreenSaverMode enum nameLCD
    screenSaverMode() const LCD [inline]
    setBacklightPin(uint8_t pin)LCD
    setScreenSaverMode(ScreenSaverMode mode)LCD
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -96,8 +80,37 @@ This is the complete list of members for LCD<
    - + +
    +
    +
    LCD Member List
    +
    +
    + +

    This is the complete list of members for LCD, including all inherited members.

    + + + + + + + + + + + + + + + + + +
    BacklightOff enum valueLCD
    BacklightOnSelect enum valueLCD
    backlightPin() const LCDinline
    disableScreenSaver()LCD
    display()LCD
    DisplayOff enum valueLCD
    enableScreenSaver(int timeoutSecs=10)LCD
    getButton()LCD
    isScreenSaved() const LCDinline
    LCD()LCDinline
    LCD(uint8_t pin9)LCDinline
    noDisplay()LCD
    ScreenSaverMode enum nameLCD
    screenSaverMode() const LCDinline
    setBacklightPin(uint8_t pin)LCD
    setScreenSaverMode(ScreenSaverMode mode)LCD
    + + diff --git a/classLCD.html b/classLCD.html index 39ae719b..551bb1cf 100644 --- a/classLCD.html +++ b/classLCD.html @@ -2,29 +2,37 @@ + ArduinoLibs: LCD Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    LCD Class Reference
    -
    +
    - +

    Enhanced library for Freetronics 16x2 LCD shields. More...

    #include <LCD.h>

    - -

    List of all members.

    - - - - +

    +

    Public Types

    enum  ScreenSaverMode { DisplayOff, +
    enum  ScreenSaverMode { DisplayOff, BacklightOff, BacklightOnSelect }
     Screen saver mode that controls the display and back light. More...

    +

     Screen saver mode that controls the display and back light. More...
    + - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +

    Public Member Functions

     LCD ()
     Initialize the Freetronics LCD display with the default pin assignment.
     LCD (uint8_t pin9)
     Initialize the Freetronics LCD display for USBDroid.
    uint8_t backlightPin () const
     Returns the pin that is being used to control the back light. The default is 3.
    void setBacklightPin (uint8_t pin)
     Sets the back light pin for the LCD shield.
    void display ()
     Turns on the display of text on the LCD and the back light.
    void noDisplay ()
     Turns off the display of text on the LCD and the back light.
    ScreenSaverMode screenSaverMode () const
     Returns the current screen saver mode; default is DisplayOff.
    void setScreenSaverMode (ScreenSaverMode mode)
     Sets the current screen saver mode.
    void enableScreenSaver (int timeoutSecs=10)
     Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons.
    void disableScreenSaver ()
     Disables the screen saver.
    bool isScreenSaved () const
     Returns true if the screen has been saved; false otherwise.
    int getButton ()
     Gets the next button press, release, or idle event.
     LCD ()
     Initialize the Freetronics LCD display with the default pin assignment.
     LCD (uint8_t pin9)
     Initialize the Freetronics LCD display for USBDroid.
    uint8_t backlightPin () const
     Returns the pin that is being used to control the back light. The default is 3.
    void setBacklightPin (uint8_t pin)
     Sets the back light pin for the LCD shield.
    void display ()
     Turns on the display of text on the LCD and the back light.
    void noDisplay ()
     Turns off the display of text on the LCD and the back light.
    ScreenSaverMode screenSaverMode () const
     Returns the current screen saver mode; default is DisplayOff.
    void setScreenSaverMode (ScreenSaverMode mode)
     Sets the current screen saver mode.
    void enableScreenSaver (int timeoutSecs=10)
     Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons.
    void disableScreenSaver ()
     Disables the screen saver.
    bool isScreenSaved () const
     Returns true if the screen has been saved; false otherwise.
    int getButton ()
     Gets the next button press, release, or idle event.
    -

    Detailed Description

    +

    Detailed Description

    Enhanced library for Freetronics 16x2 LCD shields.

    This class extends the standard Arduino LiquidCrystal library with extra functionality for the Freetronics 16x2 LCD shield:

    http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide

    @@ -129,20 +151,20 @@ Public Member Functions
    @@ -150,18 +172,17 @@ Support for DFRobot LCD Shield
    enum LCD::ScreenSaverMode
    -
    -
    +

    Screen saver mode that controls the display and back light.

    Enumerator:
    - - -
    DisplayOff  +
    DisplayOff 

    Turn off both the display and the backlight when the screen saver is activated.

    BacklightOff  +
    BacklightOff 

    Turn off the back light but leave the display on when the screen saver is activated.

    BacklightOnSelect  +
    BacklightOnSelect 

    Same as BacklightOff but the screen saver is only deactivated when Select is pressed; other buttons have no effect.

    @@ -172,76 +193,97 @@ Support for DFRobot LCD Shield
    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    LCD::LCD ( ) [inline]
    - -
    +
    +inline
    +

    Initialize the Freetronics LCD display with the default pin assignment.

    The following example shows how to initialize the Freetronics LCD shield:

    -
     LCD lcd;
    -
    +
    LCD lcd;
    +

    Definition at line 50 of file LCD.h.

    - +
    + + + + + +
    - +
    LCD::LCD ( uint8_t  pin9) [inline]
    - -
    +
    +inline
    +

    Initialize the Freetronics LCD display for USBDroid.

    On the USBDroid, the D9 pin is used for USB Host functionality. Either the USB Host's use of D9 must be reassigned to another pin, or the Freetronics LCD shield must be modified. The following Web page describes the modifications that are necessary: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid

    If you choose to modify the LCD shield, then you must use this version of the constructor to initialize the shield, passing the alternative pin as the pin9 parameter. Using the recommended pin from the above Web page of A1, you would initialize the LCD as follows:

    -
     LCD lcd(A1);
    -
    +
    LCD lcd(A1);
    +

    Definition at line 51 of file LCD.h.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    uint8_t LCD::backlightPin ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the pin that is being used to control the back light. The default is 3.

    -
    See also:
    setBacklightPin()
    +
    See Also
    setBacklightPin()

    Definition at line 53 of file LCD.h.

    - +
    @@ -252,17 +294,16 @@ Support for DFRobot LCD Shield
    -
    -
    +

    Disables the screen saver.

    -
    See also:
    enableScreenSaver(), display(), isScreenSaved()
    +
    See Also
    enableScreenSaver(), display(), isScreenSaved()

    Definition at line 308 of file LCD.cpp.

    - +
    @@ -273,18 +314,17 @@ Support for DFRobot LCD Shield
    -
    -
    +

    Turns on the display of text on the LCD and the back light.

    If the screen saver is active, then calling this function will deactivate the screen saver and reset the timeout. Thus, this function can be called for force the screen to restore.

    -
    See also:
    noDisplay(), enableScreenSaver(), setScreenSaverMode()
    +
    See Also
    noDisplay(), enableScreenSaver(), setScreenSaverMode()

    Definition at line 206 of file LCD.cpp.

    - +
    @@ -296,20 +336,19 @@ Support for DFRobot LCD Shield
    -
    -
    +

    Enables the screen saver and causes it to activate after timeoutSecs of inactivity on the buttons.

    If timeoutSecs is less than or equal to zero, then the call is equivalent to calling disableScreenSaver().

    -

    For the screen saver to work, the application must regularly call getButton() to fetch the LCD's button state even if no buttons are pressed.

    +

    For the screen saver to work, the application must regularly call getButton() to fetch the LCD's button state even if no buttons are pressed.

    If the timeoutSecs parameter is not supplied, the default is 10 seconds.

    -
    See also:
    disableScreenSaver(), display(), getButton(), isScreenSaved()
    +
    See Also
    disableScreenSaver(), display(), getButton(), isScreenSaved()

    Definition at line 294 of file LCD.cpp.

    - +
    @@ -320,42 +359,48 @@ Support for DFRobot LCD Shield
    -
    -
    +

    Gets the next button press, release, or idle event.

    If no buttons are pressed, this function will return LCD_BUTTON_NONE.

    When a button is pressed, this function will return one of LCD_BUTTON_LEFT, LCD_BUTTON_RIGHT, LCD_BUTTON_UP, LCD_BUTTON_DOWN, or LCD_BUTTON_SELECT. While the button is pressed, this function will return LCD_BUTTON_NONE until the button is released. When the button is released, this function will return one of LCD_BUTTON_LEFT_RELEASED, LCD_BUTTON_RIGHT_RELEASED, LCD_BUTTON_UP_RELEAED, LCD_BUTTON_DOWN_RELEASED, or LCD_BUTTON_SELECT_RELEASED.

    If the screen saver is currently active, then it will be deactivated by this function whenever a button is pressed. If screenSaverMode() is DisplayOff, the function will "eat" the button press and return LCD_BUTTON_NONE. The scrren saver can also be deactivated under program control by calling display().

    This function debounces the button state automatically so there is no need for the caller to worry about spurious button events.

    -
    See also:
    enableScreenSaver(), display(), Form::dispatch()
    +
    See Also
    enableScreenSaver(), display(), Form::dispatch()

    Definition at line 353 of file LCD.cpp.

    - +
    + + + + + +
    - +
    bool LCD::isScreenSaved ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns true if the screen has been saved; false otherwise.

    -
    See also:
    enableScreenSaver()
    +
    See Also
    enableScreenSaver()

    Definition at line 71 of file LCD.h.

    - +
    @@ -366,39 +411,45 @@ Support for DFRobot LCD Shield
    -
    -
    +

    Turns off the display of text on the LCD and the back light.

    This function can be called to force the screen saver to activate.

    -
    See also:
    display(), enableScreenSaver(), setScreenSaverMode()
    +
    See Also
    display(), enableScreenSaver(), setScreenSaverMode()

    Definition at line 223 of file LCD.cpp.

    - +
    + + + + + +
    - +
    ScreenSaverMode LCD::screenSaverMode ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the current screen saver mode; default is DisplayOff.

    -
    See also:
    setScreenSaverMode(), enableScreenSaver()
    +
    See Also
    setScreenSaverMode(), enableScreenSaver()

    Definition at line 66 of file LCD.h.

    - +
    @@ -410,24 +461,23 @@ Support for DFRobot LCD Shield
    -
    -
    +

    Sets the back light pin for the LCD shield.

    The DFRobot LCD Shield uses pin 10 for the back light instead of pin 3:

    -
     LCD lcd;
    -
    - void setup() {
    -     lcd.setBacklightPin(10);
    - }
    -

    The back light pin is configured for output the next time the application calls getButton().

    -
    See also:
    backlightPin()
    +
    LCD lcd;
    +
    +
    void setup() {
    +
    lcd.setBacklightPin(10);
    +
    }
    +

    The back light pin is configured for output the next time the application calls getButton().

    +
    See Also
    backlightPin()

    Definition at line 182 of file LCD.cpp.

    - +
    @@ -439,11 +489,10 @@ Support for DFRobot LCD Shield
    -
    -
    +

    Sets the current screen saver mode.

    -
    See also:
    screenSaverMode(), enableScreenSaver()
    +
    See Also
    screenSaverMode(), enableScreenSaver()

    Definition at line 268 of file LCD.cpp.

    @@ -453,23 +502,12 @@ Support for DFRobot LCD Shield
  • LCD.h
  • LCD.cpp
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/classListField-members.html b/classListField-members.html index 6c79aedd..ad7fb560 100644 --- a/classListField-members.html +++ b/classListField-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    ListField Member List
    -
    -
    -This is the complete list of members for ListField, including all inherited members. - - - - - - - - - - - - - - - - - - -
    dispatch(int event)ListField [virtual]
    enterField(bool reverse)ListField [virtual]
    exitField()Field [virtual]
    Field(const String &label)Field [explicit]
    Field(Form &form, const String &label)Field
    form() const Field [inline]
    isCurrent() const Field
    items() const ListField [inline]
    label() const Field [inline]
    lcd() const Field [inline, protected]
    ListField(const String &label)ListField [explicit]
    ListField(Form &form, const String &label, ListItems items, int value=0)ListField
    setItems(ListItems items)ListField
    setLabel(const String &label)Field
    setValue(int value)ListField
    updateCursor()Field [protected, virtual]
    value() const ListField [inline]
    ~Field()Field
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -98,8 +80,39 @@ This is the complete list of members for +
    +
    +
    +
    ListField Member List
    +
    +
    + +

    This is the complete list of members for ListField, including all inherited members.

    + + + + + + + + + + + + + + + + + + + +
    dispatch(int event)ListFieldvirtual
    enterField(bool reverse)ListFieldvirtual
    exitField()Fieldvirtual
    Field(const String &label)Fieldexplicit
    Field(Form &form, const String &label)Field
    form() const Fieldinline
    isCurrent() const Field
    items() const ListFieldinline
    label() const Fieldinline
    lcd() const Fieldinlineprotected
    ListField(const String &label)ListFieldexplicit
    ListField(Form &form, const String &label, ListItems items, int value=0)ListField
    setItems(ListItems items)ListField
    setLabel(const String &label)Field
    setValue(int value)ListField
    updateCursor()Fieldprotectedvirtual
    value() const ListFieldinline
    ~Field()Field
    + + diff --git a/classListField.html b/classListField.html index 73813e34..60af0a2a 100644 --- a/classListField.html +++ b/classListField.html @@ -2,29 +2,37 @@ + ArduinoLibs: ListField Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    ListField Class Reference
    -
    +
    - +

    Field that manages selection from a static list of items. More...

    @@ -80,95 +103,135 @@ Inheritance diagram for ListField:
    Field - -

    List of all members.

    - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     ListField (const String &label)
     Constructs a new list field with a specific label.
    ListField (Form &form, const String &label, ListItems items, int value=0)
     Constructs a new list field with a specific label, list of items, and value, and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    ListItems items () const
     Returns the array of items in this list.
    void setItems (ListItems items)
     Sets the array of items for this list.
    int value () const
     Returns the value of this list; i.e. the index within items() of the selected item.
    void setValue (int value)
     Sets the value of this list; i.e. the index within items() of the selected item.
     ListField (const String &label)
     Constructs a new list field with a specific label.
    ListField (Form &form, const String &label, ListItems items, int value=0)
     Constructs a new list field with a specific label, list of items, and value, and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    ListItems items () const
     Returns the array of items in this list.
    void setItems (ListItems items)
     Sets the array of items for this list.
    int value () const
     Returns the value of this list; i.e. the index within items() of the selected item.
    void setValue (int value)
     Sets the value of this list; i.e. the index within items() of the selected item.
    - Public Member Functions inherited from Field
     Field (const String &label)
     Constructs a new field with a specific label.
    Field (Form &form, const String &label)
     Constructs a new field with a specific label and attaches it to a form.
     ~Field ()
     Destroys this field and removes it from its owning Form.
    +Formform () const
     Returns the Form that owns this field; null if not associated with a Form.
    virtual void exitField ()
     Exits the field due to form navigation.
    const String & label () const
     Returns the label to display in the first line of this field.
    void setLabel (const String &label)
     Sets the label to display in the first line of this field.
    bool isCurrent () const
     Returns true if this field is the currently-displayed field in its owning form; false otherwise.
    + + + + + +

    +Additional Inherited Members

    - Protected Member Functions inherited from Field
    +LiquidCrystal * lcd () const
     Returns the LCD that this field is being drawn on.
    virtual void updateCursor ()
     Updates the cursor position after the label has been drawn by setLabel().
    -

    Detailed Description

    +

    Detailed Description

    Field that manages selection from a static list of items.

    ListField is intended for selecting an element from a list of items. Each items is represented by a string within program memory, with the list terminated by null. For example:

    -
     const char item_Eggs[] PROGMEM = "Eggs";
    - const char item_Cheese[] PROGMEM = "Cheese";
    - const char item_Pumpkin[] PROGMEM = "Pumpkin";
    - ListItem const ingredients[] PROGMEM = {
    -    item_Eggs,
    -    item_Cheese,
    -    item_Pumpkin,
    -    0
    - };
    -
    - Form mainForm(lcd);
    - ListField ingredient(mainForm, "Select ingredient", ingredients);
    -

    If there are only two items in the list, then BoolField can be used instead.

    -
    See also:
    Field, BoolField
    +
    const char item_Eggs[] PROGMEM = "Eggs";
    +
    const char item_Cheese[] PROGMEM = "Cheese";
    +
    const char item_Pumpkin[] PROGMEM = "Pumpkin";
    +
    ListItem const ingredients[] PROGMEM = {
    +
    item_Eggs,
    +
    item_Cheese,
    +
    item_Pumpkin,
    +
    0
    +
    };
    +
    +
    Form mainForm(lcd);
    +
    ListField ingredient(mainForm, "Select ingredient", ingredients);
    +

    If there are only two items in the list, then BoolField can be used instead.

    +
    See Also
    Field, BoolField

    Definition at line 32 of file ListField.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    ListField::ListField ( const String &  label) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new list field with a specific label.

    The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

    Initially, items() is null and value() is -1.

    -
    See also:
    Form::addField()
    +
    See Also
    Form::addField()

    Definition at line 64 of file ListField.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int ListField::dispatch ( int  event) [virtual]
    - -
    +
    +virtual
    +

    Dispatches event via this field.

    The event is usually obtained from LCD::getButton().

    Returns zero if the event has been handled and no further action is required.

    Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

    Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

    -
    See also:
    Form::dispatch(), LCD::getButton()
    +
    See Also
    Form::dispatch(), LCD::getButton()

    Reimplemented from Field.

    @@ -176,26 +239,33 @@ Public Member Functions
    + + + + +
    - +
    void ListField::enterField ( bool  reverse) [virtual]
    - -
    +
    +virtual
    +

    Enters the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

    This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

    The default implementation prints the label().

    -
    See also:
    exitField()
    +
    See Also
    exitField()

    Reimplemented from Field.

    @@ -203,28 +273,35 @@ Public Member Functions
    + + + + +
    - +
    ListItems ListField::items ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the array of items in this list.

    -
    See also:
    setItems()
    +
    See Also
    setItems()

    Definition at line 41 of file ListField.h.

    - +
    @@ -236,29 +313,28 @@ Public Member Functions
    -
    -
    +

    Sets the array of items for this list.

    The items must be stored within program memory and terminated by null; for example:

    -
     const char item_Eggs[] PROGMEM = "Eggs";
    - const char item_Cheese[] PROGMEM = "Cheese";
    - const char item_Pumpkin[] PROGMEM = "Pumpkin";
    - ListItem const ingredients[] PROGMEM = {
    -    item_Eggs,
    -    item_Cheese,
    -    item_Pumpkin,
    -    0
    - };
    -
    - list.setItems(ingredients);
    -
    See also:
    items()
    +
    const char item_Eggs[] PROGMEM = "Eggs";
    +
    const char item_Cheese[] PROGMEM = "Cheese";
    +
    const char item_Pumpkin[] PROGMEM = "Pumpkin";
    +
    ListItem const ingredients[] PROGMEM = {
    +
    item_Eggs,
    +
    item_Cheese,
    +
    item_Pumpkin,
    +
    0
    +
    };
    +
    +
    list.setItems(ingredients);
    +
    See Also
    items()

    Definition at line 141 of file ListField.cpp.

    - +
    @@ -270,34 +346,40 @@ Public Member Functions
    -
    -
    +

    Sets the value of this list; i.e. the index within items() of the selected item.

    The value will be clamped to the range of items().

    -
    See also:
    value(), items()
    +
    See Also
    value(), items()

    Definition at line 178 of file ListField.cpp.

    - +
    + + + + + +
    - +
    int ListField::value ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the value of this list; i.e. the index within items() of the selected item.

    Returns -1 if the items() array is empty or null.

    -
    See also:
    setValue(), items()
    +
    See Also
    setValue(), items()

    Definition at line 44 of file ListField.h.

    @@ -307,23 +389,12 @@ Public Member Functions
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Melody Member List
    -
    -
    -This is the complete list of members for Melody, including all inherited members. - - - - - - - - - - -
    isPlaying() const Melody [inline]
    loopCount() const Melody [inline]
    Melody(uint8_t pin)Melody
    play()Melody
    playOnce()Melody
    run()Melody
    setLoopCount(int count)Melody [inline]
    setLoopDuration(unsigned long ms)Melody
    setMelody(const int *notes, const uint8_t *lengths, unsigned int size)Melody
    stop()Melody
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -90,8 +80,31 @@ This is the complete list of members for M
    - + +
    +
    +
    Melody Member List
    +
    +
    + +

    This is the complete list of members for Melody, including all inherited members.

    + + + + + + + + + + + +
    isPlaying() const Melodyinline
    loopCount() const Melodyinline
    Melody(uint8_t pin)Melody
    play()Melody
    playOnce()Melody
    run()Melody
    setLoopCount(int count)Melodyinline
    setLoopDuration(unsigned long ms)Melody
    setMelody(const int *notes, const uint8_t *lengths, unsigned int size)Melody
    stop()Melody
    + + diff --git a/classMelody.html b/classMelody.html index 16c25d8c..20032369 100644 --- a/classMelody.html +++ b/classMelody.html @@ -2,29 +2,37 @@ + ArduinoLibs: Melody Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    Melody Class Reference
    -
    +
    - +

    Plays a melody on a digital output pin using tone(). More...

    #include <Melody.h>

    - -

    List of all members.

    - - - - + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

    +
     Melody (uint8_t pin)
     Constructs a new melody playing object for pin.
    +
     Constructs a new melody playing object for pin.
    bool isPlaying () const
     Returns true if the melody is currently playing; false if not.
    int loopCount () const
     Returns the number of times the melody should loop before stopping.
    void setLoopCount (int count)
     Sets the number of times the melody should loop to count.
    void setLoopDuration (unsigned long ms)
     Sets the maximum number of loops to last no longer than ms milliseconds.
    void play ()
     Starts playing the melody, or restarts it if already playing.
    void playOnce ()
     Plays the melody once and then stops.
    void stop ()
     Stops playing the melody.
    void setMelody (const int *notes, const uint8_t *lengths, unsigned int size)
     Sets the melody to the size elements of notes and lengths.
    void run ()
     Runs the melody control loop.
     Returns true if the melody is currently playing; false if not.
    int loopCount () const
     Returns the number of times the melody should loop before stopping.
    void setLoopCount (int count)
     Sets the number of times the melody should loop to count.
    void setLoopDuration (unsigned long ms)
     Sets the maximum number of loops to last no longer than ms milliseconds.
    void play ()
     Starts playing the melody, or restarts it if already playing.
    void playOnce ()
     Plays the melody once and then stops.
    void stop ()
     Stops playing the melody.
    void setMelody (const int *notes, const uint8_t *lengths, unsigned int size)
     Sets the melody to the size elements of notes and lengths.
    void run ()
     Runs the melody control loop.
    -

    Detailed Description

    +

    Detailed Description

    Plays a melody on a digital output pin using tone().

    The following example plays a simple tone three times on digital pin 8:

    -
     #include <Melody.h>
    -
    - int notes[] = {
    -     NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3,
    -     NOTE_REST, NOTE_B3, NOTE_C4, NOTE_REST
    - };
    - byte lengths[] = {4, 8, 8, 4, 4, 4, 4, 4, 2};
    -
    - Melody melody(8);
    -
    - void setup() {
    -     melody.setMelody(notes, lengths, sizeof(lengths));
    -     melody.setLoopCount(3);
    -     melody.play();
    - }
    -
    - void loop() {
    -     melody.run();
    - }
    -

    The notes array contains the frequency of the notes to be played, with the special value NOTE_REST indicating a rest where no notes are playing. The lengths array contains the lengths of each of the notes; a value of 4 indicates a quarter note, a value of 8 indicates an eighth note, etc.

    +
    #include <Melody.h>
    +
    +
    int notes[] = {
    +
    NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3,
    +
    NOTE_REST, NOTE_B3, NOTE_C4, NOTE_REST
    +
    };
    +
    byte lengths[] = {4, 8, 8, 4, 4, 4, 4, 4, 2};
    +
    +
    Melody melody(8);
    +
    +
    void setup() {
    +
    melody.setMelody(notes, lengths, sizeof(lengths));
    +
    melody.setLoopCount(3);
    +
    melody.play();
    +
    }
    +
    +
    void loop() {
    +
    melody.run();
    +
    }
    +

    The notes array contains the frequency of the notes to be played, with the special value NOTE_REST indicating a rest where no notes are playing. The lengths array contains the lengths of each of the notes; a value of 4 indicates a quarter note, a value of 8 indicates an eighth note, etc.

    The run() method must be called from the application's main loop() method to ensure that the melody advances from one note to the next. It will not block the application while notes are playing.

    The number of loops can also be specified with setLoopDuration() which sets a maximum amount of time that the melody will play before stopping. The following example plays the melody for no more than 60 seconds:

    -
     void setup() {
    -     melody.setMelody(notes, lengths, sizeof(lengths));
    -     melody.setLoopDuration(60000UL);
    -     melody.play();
    - }
    -
    +
    void setup() {
    +
    melody.setMelody(notes, lengths, sizeof(lengths));
    +
    melody.setLoopDuration(60000UL);
    +
    melody.play();
    +
    }
    +

    Definition at line 122 of file Melody.h.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int Melody::loopCount ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the number of times the melody should loop before stopping.

    The default value is zero, indicating that the melody will loop indefinitely.

    -
    See also:
    setLoopCount(), setLoopDuration(), play()
    +
    See Also
    setLoopCount(), setLoopDuration(), play()

    Definition at line 128 of file Melody.h.

    - +
    @@ -165,17 +193,16 @@ bool 
  • TimeField.h
  • TimeField.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classTimeField.png b/classTimeField.png index 17eccb137d2995bc780b4a94e0de094c696c48d0..58edd40f5a3d9e5f8e123fb21ec66908bc44015e 100644 GIT binary patch delta 257 zcmV+c0sj8A0@VVLTz}+AL_t(|0qvauj>8}f1lMaR|9|qOgqpZqxCFOSm2<=hWXRZ< z4?tBl29zWtq~b4yly99|#7!jII8czJV_NZ;OF4Blr>OteaY3=QqEk#(VU3+vyk3bU z9iQt({6$FeG^x0!LRB>c0E}4xAVyrVEMZ4nu^OU|Hz>a3MS4<^3IOOxMJfQ`l~nvo zg@{ND2mnM#MXwk%x9;q=>dGeDIVz`*j};}`Gi6C`2g=$at>WJlYs@se3%JO3?zoCJ zwxgEYDTWuZG_H*)Kb|3A402}-TH%C_lYh>3P!pE$i@c`maZiEOTh#-OpB4&YbBt*L;qFP5x%+*Yj(v?k?8MV{v za|Bc>KY#`Sr__!=A)tA!ZV*)|b>lATD5bWyLrf21+c+DYau?z4bjk)I=*9kx@RW=2+00000NkvXXu0mjfbm?H^ diff --git a/classes.html b/classes.html index 242b4853..9d4430fe 100644 --- a/classes.html +++ b/classes.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Index + + - + + - - - -
    + +
    + - +
    @@ -186,17 +213,16 @@ bool  - +
    +
    + - +
    @@ -207,8 +233,7 @@ bool  - +
    +
    +

    Runs the melody control loop.

    This function must be called by the application's main loop() function to cause the melody to advance from note to note. It will not block the application while notes are playing.

    @@ -217,30 +242,37 @@ bool 
    +
    + + + + + +
    - +
    void Melody::setLoopCount ( int  count) [inline]
    - -
    +
    +inline
    +

    Sets the number of times the melody should loop to count.

    If count is zero, then the melody will loop indefinitely.

    -
    See also:
    loopCount(), setLoopDuration()
    +
    See Also
    loopCount(), setLoopDuration()

    Definition at line 129 of file Melody.h.

    - +
    @@ -252,18 +284,17 @@ bool  - +
    +
    + - +
    @@ -291,19 +322,18 @@ bool 
  • TextField.h
  • TextField.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classTextField.png b/classTextField.png index afbf812d4e3352663fff546d6e9b949d102d3e40..837289a6154f1d319ee57230ad6eed973882ec67 100644 GIT binary patch delta 258 zcmV+d0sa290@ebMTz}f?R`M$^k8jU?WlC>(RnoQ_ zADq9c>QyEG^}LyxUjVPP0R$A}w=H%-kl*pp1yTOb=bt=4Kzqpp_?0|>U&#ab_3wER zk$?~Yw~{Y>n|Jj!NPOXk~?5sv6?jqk`oBrKLj8^*kYrgEa{(s<4 z-*4v!XdLBRezd##pPZcgucf2^asI=Yugo9dV8Xw-iyIRF3v07*qo IM6N<$g8UzarvLx| delta 225 zcmV<703QF=0<{8=Tz|w#L_t(|0qvdP3d0}_ggpy+|3}^rqsBU?_1Fq)g3yro)yoz8 zI~-huBQoK9&jSDuBWk62O!-meB9Ek{WE;G~x>or#e#h^eU!2_J&y)OQe$s!xe~;qH z|Mw(hw&Ams)_8}YisE-R(hKl7=d=YPWw&(He}WUZX?R&KAqQ8L!A>Bjule`E8C|9=0T b$#d}nA@&Yv{%m?v00000NkvXXu0mjf&@Fr{ diff --git a/classTimeField-members.html b/classTimeField-members.html index 52a98f66..a6b9df70 100644 --- a/classTimeField-members.html +++ b/classTimeField-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    + - +
    @@ -314,11 +344,10 @@ bool  - +
    +

    Stops playing the melody.

    -
    See also:
    play()
    +
    See Also
    play()

    Definition at line 178 of file Melody.cpp.

    @@ -328,23 +357,12 @@ bool 
    Melody.h
  • Melody.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classRTC-members.html b/classRTC-members.html index e1504bd6..46df0a88 100644 --- a/classRTC-members.html +++ b/classRTC-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    RTC Member List
    -
    -
    -This is the complete list of members for RTC, including all inherited members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    adjustDays(RTCDate *date, uint8_t flags)RTC [static]
    adjustMonths(RTCDate *date, uint8_t flags)RTC [static]
    adjustYears(RTCDate *date, uint8_t flags)RTC [static]
    ALARM_COUNTRTC [static]
    byteCount() const RTC [virtual]
    dayOfWeek(const RTCDate *date)RTC [static]
    DayOfWeek enum nameRTC
    DECREMENTRTC [static]
    Friday enum value (defined in RTC)RTC
    hasUpdates()RTC [virtual]
    INCREMENTRTC [static]
    Monday enum value (defined in RTC)RTC
    NO_TEMPERATURERTC [static]
    readAlarm(uint8_t alarmNum, RTCAlarm *value)RTC [virtual]
    readByte(uint8_t offset)RTC [virtual]
    readDate(RTCDate *value)RTC [virtual]
    readTemperature()RTC [virtual]
    readTime(RTCTime *value)RTC [virtual]
    RTC()RTC
    Saturday enum value (defined in RTC)RTC
    Sunday enum value (defined in RTC)RTC
    Thursday enum value (defined in RTC)RTC
    Tuesday enum value (defined in RTC)RTC
    Wednesday enum value (defined in RTC)RTC
    WRAPRTC [static]
    writeAlarm(uint8_t alarmNum, const RTCAlarm *value)RTC [virtual]
    writeByte(uint8_t offset, uint8_t value)RTC [virtual]
    writeDate(const RTCDate *value)RTC [virtual]
    writeTime(const RTCTime *value)RTC [virtual]
    ~RTC() (defined in RTC)RTC
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -110,8 +80,51 @@ This is the complete list of members for RTC<
    - + +
    +
    +
    RTC Member List
    +
    +
    + +

    This is the complete list of members for RTC, including all inherited members.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    adjustDays(RTCDate *date, uint8_t flags)RTCstatic
    adjustMonths(RTCDate *date, uint8_t flags)RTCstatic
    adjustYears(RTCDate *date, uint8_t flags)RTCstatic
    ALARM_COUNTRTCstatic
    byteCount() const RTCvirtual
    dayOfWeek(const RTCDate *date)RTCstatic
    DayOfWeek enum nameRTC
    DECREMENTRTCstatic
    Friday enum value (defined in RTC)RTC
    hasUpdates()RTCvirtual
    INCREMENTRTCstatic
    Monday enum value (defined in RTC)RTC
    NO_TEMPERATURERTCstatic
    readAlarm(uint8_t alarmNum, RTCAlarm *value)RTCvirtual
    readByte(uint8_t offset)RTCvirtual
    readDate(RTCDate *value)RTCvirtual
    readTemperature()RTCvirtual
    readTime(RTCTime *value)RTCvirtual
    RTC()RTC
    Saturday enum value (defined in RTC)RTC
    Sunday enum value (defined in RTC)RTC
    Thursday enum value (defined in RTC)RTC
    Tuesday enum value (defined in RTC)RTC
    Wednesday enum value (defined in RTC)RTC
    WRAPRTCstatic
    writeAlarm(uint8_t alarmNum, const RTCAlarm *value)RTCvirtual
    writeByte(uint8_t offset, uint8_t value)RTCvirtual
    writeDate(const RTCDate *value)RTCvirtual
    writeTime(const RTCTime *value)RTCvirtual
    ~RTC() (defined in RTC)RTC
    + + diff --git a/classRTC.html b/classRTC.html index 892aa04f..904ebbbe 100644 --- a/classRTC.html +++ b/classRTC.html @@ -2,29 +2,37 @@ + ArduinoLibs: RTC Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    RTC Class Reference
    -
    +
    - +

    Base class for realtime clock handlers. More...

    @@ -84,12 +107,10 @@ Inheritance diagram for RTC:
    DS3232RTC - -

    List of all members.

    - -Sunday
    } - - +

    +

    Public Types

    enum  DayOfWeek {
    +
    enum  DayOfWeek {
      Monday = 1, Tuesday, Wednesday, @@ -100,71 +121,74 @@ Public Types
     Day of the week corresponding to a date. More...

    +

     Day of the week corresponding to a date. More...
    + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +

    Public Member Functions

     RTC ()
     Constructs a new realtime clock handler.
    virtual bool hasUpdates ()
     Returns true if the realtime clock has updated since the last call to this function.
    virtual void readTime (RTCTime *value)
     Reads the current time from the realtime clock into value.
    virtual void readDate (RTCDate *value)
     Reads the current date from the realtime clock into value.
    virtual void writeTime (const RTCTime *value)
     Updates the time in the realtime clock to match value.
    virtual void writeDate (const RTCDate *value)
     Updates the date in the realtime clock to match value.
    virtual void readAlarm (uint8_t alarmNum, RTCAlarm *value)
     Reads the details of the alarm with index alarmNum into value.
    virtual void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
     Updates the details of the alarm with index alarmNum from value.
    virtual int byteCount () const
     Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.
    virtual uint8_t readByte (uint8_t offset)
     Reads the byte at offset within the realtime clock's non-volatile memory.
    virtual void writeByte (uint8_t offset, uint8_t value)
     Writes value to offset within the realtime clock's non-volatile memory.
    virtual int readTemperature ()
     Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.

    +

     RTC ()
     Constructs a new realtime clock handler.
    virtual bool hasUpdates ()
     Returns true if the realtime clock has updated since the last call to this function.
    virtual void readTime (RTCTime *value)
     Reads the current time from the realtime clock into value.
    virtual void readDate (RTCDate *value)
     Reads the current date from the realtime clock into value.
    virtual void writeTime (const RTCTime *value)
     Updates the time in the realtime clock to match value.
    virtual void writeDate (const RTCDate *value)
     Updates the date in the realtime clock to match value.
    virtual void readAlarm (uint8_t alarmNum, RTCAlarm *value)
     Reads the details of the alarm with index alarmNum into value.
    virtual void writeAlarm (uint8_t alarmNum, const RTCAlarm *value)
     Updates the details of the alarm with index alarmNum from value.
    virtual int byteCount () const
     Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.
    virtual uint8_t readByte (uint8_t offset)
     Reads the byte at offset within the realtime clock's non-volatile memory.
    virtual void writeByte (uint8_t offset, uint8_t value)
     Writes value to offset within the realtime clock's non-volatile memory.
    virtual int readTemperature ()
     Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.
    + - - - - - - - - - + + + + + + + +

    Static Public Member Functions

    static void adjustDays (RTCDate *date, uint8_t flags)
     Adjusts date up or down one day according to flags.
    static void adjustMonths (RTCDate *date, uint8_t flags)
     Adjusts date up or down one month according to flags.
    static void adjustYears (RTCDate *date, uint8_t flags)
     Adjusts date up or down one year according to flags.
    static DayOfWeek dayOfWeek (const RTCDate *date)
     Returns the day of the week corresponding to date.

    +

    static void adjustDays (RTCDate *date, uint8_t flags)
     Adjusts date up or down one day according to flags.
    static void adjustMonths (RTCDate *date, uint8_t flags)
     Adjusts date up or down one month according to flags.
    static void adjustYears (RTCDate *date, uint8_t flags)
     Adjusts date up or down one year according to flags.
    static DayOfWeek dayOfWeek (const RTCDate *date)
     Returns the day of the week corresponding to date.
    + - - - + - - + - - + - - + - +

    Static Public Attributes

    +
    static const uint8_t ALARM_COUNT = 4
     Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
    +
     Number of alarms that are supported by RTC::readAlarm() and RTC::writeAlarm().
    static const int NO_TEMPERATURE = 32767
     Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
    +
     Value that is returned from readTemperature() if the realtime clock chip cannot determine the temperature.
    static const uint8_t INCREMENT = 0x0000
     Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    +
     Increment the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    static const uint8_t DECREMENT = 0x0001
     Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    +
     Decrement the day, month, or year in a call to adjustDays(), adjustMonths(), or adjustYears().
    static const uint8_t WRAP = 0x0002
     Wrap around to the beginning of the current month/year rather than advance to the next one.
     Wrap around to the beginning of the current month/year rather than advance to the next one.
    -

    Detailed Description

    +

    Detailed Description

    Base class for realtime clock handlers.

    This class simplifies the process of reading and writing the time and date information in a realtime clock chip. The class also provides support for reading and writing information about alarms and other clock settings.

    It is intended that the application will instantiate a subclass of this class to handle the specific realtime clock chip in the system. The default implementation in RTC simulates a clock based on the value of millis(), with alarms and clock settings stored in main memory.

    Because the common DS1307 and DS3232 realtime clock chips use a 2-digit year, this class is also limited to dates between 2000 and 2099 inclusive.

    -
    See also:
    RTCTime, RTCDate, RTCAlarm, DS1307RTC, DS3232RTC
    +
    See Also
    RTCTime, RTCDate, RTCAlarm, DS1307RTC, DS3232RTC

    Definition at line 49 of file RTC.h.

    -

    Member Enumeration Documentation

    - +

    Member Enumeration Documentation

    +
    @@ -172,18 +196,17 @@ static const uint8_t 
    enum RTC::DayOfWeek
    -
    -
    +

    Day of the week corresponding to a date.

    -
    See also:
    dayOfWeek()
    +
    See Also
    dayOfWeek()

    Definition at line 55 of file RTC.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    @@ -194,20 +217,22 @@ static const uint8_t 
    -
    -
    +

    Constructs a new realtime clock handler.

    -
    See also:
    hasUpdates()
    +
    See Also
    hasUpdates()

    Definition at line 105 of file RTC.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    @@ -224,22 +249,29 @@ static const uint8_t  - +
    void RTC::adjustDays ) [static]
    - -
    +
    +static
    +

    Adjusts date up or down one day according to flags.

    -
    See also:
    adjustMonths(), adjustYears()
    +
    See Also
    adjustMonths(), adjustYears()

    Definition at line 313 of file RTC.cpp.

    - +
    + + + + + +
    @@ -256,22 +288,29 @@ static const uint8_t  - +
    void RTC::adjustMonths ) [static]
    - -
    +
    +static
    +

    Adjusts date up or down one month according to flags.

    -
    See also:
    adjustDays(), adjustYears()
    +
    See Also
    adjustDays(), adjustYears()

    Definition at line 343 of file RTC.cpp.

    - +
    + + + + + +
    @@ -288,35 +327,46 @@ static const uint8_t  - +
    void RTC::adjustYears ) [static]
    - -
    +
    +static
    +

    Adjusts date up or down one year according to flags.

    -
    See also:
    adjustDays(), adjustMonths()
    +
    See Also
    adjustDays(), adjustMonths()

    Definition at line 370 of file RTC.cpp.

    - +
    + + + + + +
    - +
    int RTC::byteCount ( ) const [virtual] const
    - -
    +
    +virtual
    +

    Returns the number of bytes of non-volatile memory that can be used for storage of arbitrary settings, excluding storage used by alarms.

    -
    See also:
    readByte(), writeByte()
    +
    See Also
    readByte(), writeByte()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -324,20 +374,27 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    RTC::DayOfWeek RTC::dayOfWeek ( const RTCDate date) [static]
    - -
    +
    +static
    +

    Returns the day of the week corresponding to date.

    This function is only guaranteed to produce meaningful values for years between 2000 and 2099.

    @@ -346,19 +403,26 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    bool RTC::hasUpdates ( ) [virtual]
    - -
    +
    +virtual
    +

    Returns true if the realtime clock has updated since the last call to this function.

    The default implementation returns true, indicating that an update is always available to be read.

    @@ -369,9 +433,12 @@ static const uint8_t 
    - +
    + + + + + +
    @@ -388,16 +455,20 @@ static const uint8_t  - +
    void RTC::readAlarm ) [virtual]
    - -
    +
    +virtual
    +

    Reads the details of the alarm with index alarmNum into value.

    The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

    Alarm details are stored at the end of the realtime clock's non-volatile memory.

    -
    See also:
    writeAlarm(), alarmCount()
    +
    See Also
    writeAlarm(), alarmCount()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -405,24 +476,31 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    uint8_t RTC::readByte ( uint8_t  offset) [virtual]
    - -
    +
    +virtual
    +

    Reads the byte at offset within the realtime clock's non-volatile memory.

    The offset parameter must be between 0 and byteCount() - 1.

    -
    See also:
    writeByte(), byteCount()
    +
    See Also
    writeByte(), byteCount()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -430,24 +508,31 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    void RTC::readDate ( RTCDate value) [virtual]
    - -
    +
    +virtual
    +

    Reads the current date from the realtime clock into value.

    The time should be read first with readTime() as the default implementation only advances the date when the time is read and it crosses midnight.

    -
    See also:
    writeDate(), readTime()
    +
    See Also
    writeDate(), readTime()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -455,19 +540,26 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    int RTC::readTemperature ( ) [virtual]
    - -
    +
    +virtual
    +

    Reads the value of the temperature sensor and returns the temperature in quarters of a degree celcius.

    Returns the value NO_TEMPERATURE if the realtime clock chip cannot determine the temperature.

    @@ -478,23 +570,30 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    void RTC::readTime ( RTCTime value) [virtual]
    - -
    +
    +virtual
    +

    Reads the current time from the realtime clock into value.

    -
    See also:
    writeTime(), readDate()
    +
    See Also
    writeTime(), readDate()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -502,9 +601,12 @@ static const uint8_t 
    - +
    + + + + + +
    @@ -521,16 +623,20 @@ static const uint8_t  - +
    void RTC::writeAlarm ) [virtual]
    - -
    +
    +virtual
    +

    Updates the details of the alarm with index alarmNum from value.

    The alarmNum parameter must be between 0 and ALARM_COUNT - 1.

    Alarm details are stored at the end of the realtime clock's non-volatile memory.

    -
    See also:
    readAlarm(), alarmCount()
    +
    See Also
    readAlarm(), alarmCount()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -538,9 +644,12 @@ static const uint8_t 
    - +
    + + + + + +
    @@ -557,15 +666,19 @@ static const uint8_t  - +
    void RTC::writeByte ) [virtual]
    - -
    +
    +virtual
    +

    Writes value to offset within the realtime clock's non-volatile memory.

    The offset parameter must be between 0 and byteCount() - 1.

    -
    See also:
    readByte(), byteCount()
    +
    See Also
    readByte(), byteCount()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -573,23 +686,30 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    void RTC::writeDate ( const RTCDate value) [virtual]
    - -
    +
    +virtual
    +

    Updates the date in the realtime clock to match value.

    -
    See also:
    readDate(), writeTime()
    +
    See Also
    readDate(), writeTime()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -597,23 +717,30 @@ static const uint8_t 
    - +
    + + + + + +
    - +
    void RTC::writeTime ( const RTCTime value) [virtual]
    - -
    +
    +virtual
    +

    Updates the time in the realtime clock to match value.

    -
    See also:
    readTime(), writeDate()
    +
    See Also
    readTime(), writeDate()

    Reimplemented in DS1307RTC, and DS3232RTC.

    @@ -625,23 +752,12 @@ static const uint8_t 
    RTC.h
  • RTC.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classRTC.png b/classRTC.png index c7b873a92f559ce6d2ad87ede4685865bab12380..4b6633ae53e3b7c8f1538335b95ae7bb28eb020f 100644 GIT binary patch delta 417 zcmV;S0bc&P1M>rrTz`T|L_t(|0qvbpZo?oD1qW8*{zq=B24^AIAqlG%=|vd>mh(Ku zu=xd;C#95@0uaUOaLGzmva{j0?S0?p&$s&@%C-mJ1sL&fWM@Pq`^uW#XJ)sO-F3}w zRSo`kodtLi$x2qTl9eprzA2@&6o9{`0PMm}vZZWfyOZp<>wiABTgj>#0K_0!fCwZD z5P@U?B9JV=B&C!R1;A1QCrh#b5l9vw0?7hIAX$J2BnuFMWC0?OEIacyDf3`Q|u(D*G6H(OgH@#CoWm8gUyP@^$16 zzB`hAht1G)o{Tz^SPL_t(|0qxzv4uc>N1kj=h|NqH7)Wrc8TohB*3=EUN*r#1cy^v40a`?<%+YmcEnpk3;VnYZaq|t96)4kiS!Y-Y!Vvo^{t{p9ja*%;U zY_o)y860q^VGq$KT|F8T)75aQ#Nu7^tR^;(#wX9ac66Dzq*a#$;oZhUbcV!PCpP_9 zU0K;)c#Robu3!Y-!4$0|DpALWzJ|?Se7@s~7iYpM??J_0-Lu8Fq|I#Gph5y{`OtT( z!5Owv4NP^mg1uH}p^`#@ZASC&mRMqmCH7(L=myx)?F$O^BStwZ)VKfu002ovPDHLk FV1jOivIGDC diff --git a/classRTCAlarm-members.html b/classRTCAlarm-members.html index 50ac1bd4..33ea53dd 100644 --- a/classRTCAlarm-members.html +++ b/classRTCAlarm-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    RTCAlarm Member List
    -
    -
    -This is the complete list of members for RTCAlarm, including all inherited members. - - - -
    flagsRTCAlarm
    hourRTCAlarm
    minuteRTCAlarm
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -83,8 +80,24 @@ This is the complete list of members for +
    +
    +
    +
    RTCAlarm Member List
    +
    +
    + +

    This is the complete list of members for RTCAlarm, including all inherited members.

    + + + + +
    flagsRTCAlarm
    hourRTCAlarm
    minuteRTCAlarm
    + + diff --git a/classRTCDate-members.html b/classRTCDate-members.html index 76811004..cee66cf2 100644 --- a/classRTCDate-members.html +++ b/classRTCDate-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    RTCDate Member List
    -
    -
    -This is the complete list of members for RTCDate, including all inherited members. - - - -
    dayRTCDate
    monthRTCDate
    yearRTCDate
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -83,8 +80,24 @@ This is the complete list of members for
    - + +
    +
    +
    RTCDate Member List
    +
    +
    + +

    This is the complete list of members for RTCDate, including all inherited members.

    + + + + +
    dayRTCDate
    monthRTCDate
    yearRTCDate
    + + diff --git a/classRTCTime-members.html b/classRTCTime-members.html index c68facfc..2d3a5d88 100644 --- a/classRTCTime-members.html +++ b/classRTCTime-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    RTCTime Member List
    -
    -
    -This is the complete list of members for RTCTime, including all inherited members. - - - -
    hourRTCTime
    minuteRTCTime
    secondRTCTime
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -83,8 +80,24 @@ This is the complete list of members for
    - + +
    +
    +
    RTCTime Member List
    +
    +
    + +

    This is the complete list of members for RTCTime, including all inherited members.

    + + + + +
    hourRTCTime
    minuteRTCTime
    secondRTCTime
    + + diff --git a/classSoftI2C-members.html b/classSoftI2C-members.html index f3d75571..c16fca72 100644 --- a/classSoftI2C-members.html +++ b/classSoftI2C-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    SoftI2C Member List
    -
    -
    -This is the complete list of members for SoftI2C, including all inherited members. - - - - - - - - -
    available()SoftI2C [virtual]
    endWrite()SoftI2C [virtual]
    maxTransferSize() const SoftI2C [virtual]
    read()SoftI2C [virtual]
    SoftI2C(uint8_t dataPin, uint8_t clockPin)SoftI2C
    startRead(unsigned int address, unsigned int count)SoftI2C [virtual]
    startWrite(unsigned int address)SoftI2C [virtual]
    write(uint8_t value)SoftI2C [virtual]
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -88,8 +80,29 @@ This is the complete list of members for
    - + +
    +
    +
    SoftI2C Member List
    +
    +
    + +

    This is the complete list of members for SoftI2C, including all inherited members.

    + + + + + + + + + +
    available()SoftI2Cvirtual
    endWrite()SoftI2Cvirtual
    maxTransferSize() const SoftI2Cvirtual
    read()SoftI2Cvirtual
    SoftI2C(uint8_t dataPin, uint8_t clockPin)SoftI2C
    startRead(unsigned int address, unsigned int count)SoftI2Cvirtual
    startWrite(unsigned int address)SoftI2Cvirtual
    write(uint8_t value)SoftI2Cvirtual
    + + diff --git a/classSoftI2C.html b/classSoftI2C.html index dc139626..b832cc84 100644 --- a/classSoftI2C.html +++ b/classSoftI2C.html @@ -2,29 +2,37 @@ + ArduinoLibs: SoftI2C Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    SoftI2C Class Reference
    -
    +
    - +

    Bit-banged implementation of an I2C master. More...

    @@ -80,54 +103,59 @@ Inheritance diagram for SoftI2C:
    I2CMaster - -

    List of all members.

    - - - - + - - - - - - - - - - - - - + + + + + + + + + + + + +

    +

    Public Member Functions

    +
     SoftI2C (uint8_t dataPin, uint8_t clockPin)
     Constructs a new software I2C master on dataPin and clockPin.
    +
     Constructs a new software I2C master on dataPin and clockPin.
    unsigned int maxTransferSize () const
     Returns the maximum number of bytes that can be read or written in a single request by this bus master.
    void startWrite (unsigned int address)
     Starts a write operation by sending a start condition and the I2C control byte.
    void write (uint8_t value)
     Writes a single byte value on the I2C bus.
    bool endWrite ()
     Ends the current write operation.
    bool startRead (unsigned int address, unsigned int count)
     Starts a read operation for count bytes by sending the start condition and the I2C control byte.
    unsigned int available ()
     Returns the number of bytes that are still available for reading.
    uint8_t read ()
     Reads a single byte from the I2C bus.
     Returns the maximum number of bytes that can be read or written in a single request by this bus master.
    void startWrite (unsigned int address)
     Starts a write operation by sending a start condition and the I2C control byte.
    void write (uint8_t value)
     Writes a single byte value on the I2C bus.
    bool endWrite ()
     Ends the current write operation.
    bool startRead (unsigned int address, unsigned int count)
     Starts a read operation for count bytes by sending the start condition and the I2C control byte.
    unsigned int available ()
     Returns the number of bytes that are still available for reading.
    uint8_t read ()
     Reads a single byte from the I2C bus.
    -

    Detailed Description

    +

    Detailed Description

    Bit-banged implementation of an I2C master.

    This class implements the I2C master protocol on any arbitrary pair of data and clock pins. It is not restricted to pre-defined pins as is the case for the standard Arduino two-wire interface.

    This implementation only implements the master side of the protocol. It assumes that there is a single bus master, no arbitration, and no clock stretching.

    -
    See also:
    I2CMaster
    +
    See Also
    I2CMaster

    Definition at line 28 of file SoftI2C.h.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    unsigned int SoftI2C::available ( ) [virtual]
    - -
    +
    +virtual
    +

    Returns the number of bytes that are still available for reading.

    -
    See also:
    startRead(), read()
    +
    See Also
    startRead(), read()

    Implements I2CMaster.

    @@ -135,23 +163,30 @@ unsigned int 
    - +
    + + + + + +
    - +
    bool SoftI2C::endWrite ( ) [virtual]
    - -
    +
    +virtual
    +

    Ends the current write operation.

    Returns true if the write operation was acknowledged; false otherwise.

    -
    See also:
    startWrite(), write()
    +
    See Also
    startWrite(), write()

    Implements I2CMaster.

    @@ -159,22 +194,29 @@ unsigned int 
    - +
    + + + + + +
    - +
    uint8_t SoftI2C::read ( ) [virtual]
    - -
    +
    +virtual
    +

    Reads a single byte from the I2C bus.

    -
    See also:
    startRead(), available()
    +
    See Also
    startRead(), available()

    Implements I2CMaster.

    @@ -182,9 +224,12 @@ unsigned int 
    - +
    + + + + + +
    @@ -201,16 +246,20 @@ unsigned int  - +
    bool SoftI2C::startRead ) [virtual]
    - -
    +
    +virtual
    +

    Starts a read operation for count bytes by sending the start condition and the I2C control byte.

    The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

    Returns true if the read request was acknowledged by the I2C slave or false otherwise. If true, this function should be followed by count calls to read() to fetch the bytes.

    -
    See also:
    available(), read(), startWrite()
    +
    See Also
    available(), read(), startWrite()

    Implements I2CMaster.

    @@ -218,24 +267,31 @@ unsigned int 
    - +
    + + + + + +
    - +
    void SoftI2C::startWrite ( unsigned int  address) [virtual]
    - -
    +
    +virtual
    +

    Starts a write operation by sending a start condition and the I2C control byte.

    The address must be the 7-bit or 10-bit address of the I2C slave on the bus.

    -
    See also:
    write(), endWrite(), startRead()
    +
    See Also
    write(), endWrite(), startRead()

    Reimplemented from I2CMaster.

    @@ -243,23 +299,30 @@ unsigned int 
    - +
    + + + + + +
    - +
    void SoftI2C::write ( uint8_t  value) [virtual]
    - -
    +
    +virtual
    +

    Writes a single byte value on the I2C bus.

    -
    See also:
    startWrite(), endWrite()
    +
    See Also
    startWrite(), endWrite()

    Implements I2CMaster.

    @@ -271,23 +334,12 @@ unsigned int 
    SoftI2C.h
  • SoftI2C.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/classSoftI2C.png b/classSoftI2C.png index b07c8213f0c1a68d81202cdbc5b2ded915d8589f..6094e88eb468ca50ee75955d6cb8a1d1c2214fab 100644 GIT binary patch delta 350 zcmV-k0ipi*0U_8{^vh7e+ZO0o-Lu=#r%yuKs_SNm; zJz(0q6d#+*emhDTqHO9kV7f%d`=3hOU)|h2rc~Y28oDr+_CqF2xWdPSES(x|~lG60>T5*sMMgx9(2R3G0I=3|T>dBW8401WyX^I@ls wXR$B)gE36=!~1sw@VyoWAl6^Sh=@$<2f!!~a3r}fHvj+t07*qoM6N<$f{QJyvH$=8 delta 293 zcmV+=0owkt1NZ`vTz>~iL_t(|0qvdL4udcVg?nn!_kZMF0EJ?8n2~K4kVT8quZJJA z+jgW_J9>f@CV)Zj9RRIqL5|+Vyzelw72*r@8OG4;eo{sbz)SHt+F@)i90McN{$GJOMHP@4l(t+!Dy#cqu*k->D+Z{-ERsL#>kN;jFu+@6YSI+ r3%b$3G-}#>@g9C|>eDPt43lCnz$g!Jbf+9B00000NkvXXu0mjfbKHa+ diff --git a/classTextField-members.html b/classTextField-members.html index 7eb02bde..408a0618 100644 --- a/classTextField-members.html +++ b/classTextField-members.html @@ -2,29 +2,37 @@ + ArduinoLibs: Member List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    TextField Member List
    -
    -
    -This is the complete list of members for TextField, including all inherited members. - - - - - - - - - - - - - - - - -
    dispatch(int event)Field [virtual]
    enterField(bool reverse)TextField [virtual]
    exitField()Field [virtual]
    Field(const String &label)Field [explicit]
    Field(Form &form, const String &label)Field
    form() const Field [inline]
    isCurrent() const Field
    label() const Field [inline]
    lcd() const Field [inline, protected]
    setLabel(const String &label)Field
    setValue(const String &value)TextField
    TextField(const String &label)TextField [explicit]
    TextField(Form &form, const String &label, const String &value)TextField
    updateCursor()Field [protected, virtual]
    value() const TextField [inline]
    ~Field()Field
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -96,8 +80,37 @@ This is the complete list of members for +
    +
    +
    +
    TextField Member List
    +
    +
    + +

    This is the complete list of members for TextField, including all inherited members.

    + + + + + + + + + + + + + + + + + +
    dispatch(int event)Fieldvirtual
    enterField(bool reverse)TextFieldvirtual
    exitField()Fieldvirtual
    Field(const String &label)Fieldexplicit
    Field(Form &form, const String &label)Field
    form() const Fieldinline
    isCurrent() const Field
    label() const Fieldinline
    lcd() const Fieldinlineprotected
    setLabel(const String &label)Field
    setValue(const String &value)TextField
    TextField(const String &label)TextFieldexplicit
    TextField(Form &form, const String &label, const String &value)TextField
    updateCursor()Fieldprotectedvirtual
    value() const TextFieldinline
    ~Field()Field
    + + diff --git a/classTextField.html b/classTextField.html index 0cf94cb0..f5184281 100644 --- a/classTextField.html +++ b/classTextField.html @@ -2,29 +2,37 @@ + ArduinoLibs: TextField Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    TextField Class Reference
    -
    +
    - +

    Field that displays a read-only text value. More...

    @@ -80,67 +103,102 @@ Inheritance diagram for TextField:
    Field - -

    List of all members.

    - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     TextField (const String &label)
     Constructs a new text field with a specific label.
     TextField (Form &form, const String &label, const String &value)
     Constructs a new text field with a specific label and value attaches it to a form.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    const String & value () const
     Returns the text value that is currently displayed by this field.
    void setValue (const String &value)
     Sets the text value that is displayed by this field.
     TextField (const String &label)
     Constructs a new text field with a specific label.
     TextField (Form &form, const String &label, const String &value)
     Constructs a new text field with a specific label and value attaches it to a form.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    const String & value () const
     Returns the text value that is currently displayed by this field.
    void setValue (const String &value)
     Sets the text value that is displayed by this field.
    - Public Member Functions inherited from Field
     Field (const String &label)
     Constructs a new field with a specific label.
    Field (Form &form, const String &label)
     Constructs a new field with a specific label and attaches it to a form.
     ~Field ()
     Destroys this field and removes it from its owning Form.
    +Formform () const
     Returns the Form that owns this field; null if not associated with a Form.
    virtual int dispatch (int event)
     Dispatches event via this field.
    virtual void exitField ()
     Exits the field due to form navigation.
    const String & label () const
     Returns the label to display in the first line of this field.
    void setLabel (const String &label)
     Sets the label to display in the first line of this field.
    bool isCurrent () const
     Returns true if this field is the currently-displayed field in its owning form; false otherwise.
    + + + + + +

    +Additional Inherited Members

    - Protected Member Functions inherited from Field
    +LiquidCrystal * lcd () const
     Returns the LCD that this field is being drawn on.
    virtual void updateCursor ()
     Updates the cursor position after the label has been drawn by setLabel().
    -

    Detailed Description

    +

    Detailed Description

    Field that displays a read-only text value.

    This following example displays a text field with the label "Form example" and a value() of "v1.0".

    -
     Form mainForm(lcd);
    - TextField welcomeField(mainForm, "Form example", "v1.0");
    -
    +
    Form mainForm(lcd);
    +
    TextField welcomeField(mainForm, "Form example", "v1.0");
    +
    FormText.png

    As well as static messages, TextField can be used to display read-only information that is computed at runtime:

    -
     TextField timeField(mainForm, "Time since reset", "0");
    -
    - void loop() {
    -     timeField.setValue(millis() / 1000);
    -     mainForm.dispatch(lcd.getButton());
    - }
    -

    For writable fields, use BoolField, IntField, or TimeField.

    -
    See also:
    Field
    +
    TextField timeField(mainForm, "Time since reset", "0");
    +
    +
    void loop() {
    +
    timeField.setValue(millis() / 1000);
    +
    mainForm.dispatch(lcd.getButton());
    +
    }
    +

    For writable fields, use BoolField, IntField, or TimeField.

    +
    See Also
    Field

    Definition at line 28 of file TextField.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    TextField::TextField ( const String &  label) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new text field with a specific label.

    The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

    The initial value() will be the empty string.

    -
    See also:
    Form::addField()
    +
    See Also
    Form::addField()

    Definition at line 66 of file TextField.cpp.

    - +
    @@ -168,37 +226,43 @@ Public Member Functions
    -
    -
    +

    Constructs a new text field with a specific label and value attaches it to a form.

    -
    See also:
    value()
    +
    See Also
    value()

    Definition at line 77 of file TextField.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    void TextField::enterField ( bool  reverse) [virtual]
    - -
    +
    +virtual
    +

    Enters the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

    This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

    The default implementation prints the label().

    -
    See also:
    exitField()
    +
    See Also
    exitField()

    Reimplemented from Field.

    @@ -206,7 +270,7 @@ Public Member Functions
    @@ -218,32 +282,38 @@ Public Member Functions
    -
    -
    +

    Sets the text value that is displayed by this field.

    -
    See also:
    value()
    +
    See Also
    value()

    Definition at line 102 of file TextField.cpp.

    - +
    + + + + + +
    - +
    const String & TextField::value ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the text value that is currently displayed by this field.

    -
    See also:
    setValue()
    +
    See Also
    setValue()

    Definition at line 35 of file TextField.h.

    @@ -253,23 +323,12 @@ Public Member Functions
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    TimeField Member List
    -
    -
    -This is the complete list of members for TimeField, including all inherited members. - - - - - - - - - - - - - - - - - - - - -
    dispatch(int event)TimeField [virtual]
    enterField(bool reverse)TimeField [virtual]
    exitField()TimeField [virtual]
    Field(const String &label)Field [explicit]
    Field(Form &form, const String &label)Field
    form() const Field [inline]
    isCurrent() const Field
    label() const Field [inline]
    lcd() const Field [inline, protected]
    maxHours() const TimeField [inline]
    readOnly() const TimeField [inline]
    setLabel(const String &label)Field
    setMaxHours(int maxHours)TimeField [inline]
    setReadOnly(bool value)TimeField
    setValue(unsigned long value)TimeField
    TimeField(const String &label)TimeField [explicit]
    TimeField(Form &form, const String &label, int maxHours, bool readOnly)TimeField
    updateCursor()Field [protected, virtual]
    value() const TimeField [inline]
    ~Field()Field
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -100,8 +80,41 @@ This is the complete list of members for +
    +
    +
    +
    TimeField Member List
    +
    +
    + +

    This is the complete list of members for TimeField, including all inherited members.

    + + + + + + + + + + + + + + + + + + + + + +
    dispatch(int event)TimeFieldvirtual
    enterField(bool reverse)TimeFieldvirtual
    exitField()TimeFieldvirtual
    Field(const String &label)Fieldexplicit
    Field(Form &form, const String &label)Field
    form() const Fieldinline
    isCurrent() const Field
    label() const Fieldinline
    lcd() const Fieldinlineprotected
    maxHours() const TimeFieldinline
    readOnly() const TimeFieldinline
    setLabel(const String &label)Field
    setMaxHours(int maxHours)TimeFieldinline
    setReadOnly(bool value)TimeField
    setValue(unsigned long value)TimeField
    TimeField(const String &label)TimeFieldexplicit
    TimeField(Form &form, const String &label, int maxHours, bool readOnly)TimeField
    updateCursor()Fieldprotectedvirtual
    value() const TimeFieldinline
    ~Field()Field
    + + diff --git a/classTimeField.html b/classTimeField.html index 2743f749..1344732f 100644 --- a/classTimeField.html +++ b/classTimeField.html @@ -2,29 +2,37 @@ + ArduinoLibs: TimeField Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    TimeField Class Reference
    -
    +
    - +

    Field that manages the display and editing of a time value. More...

    @@ -80,83 +103,114 @@ Inheritance diagram for TimeField:
    Field - -

    List of all members.

    - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +

    Public Member Functions

     TimeField (const String &label)
     Constructs a new time field with a specific label.
     TimeField (Form &form, const String &label, int maxHours, bool readOnly)
     Constructs a new boolean field with a specific label and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    void exitField ()
     Exits the field due to form navigation.
    unsigned long value () const
     Returns the current value of this time field, in seconds.
    void setValue (unsigned long value)
     Sets the value of this time field, in seconds.
    int maxHours () const
     Returns the maximum number of hours before the field wraps around.
    void setMaxHours (int maxHours)
     Sets the maximum number of hours before the field wraps around to maxHours.
    bool readOnly () const
     Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false).
    void setReadOnly (bool value)
     Sets the read-only state of this field to value.
     TimeField (const String &label)
     Constructs a new time field with a specific label.
     TimeField (Form &form, const String &label, int maxHours, bool readOnly)
     Constructs a new boolean field with a specific label and attaches it to a form.
    int dispatch (int event)
     Dispatches event via this field.
    void enterField (bool reverse)
     Enters the field due to form navigation.
    void exitField ()
     Exits the field due to form navigation.
    unsigned long value () const
     Returns the current value of this time field, in seconds.
    void setValue (unsigned long value)
     Sets the value of this time field, in seconds.
    int maxHours () const
     Returns the maximum number of hours before the field wraps around.
    void setMaxHours (int maxHours)
     Sets the maximum number of hours before the field wraps around to maxHours.
    bool readOnly () const
     Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false).
    void setReadOnly (bool value)
     Sets the read-only state of this field to value.
    - Public Member Functions inherited from Field
     Field (const String &label)
     Constructs a new field with a specific label.
    Field (Form &form, const String &label)
     Constructs a new field with a specific label and attaches it to a form.
     ~Field ()
     Destroys this field and removes it from its owning Form.
    +Formform () const
     Returns the Form that owns this field; null if not associated with a Form.
    const String & label () const
     Returns the label to display in the first line of this field.
    void setLabel (const String &label)
     Sets the label to display in the first line of this field.
    bool isCurrent () const
     Returns true if this field is the currently-displayed field in its owning form; false otherwise.
    + + + + + +

    +Additional Inherited Members

    - Protected Member Functions inherited from Field
    +LiquidCrystal * lcd () const
     Returns the LCD that this field is being drawn on.
    virtual void updateCursor ()
     Updates the cursor position after the label has been drawn by setLabel().
    -

    Detailed Description

    +

    Detailed Description

    Field that manages the display and editing of a time value.

    TimeField is suitable for displaying wall clock time in 24-hour format, or for displaying timeouts and durations in seconds. Times are specified in seconds as an unsigned long value. They are displayed as HH:MM:SS, for hours, minutes, and seconds.

    The time field can be either read-only or read-write. When read-write, the Up, Down, Left, and Right buttons can be used to modify the hour, minute, and second components of the time value.

    The following example displays the number of hours, minutes, and seconds since the device was reset, wrapping around after 24 hours:

    -
     Form mainForm(lcd);
    - TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
    -
    - void loop() {
    -     timeField.setValue(millis() / 1000);
    -     mainForm.dispatch(lcd.getButton());
    - }
    -
    +
    Form mainForm(lcd);
    +
    TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
    +
    +
    void loop() {
    +
    timeField.setValue(millis() / 1000);
    +
    mainForm.dispatch(lcd.getButton());
    +
    }
    +
    FormTimeRO.png

    A read-write field can be used to ask the user for the duration of an application count-down timer:

    -
     TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
    -
    +
    TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
    +
    FormTimeRW.png
    -
    See also:
    Field
    +
    See Also
    Field

    Definition at line 31 of file TimeField.h.

    -

    Constructor & Destructor Documentation

    - +

    Constructor & Destructor Documentation

    +
    + + + + + +
    - +
    TimeField::TimeField ( const String &  label) [explicit]
    - -
    +
    +explicit
    +

    Constructs a new time field with a specific label.

    The field is initially not associated with a Form. The field can be added to a form later using Form::addField().

    Initially value() is 0, maxHours() is 24, and isReadOnly() is TIMEFIELD_READ_WRITE.

    -
    See also:
    Form::addField()
    +
    See Also
    Form::addField()

    Definition at line 82 of file TimeField.cpp.

    - +
    @@ -190,40 +244,46 @@ Public Member Functions
    -
    -
    +

    Constructs a new boolean field with a specific label and attaches it to a form.

    The initial value() of the field will be 0. The value() will be limited to be less than maxHours * 60 * 60 seconds.

    If readOnly is TIMEFIELD_READ_ONLY, then the field will display times but not allow them to be modified by the user. If readOnly is TIMEFIELD_READ_WRITE, then the field will modifiable by the user.

    -
    See also:
    value()
    +
    See Also
    value()

    Definition at line 105 of file TimeField.cpp.

    -

    Member Function Documentation

    - +

    Member Function Documentation

    +
    + + + + + +
    - +
    int TimeField::dispatch ( int  event) [virtual]
    - -
    +
    +virtual
    +

    Dispatches event via this field.

    The event is usually obtained from LCD::getButton().

    Returns zero if the event has been handled and no further action is required.

    Returns FORM_CHANGED if the event has changed the value of this field in a manner that may require the application to take further action based on the new field value.

    Returns -1 if the event is not handled by this field, and should be handled by the Form itself (particularly for Left and Right buttons). The default implementation returns -1 for all events.

    -
    See also:
    Form::dispatch(), LCD::getButton()
    +
    See Also
    Form::dispatch(), LCD::getButton()

    Reimplemented from Field.

    @@ -231,26 +291,33 @@ Public Member Functions
    + + + + +
    - +
    void TimeField::enterField ( bool  reverse) [virtual]
    - -
    +
    +virtual
    +

    Enters the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate to the field. If reverse is true, then navigation was due to the Left button being pressed.

    This function can assume that the display has been cleared and the cursor is positioned at (0, 0).

    The default implementation prints the label().

    -
    See also:
    exitField()
    +
    See Also
    exitField()

    Reimplemented from Field.

    @@ -258,23 +325,30 @@ Public Member Functions
    + + + + +
    - +
    void TimeField::exitField ( ) [virtual]
    - -
    +
    +virtual
    +

    Exits the field due to form navigation.

    This function is typically called when the user presses Left and Right buttons to navigate from the field.

    -
    See also:
    enterField()
    +
    See Also
    enterField()

    Reimplemented from Field.

    @@ -282,71 +356,92 @@ Public Member Functions
    + + + + +
    - +
    int TimeField::maxHours ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the maximum number of hours before the field wraps around.

    -
    See also:
    setMaxHours(), setValue()
    +
    See Also
    setMaxHours(), setValue()

    Definition at line 44 of file TimeField.h.

    - +
    + + + + + +
    - +
    bool TimeField::readOnly ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false).

    -
    See also:
    setReadOnly()
    +
    See Also
    setReadOnly()

    Definition at line 47 of file TimeField.h.

    - +
    + + + + + +
    - +
    void TimeField::setMaxHours ( int  maxHours) [inline]
    - -
    +
    +inline
    +

    Sets the maximum number of hours before the field wraps around to maxHours.

    -
    See also:
    maxHours(), setValue()
    +
    See Also
    maxHours(), setValue()

    Definition at line 45 of file TimeField.h.

    - +
    @@ -358,18 +453,17 @@ Public Member Functions
    -
    -
    +

    Sets the read-only state of this field to value.

    The value should be one of TIMEFIELD_READ_ONLY (true) or TIMEFIELD_READ_WRITE (false). Use of the named constants is recommended.

    -
    See also:
    readOnly()
    +
    See Also
    readOnly()

    Definition at line 268 of file TimeField.cpp.

    - +
    @@ -381,33 +475,39 @@ Public Member Functions
    -
    -
    +

    Sets the value of this time field, in seconds.

    If value is greater than or equal to maxHours() * 60 * 60, then it will be wrapped around to fall within the valid range.

    -
    See also:
    value(), maxHours()
    +
    See Also
    value(), maxHours()

    Definition at line 227 of file TimeField.cpp.

    - +
    + + + + + +
    - +
    unsigned long TimeField::value ( ) const [inline] const
    - -
    +
    +inline
    +

    Returns the current value of this time field, in seconds.

    -
    See also:
    setValue()
    +
    See Also
    setValue()

    Definition at line 41 of file TimeField.h.

    @@ -417,23 +517,12 @@ Public Member Functions
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Class Index
    -
    -
    -
    B | C | D | E | F | I | L | M | R | S | T
    - -
      B  
    -
      D  
    -
    Field   LCD   RTCDate   
    Bitmap   DMD   Form   ListField   RTCTime   
    BlinkLED   DS1307RTC   
      I  
    -
      M  
    -
      S  
    -
    BoolField   DS3232RTC   I2CMaster   Melody   SoftI2C   
      C  
    -
      E  
    -
    IntField   
      R  
    -
      T  
    -
    Charlieplex   EEPROM24   IRreceiver   RTC   TextField   
    ChaseLEDs   
      F  
    -
      L  
    -
    RTCAlarm   TimeField   
    B | C | D | E | F | I | L | M | R | S | T
    -
    + + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -93,8 +81,45 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    +
    Class Index
    +
    +
    +
    B | C | D | E | F | I | L | M | R | S | T
    + + + + + + + + + + + + + + +
      B  
    +
    DS1307RTC   IntField   RTCAlarm   
    DS3232RTC   IRreceiver   RTCDate   
    Bitmap   
      E  
    +
      L  
    +
    RTCTime   
    BlinkLED   
      S  
    +
    BoolField   EEPROM24   LCD   
      C  
    +
      F  
    +
    ListField   SoftI2C   
      M  
    +
      T  
    +
    Charlieplex   Field   
    ChaseLEDs   Form   Melody   TextField   
      D  
    +
      I  
    +
      R  
    +
    TimeField   
    DMD   I2CMaster   RTC   
    +
    B | C | D | E | F | I | L | M | R | S | T
    +
    + + diff --git a/closed.png b/closed.png index b7d4bd9fef2272c74b94762c9e2496177017775e..98cc2c909da37a6df914fbf67780eebd99c597f5 100644 GIT binary patch delta 102 zcmV-s0Ga=OgaMEwU`t6vK~#7F?cHq+Kp_Z*(MM~U$pSaPEnp^d>2z}grjWq#{_^k< z0YK$zeE_O5fQ^L-P$j`%%l^MkvJEaeFhpymi^7`@cp?ebn<=3b5O~rx^#A|>07*qo IM6N<$f|rOX*#H0l delta 96 zcmZo+tec<`s7MjVWp=ECAagp<1j^;uU0fEn(IvIe#)78&qol`;+0I1v| A!2kdN diff --git a/dir_1586d320a3b1e622174530fde769cda9.html b/dir_1586d320a3b1e622174530fde769cda9.html new file mode 100644 index 00000000..7dc69c3a --- /dev/null +++ b/dir_1586d320a3b1e622174530fde769cda9.html @@ -0,0 +1,103 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/BlinkLED/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    BlinkLED Directory Reference
    +
    +
    + + + + + + + + +

    +Files

    file  BlinkLED.cpp [code]
    file  BlinkLED.h [code]
    file  Charlieplex.cpp [code]
    file  Charlieplex.h [code]
    file  ChaseLEDs.cpp [code]
    file  ChaseLEDs.h [code]
    +
    + + + + diff --git a/dir_48f64e79f12bd77ba047e9e436ec978c.html b/dir_48f64e79f12bd77ba047e9e436ec978c.html new file mode 100644 index 00000000..33b34ce5 --- /dev/null +++ b/dir_48f64e79f12bd77ba047e9e436ec978c.html @@ -0,0 +1,113 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/LCD/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    LCD Directory Reference
    +
    +
    + + + + + + + + + + + + + + + + + + +

    +Files

    file  BoolField.cpp [code]
    file  BoolField.h [code]
    file  Field.cpp [code]
    file  Field.h [code]
    file  Form.cpp [code]
    file  Form.h [code]
    file  IntField.cpp [code]
    file  IntField.h [code]
    file  LCD.cpp [code]
    file  LCD.h [code]
    file  ListField.cpp [code]
    file  ListField.h [code]
    file  TextField.cpp [code]
    file  TextField.h [code]
    file  TimeField.cpp [code]
    file  TimeField.h [code]
    +
    + + + + diff --git a/dir_5e87a7229a108582288ef7eda1233dc3.html b/dir_5e87a7229a108582288ef7eda1233dc3.html new file mode 100644 index 00000000..157fec0c --- /dev/null +++ b/dir_5e87a7229a108582288ef7eda1233dc3.html @@ -0,0 +1,99 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/PowerSave/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    PowerSave Directory Reference
    +
    +
    + + + + +

    +Files

    file  PowerSave.cpp [code]
    file  PowerSave.h [code]
    +
    + + + + diff --git a/dir_6591a2127a29f6cea3994dcb5b0596d1.html b/dir_6591a2127a29f6cea3994dcb5b0596d1.html new file mode 100644 index 00000000..c749453f --- /dev/null +++ b/dir_6591a2127a29f6cea3994dcb5b0596d1.html @@ -0,0 +1,105 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/DMD/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    DMD Directory Reference
    +
    +
    + + + + + + + + + + +

    +Files

    file  Bitmap.cpp [code]
    file  Bitmap.h [code]
    file  DejaVuSans9.h [code]
    file  DejaVuSansBold9.h [code]
    file  DejaVuSansItalic9.h [code]
    file  DMD.cpp [code]
    file  DMD.h [code]
    file  Mono5x7.h [code]
    +
    + + + + diff --git a/dir_9a34040863d1190c0e01b23e6b44de01.html b/dir_9a34040863d1190c0e01b23e6b44de01.html new file mode 100644 index 00000000..84056487 --- /dev/null +++ b/dir_9a34040863d1190c0e01b23e6b44de01.html @@ -0,0 +1,100 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/IR/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    IR Directory Reference
    +
    +
    + + + + + +

    +Files

    file  IRreceiver.cpp [code]
    file  IRreceiver.h [code]
    file  RC5.h [code]
    +
    + + + + diff --git a/dir_bc0718b08fb2015b8e59c47b2805f60c.html b/dir_bc0718b08fb2015b8e59c47b2805f60c.html new file mode 100644 index 00000000..6b47eea5 --- /dev/null +++ b/dir_bc0718b08fb2015b8e59c47b2805f60c.html @@ -0,0 +1,105 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    libraries Directory Reference
    +
    +
    + + + + + + + + + + +

    +Directories

    directory  BlinkLED
    directory  DMD
    directory  I2C
    directory  IR
    directory  LCD
    directory  Melody
    directory  PowerSave
    directory  RTC
    +
    + + + + diff --git a/dir_be059bf9978ae156837504b1b8a7568c.html b/dir_be059bf9978ae156837504b1b8a7568c.html new file mode 100644 index 00000000..4ad116a8 --- /dev/null +++ b/dir_be059bf9978ae156837504b1b8a7568c.html @@ -0,0 +1,99 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/Melody/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    Melody Directory Reference
    +
    +
    + + + + +

    +Files

    file  Melody.cpp [code]
    file  Melody.h [code]
    +
    + + + + diff --git a/dir_f34881fcf60f680b800190d5274dfaea.html b/dir_f34881fcf60f680b800190d5274dfaea.html new file mode 100644 index 00000000..f1a4189d --- /dev/null +++ b/dir_f34881fcf60f680b800190d5274dfaea.html @@ -0,0 +1,103 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/RTC/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    RTC Directory Reference
    +
    +
    + + + + + + + + +

    +Files

    file  DS1307RTC.cpp [code]
    file  DS1307RTC.h [code]
    file  DS3232RTC.cpp [code]
    file  DS3232RTC.h [code]
    file  RTC.cpp [code]
    file  RTC.h [code]
    +
    + + + + diff --git a/dir_f9b96888882c2691b8eeaeafd1b9501d.html b/dir_f9b96888882c2691b8eeaeafd1b9501d.html new file mode 100644 index 00000000..8a52fe93 --- /dev/null +++ b/dir_f9b96888882c2691b8eeaeafd1b9501d.html @@ -0,0 +1,103 @@ + + + + + +ArduinoLibs: /home/rweather/sketchbook/libraries/I2C/ Directory Reference + + + + + + + + + +
    +
    + + + + + + +
    +
    ArduinoLibs +
    +
    +
    + + + + + + + + +
    + +
    + + +
    +
    +
    +
    I2C Directory Reference
    +
    +
    + + + + + + + + +

    +Files

    file  EEPROM24.cpp [code]
    file  EEPROM24.h [code]
    file  I2CMaster.cpp [code]
    file  I2CMaster.h [code]
    file  SoftI2C.cpp [code]
    file  SoftI2C.h [code]
    +
    + + + + diff --git a/dmd-demo_8dox.html b/dmd-demo_8dox.html index 75037be8..9cfd3578 100644 --- a/dmd-demo_8dox.html +++ b/dmd-demo_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: dmd-demo.dox File Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    dmd-demo.dox File Reference
    -
    -
    - -
    -

    Detailed Description

    -
    -

    Definition in file dmd-demo.dox.

    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    dmd-demo.dox File Reference
    +
    +
    +

    Detailed Description

    +
    +

    Definition in file dmd-demo.dox.

    +
    + + diff --git a/dmd-running-figure_8dox.html b/dmd-running-figure_8dox.html index 829db827..b55e8933 100644 --- a/dmd-running-figure_8dox.html +++ b/dmd-running-figure_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: dmd-running-figure.dox File Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    dmd-running-figure.dox File Reference
    -
    -
    - -
    -

    Detailed Description

    -
    -

    Definition in file dmd-running-figure.dox.

    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    dmd-running-figure.dox File Reference
    +
    +
    +

    Detailed Description

    +
    +

    Definition in file dmd-running-figure.dox.

    +
    + + diff --git a/dmd_demo.html b/dmd_demo.html index 29b586b4..a96331d5 100644 --- a/dmd_demo.html +++ b/dmd_demo.html @@ -2,29 +2,37 @@ + ArduinoLibs: Dot Matrix Display Demo + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    Dot Matrix Display Demo
    -
    +

    This demo shows off various features of drawing with the Bitmap class to a DMD display:

      @@ -66,167 +88,156 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');

    RunningFigure provides another example of drawing and animating bitmaps.

    The full source code for the demo follows:

    -
    /*
    -This example demonstrates how to use the DMD and related classes to
    -draw things on a Freetronics Large Dot Matrix Display.
    -
    -This example is placed into the public domain.
    -*/
    -
    -#include <DMD.h>
    -#include <DejaVuSans9.h>
    -#include <DejaVuSansBold9.h>
    -#include <DejaVuSansItalic9.h>
    -#include <Mono5x7.h>
    -
    -DMD display;
    -
    -ISR(TIMER1_OVF_vect)
    -{
    -    display.refresh();
    -}
    -
    -void setup() {
    -    display.enableTimer1();
    -}
    -
    -void loop() {
    -    drawShapes();
    -    delay(1000);
    -
    -    drawBricks();
    -    delay(1000);
    -
    -    drawStickFigures();
    -    delay(1000);
    -
    -    drawText();
    -    delay(1000);
    -
    -    drawBoldText();
    -    delay(1000);
    -
    -    drawItalicText();
    -    delay(1000);
    -
    -    drawMonoText();
    -    delay(1000);
    -
    -    drawMarquee();
    -    delay(500);
    -}
    -
    -void drawShapes()
    -{
    -    display.clear();
    -    display.drawCircle(6, 8, 3);
    -    display.drawFilledCircle(16, 8, 3);
    -    display.drawLine(22, 5, 28, 11);
    -    display.drawLine(28, 5, 22, 11);
    -    display.drawRect(0, 0, display.width() - 1, display.height() - 1);
    -}
    -
    -void drawBricks()
    -{
    -    static const uint8_t bricks[] PROGMEM = {
    -        16, 6,
    -        B11111111, B11111111,
    -        B10000000, B10000000,
    -        B10000000, B10000000,
    -        B11111111, B11111111,
    -        B00001000, B00001000,
    -        B00001000, B00001000
    -    };
    -    display.fill(0, 0, display.width(), display.height(), bricks);
    -}
    -
    -void drawStickFigures()
    -{
    -    static const uint8_t stickFigure[] PROGMEM = {
    -        9, 13,
    -        B00111110, B00000000,
    -        B01000001, B00000000,
    -        B01000001, B00000000,
    -        B00111110, B00000000,
    -        B00001000, B00000000,
    -        B00001000, B00000000,
    -        B11111111, B10000000,
    -        B00001000, B00000000,
    -        B00001000, B00000000,
    -        B00010100, B00000000,
    -        B00100010, B00000000,
    -        B01000001, B00000000,
    -        B10000000, B10000000
    -    };
    -    display.clear();
    -    display.drawBitmap(2, 1, stickFigure);
    -    display.drawInvertedBitmap(12, 1, stickFigure);
    -    display.drawBitmap(22, 1, stickFigure);
    -}
    -
    -void drawText()
    -{
    -    display.clear();
    -    display.setFont(DejaVuSans9);
    -    display.drawText(0, 0, "Hello");
    -    display.drawText(9, 8, "World");
    -}
    -
    -void drawBoldText()
    -{
    -    display.clear();
    -    display.setFont(DejaVuSansBold9);
    -    display.drawText(0, 0, "Hello");
    -    display.drawText(4, 8, "World");
    -}
    -
    -void drawItalicText()
    -{
    -    display.clear();
    -    display.setFont(DejaVuSansItalic9);
    -    display.drawText(0, 0, "Hello");
    -    display.drawText(2, 8, "World");
    -}
    -
    -void drawMonoText()
    -{
    -    display.clear();
    -    display.setFont(Mono5x7);
    -    display.drawText(0, 0, "Hello");
    -    display.drawText(3, 8, "World");
    -}
    -
    -static const char message[] = "Eat at Joes!";
    -
    -void drawMarquee()
    -{
    -    int width = display.width();
    -    display.setFont(DejaVuSans9);
    -    int msgWidth = display.textWidth(message);
    -    int fullScroll = msgWidth + width + 1;
    -    for (int x = 0; x < fullScroll; ++x) {
    -        display.clear();
    -        display.drawText(width - x, 3, message);
    -        delay(50);
    -    }
    -}
    -
    - - - - -
    - -
    - - +
    /*
    +
    This example demonstrates how to use the DMD and related classes to
    +
    draw things on a Freetronics Large Dot Matrix Display.
    +
    +
    This example is placed into the public domain.
    +
    */
    +
    +
    #include <DMD.h>
    +
    #include <DejaVuSans9.h>
    +
    #include <DejaVuSansBold9.h>
    +
    #include <DejaVuSansItalic9.h>
    +
    #include <Mono5x7.h>
    +
    +
    DMD display;
    +
    +
    ISR(TIMER1_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.enableTimer1();
    +
    }
    +
    +
    void loop() {
    +
    drawShapes();
    +
    delay(1000);
    +
    +
    drawBricks();
    +
    delay(1000);
    +
    +
    drawStickFigures();
    +
    delay(1000);
    +
    +
    drawText();
    +
    delay(1000);
    +
    +
    drawBoldText();
    +
    delay(1000);
    +
    +
    drawItalicText();
    +
    delay(1000);
    +
    +
    drawMonoText();
    +
    delay(1000);
    +
    +
    drawMarquee();
    +
    delay(500);
    +
    }
    +
    +
    void drawShapes()
    +
    {
    +
    display.clear();
    +
    display.drawCircle(6, 8, 3);
    +
    display.drawFilledCircle(16, 8, 3);
    +
    display.drawLine(22, 5, 28, 11);
    +
    display.drawLine(28, 5, 22, 11);
    +
    display.drawRect(0, 0, display.width() - 1, display.height() - 1);
    +
    }
    +
    +
    void drawBricks()
    +
    {
    +
    static const uint8_t bricks[] PROGMEM = {
    +
    16, 6,
    +
    B11111111, B11111111,
    +
    B10000000, B10000000,
    +
    B10000000, B10000000,
    +
    B11111111, B11111111,
    +
    B00001000, B00001000,
    +
    B00001000, B00001000
    +
    };
    +
    display.fill(0, 0, display.width(), display.height(), bricks);
    +
    }
    +
    +
    void drawStickFigures()
    +
    {
    +
    static const uint8_t stickFigure[] PROGMEM = {
    +
    9, 13,
    +
    B00111110, B00000000,
    +
    B01000001, B00000000,
    +
    B01000001, B00000000,
    +
    B00111110, B00000000,
    +
    B00001000, B00000000,
    +
    B00001000, B00000000,
    +
    B11111111, B10000000,
    +
    B00001000, B00000000,
    +
    B00001000, B00000000,
    +
    B00010100, B00000000,
    +
    B00100010, B00000000,
    +
    B01000001, B00000000,
    +
    B10000000, B10000000
    +
    };
    +
    display.clear();
    +
    display.drawBitmap(2, 1, stickFigure);
    +
    display.drawInvertedBitmap(12, 1, stickFigure);
    +
    display.drawBitmap(22, 1, stickFigure);
    +
    }
    +
    +
    void drawText()
    +
    {
    +
    display.clear();
    +
    display.setFont(DejaVuSans9);
    +
    display.drawText(0, 0, "Hello");
    +
    display.drawText(9, 8, "World");
    +
    }
    +
    +
    void drawBoldText()
    +
    {
    +
    display.clear();
    +
    display.setFont(DejaVuSansBold9);
    +
    display.drawText(0, 0, "Hello");
    +
    display.drawText(4, 8, "World");
    +
    }
    +
    +
    void drawItalicText()
    +
    {
    +
    display.clear();
    +
    display.setFont(DejaVuSansItalic9);
    +
    display.drawText(0, 0, "Hello");
    +
    display.drawText(2, 8, "World");
    +
    }
    +
    +
    void drawMonoText()
    +
    {
    +
    display.clear();
    +
    display.setFont(Mono5x7);
    +
    display.drawText(0, 0, "Hello");
    +
    display.drawText(3, 8, "World");
    +
    }
    +
    +
    static const char message[] = "Eat at Joes!";
    +
    +
    void drawMarquee()
    +
    {
    +
    int width = display.width();
    +
    display.setFont(DejaVuSans9);
    +
    int msgWidth = display.textWidth(message);
    +
    int fullScroll = msgWidth + width + 1;
    +
    for (int x = 0; x < fullScroll; ++x) {
    +
    display.clear();
    +
    display.drawText(width - x, 3, message);
    +
    delay(50);
    +
    }
    +
    }
    +
    + + diff --git a/dmd_running_figure.html b/dmd_running_figure.html index 1fdfb0d8..c6875c0b 100644 --- a/dmd_running_figure.html +++ b/dmd_running_figure.html @@ -2,29 +2,37 @@ + ArduinoLibs: Running figure example + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Running figure example
    -
    -
    -

    This example demonstrates how to draw animated bitmaps to Freetronics Large Dot Matrix Displays. These displays have 512 LED's arranged in a 32x16 matrix and controlled by an SPI interface. The displays are available in red, blue, green, yellow, and white variations.

    -

    The first step is to initialize the display:

    -
    #include <DMD.h>
    -
    -DMD display;
    -

    -

    We will also need some bitmaps to animate the running figure. We will use static bitmaps stored in program memory. The first frame of the 10-frame animation is:

    -
    byte const run1[] PROGMEM = {
    -    16, 16,
    -    B00000000, B00001100,
    -    B00000000, B00011110,
    -    B00000111, B11111110,
    -    B00001111, B11111110,
    -    B00011100, B11111100,
    -    B00000001, B11111100,
    -    B00000001, B11110000,
    -    B00000011, B11111000,
    -    B00000111, B00011000,
    -    B00001110, B01110000,
    -    B00011100, B01100000,
    -    B00111000, B00000000,
    -    B01110000, B00000000,
    -    B01100000, B00000000,
    -    B01000000, B00000000,
    -    B00000000, B00000000
    -};
    -

    -

    As can be seen, the bitmap is made up of 0's and 1's; a 1 bit indicates that the corresponding LED will be lit when it is drawn to the dot matrix display. The first two bytes are the width and height of the bitmap in pixels. In this case, the first frame is 16x16 pixels. Other frames in the animation are 18x16 and 13x16.

    -

    We store pointers to all of the frames in a common array:

    -
    const prog_uint8_t *frames[] = {
    -    run1,
    -    run2,
    -    run3,
    -    run4,
    -    run5,
    -    run6,
    -    run7,
    -    run8,
    -    run9,
    -    run10
    -};
    -#define NUM_FRAMES  (sizeof(frames) / sizeof(frames[0]))
    -unsigned int frame = 0;
    -

    -

    All that remains is to run the animation loop:

    -
    #define ADVANCE_MS  (1000 / NUM_FRAMES)
    -unsigned long lastFrame;
    -
    -void setup() {
    -    lastFrame = millis() - ADVANCE_MS;
    -}
    -
    -void loop() {
    -    if ((millis() - lastFrame) >= ADVANCE_MS) {
    -        display.clear();
    -        int x = (32 - pgm_read_byte(frames[frame])) / 2;
    -        display.drawBitmap(x, 0, frames[frame]);
    -        lastFrame += ADVANCE_MS;
    -        frame = (frame + 1) % NUM_FRAMES;
    -    }
    -    display.loop();
    -}
    -

    -

    Each time ADVANCE_MS milliseconds expires, we clear the display and draw a bitmap centered on the screen. To help with the centering, we read the width value from the bitmap for the current frame (the height is always 16). We must also call DMD::loop() repeatedly from the application's main loop() function to ensure that the display is kept refreshed.

    -

    Sometimes it can be inconvenient to arrange for DMD::loop() to be called regularly. An alternative is to use Timer1 or Timer2 and interrupt-driven display refresh:

    -
    #define ADVANCE_MS  (1000 / NUM_FRAMES)
    -
    -ISR(TIMER1_OVF_vect)
    -{
    -    display.refresh();
    -}
    -
    -void setup() {
    -    display.enableTimer1();
    -}
    -
    -void loop() {
    -    display.clear();
    -    int x = (32 - pgm_read_byte(frames[frame])) / 2;
    -    display.drawBitmap(x, 0, frames[frame]);
    -    frame = (frame + 1) % NUM_FRAMES;
    -
    -    delay(ADVANCE_MS);
    -}
    -

    -

    In the case of Timer2, TIMER2_OVF_vect and enableTimer2() would be used in place of TIMER1_OVF_vect and enableTimer1().

    -

    The full source code for the example follows:

    -
    /*
    - * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
    - *
    - * 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 THE
    - * AUTHORS OR COPYRIGHT HOLDERS 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.
    - */
    -
    -#include <DMD.h>
    -
    -DMD display;
    -
    -// Running stick figure pictures are loosely based on those from this tutorial:
    -// http://www.fluidanims.com/FAelite/phpBB3/viewtopic.php?f=10&t=102
    -
    -byte const run1[] PROGMEM = {
    -    16, 16,
    -    B00000000, B00001100,
    -    B00000000, B00011110,
    -    B00000111, B11111110,
    -    B00001111, B11111110,
    -    B00011100, B11111100,
    -    B00000001, B11111100,
    -    B00000001, B11110000,
    -    B00000011, B11111000,
    -    B00000111, B00011000,
    -    B00001110, B01110000,
    -    B00011100, B01100000,
    -    B00111000, B00000000,
    -    B01110000, B00000000,
    -    B01100000, B00000000,
    -    B01000000, B00000000,
    -    B00000000, B00000000
    -};
    -
    -byte const run2[] PROGMEM = {
    -    18, 16,
    -    B00000000, B01110011, B10000000,
    -    B00000000, B11111111, B10000000,
    -    B00000000, B00011111, B10000000,
    -    B00000000, B00111111, B11000000,
    -    B00000000, B01111011, B11000000,
    -    B00000000, B11110011, B10000000,
    -    B00000001, B11100000, B00000000,
    -    B00000011, B11100000, B00000000,
    -    B00000111, B01110000, B00000000,
    -    B01111110, B00111000, B00000000,
    -    B11111100, B00011100, B00000000,
    -    B00000000, B00001110, B00000000,
    -    B00000000, B00000111, B00000000,
    -    B00000000, B00000011, B10000000,
    -    B00000000, B00000001, B00000000,
    -    B00000000, B00000000, B00000000
    -};
    -
    -byte const run3[] PROGMEM = {
    -    18, 16,
    -    B00000000, B00110000, B00000000,
    -    B00000000, B01111000, B00000000,
    -    B00000000, B00011111, B00000000,
    -    B00000000, B00011111, B00000000,
    -    B00000000, B00111111, B10000000,
    -    B00000000, B01111111, B11000000,
    -    B00000000, B11100011, B10000000,
    -    B00000001, B11000000, B00000000,
    -    B00000011, B11100000, B00000000,
    -    B11111111, B01110000, B00000000,
    -    B11111110, B00111000, B00000000,
    -    B00000000, B00011000, B00000000,
    -    B00000000, B00011100, B00000000,
    -    B00000000, B00001110, B00000000,
    -    B00000000, B00000100, B00000000,
    -    B00000000, B00000000, B00000000
    -};
    -
    -byte const run4[] PROGMEM = {
    -    16, 16,
    -    B00000001, B11100000,
    -    B00000011, B11111100,
    -    B00000000, B00111110,
    -    B00000000, B01111110,
    -    B00000000, B11111100,
    -    B00000001, B10011111,
    -    B00000011, B00001110,
    -    B00000011, B00000000,
    -    B00000011, B10000000,
    -    B11111111, B10000000,
    -    B11111000, B11000000,
    -    B00000001, B11000000,
    -    B00000011, B10000000,
    -    B00000111, B00000000,
    -    B00000110, B00000000,
    -    B00000100, B00000000
    -};
    -
    -byte const run5[] PROGMEM = {
    -    13, 16,
    -    B00000000, B00000000,
    -    B00000000, B00110000,
    -    B00000111, B11111000,
    -    B00000111, B11111000,
    -    B00000111, B11110000,
    -    B00001111, B11100000,
    -    B00000111, B00000000,
    -    B00001111, B00000000,
    -    B00001111, B00000000,
    -    B00001111, B10000000,
    -    B00011100, B00000000,
    -    B00111000, B00000000,
    -    B01110000, B00000000,
    -    B11100000, B00000000,
    -    B11000000, B00000000,
    -    B10000000, B00000000
    -};
    -
    -byte const run6[] PROGMEM = {
    -    16, 16,
    -    B00000000, B00000000,
    -    B00000000, B00011100,
    -    B00000000, B00111110,
    -    B00000001, B11111110,
    -    B00000000, B11100000,
    -    B00000001, B11100000,
    -    B00000001, B11111000,
    -    B00000011, B00011100,
    -    B00000110, B00111000,
    -    B00000110, B01110000,
    -    B00001100, B00100000,
    -    B00111000, B00000000,
    -    B01100000, B00000000,
    -    B11000000, B00000000,
    -    B10000000, B00000000,
    -    B10000000, B00000000
    -};
    -
    -byte const run7[] PROGMEM = {
    -    18, 16,
    -    B00000000, B00000011, B10000000,
    -    B00000000, B01111011, B10000000,
    -    B00000000, B01111111, B10000000,
    -    B00000000, B00001111, B00100000,
    -    B00000000, B00011001, B11000000,
    -    B00000000, B00110000, B11000000,
    -    B00000000, B01110000, B00000000,
    -    B00000001, B11110000, B00000000,
    -    B11111111, B10111000, B00000000,
    -    B11111111, B00011100, B00000000,
    -    B00000000, B00001110, B00000000,
    -    B00000000, B00000111, B00000000,
    -    B00000000, B00000011, B10000000,
    -    B00000000, B00000001, B11000000,
    -    B00000000, B00000000, B01000000,
    -    B00000000, B00000000, B00000000
    -};
    -
    -byte const run8[] PROGMEM = {
    -    18, 16,
    -    B00000000, B00000110, B00000000,
    -    B00000001, B11101111, B00000000,
    -    B00000001, B11111111, B00000000,
    -    B00000000, B00111110, B00000000,
    -    B00000000, B01111111, B11000000,
    -    B00000000, B11100011, B10000000,
    -    B00000001, B11000000, B00000000,
    -    B00000011, B11100000, B00000000,
    -    B11111111, B01110000, B00000000,
    -    B11111110, B00111000, B00000000,
    -    B00000000, B00011100, B00000000,
    -    B00000000, B00000110, B00000000,
    -    B00000000, B00000110, B00000000,
    -    B00000000, B00000111, B00000000,
    -    B00000000, B00000011, B00000000,
    -    B00000000, B00000001, B00000000
    -};
    -
    -byte const run9[] PROGMEM = {
    -    16, 16,
    -    B00000000, B00000000,
    -    B00000000, B01001110,
    -    B00000001, B11101110,
    -    B00000011, B11111110,
    -    B00000011, B11111110,
    -    B00000001, B10111100,
    -    B00000011, B00000000,
    -    B00000111, B00000000,
    -    B11111111, B10000000,
    -    B11111100, B11000000,
    -    B00000000, B11000000,
    -    B00000000, B11000000,
    -    B00000000, B11000000,
    -    B00000000, B11000000,
    -    B00000000, B11000000,
    -    B00000000, B11000000
    -};
    -
    -byte const run10[] PROGMEM = {
    -    13, 16,
    -    B00000000, B00000000,
    -    B00000000, B00110000,
    -    B00000000, B01111000,
    -    B00000111, B11111000,
    -    B00001111, B11111000,
    -    B00000111, B11000000,
    -    B00001110, B00000000,
    -    B00001100, B00000000,
    -    B00001100, B00000000,
    -    B01111100, B00000000,
    -    B11111100, B00000000,
    -    B00011000, B00000000,
    -    B00110000, B00000000,
    -    B01110000, B00000000,
    -    B01100000, B00000000,
    -    B01000000, B00000000
    -};
    -
    -const prog_uint8_t *frames[] = {
    -    run1,
    -    run2,
    -    run3,
    -    run4,
    -    run5,
    -    run6,
    -    run7,
    -    run8,
    -    run9,
    -    run10
    -};
    -#define NUM_FRAMES  (sizeof(frames) / sizeof(frames[0]))
    -unsigned int frame = 0;
    -
    -#define ADVANCE_MS  (1000 / NUM_FRAMES)
    -unsigned long lastFrame;
    -
    -void setup() {
    -    lastFrame = millis() - ADVANCE_MS;
    -}
    -
    -void loop() {
    -    if ((millis() - lastFrame) >= ADVANCE_MS) {
    -        display.clear();
    -        int x = (32 - pgm_read_byte(frames[frame])) / 2;
    -        display.drawBitmap(x, 0, frames[frame]);
    -        lastFrame += ADVANCE_MS;
    -        frame = (frame + 1) % NUM_FRAMES;
    -    }
    -    display.loop();
    -}
    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -419,8 +72,366 @@ byte const run10[] PROGMEM = {
    - + +
    +
    +
    Running figure example
    +
    +
    +

    This example demonstrates how to draw animated bitmaps to Freetronics Large Dot Matrix Displays. These displays have 512 LED's arranged in a 32x16 matrix and controlled by an SPI interface. The displays are available in red, blue, green, yellow, and white variations.

    +

    The first step is to initialize the display:

    +
    #include <DMD.h>
    +
    +
    DMD display;
    +

    +

    We will also need some bitmaps to animate the running figure. We will use static bitmaps stored in program memory. The first frame of the 10-frame animation is:

    +
    byte const run1[] PROGMEM = {
    +
    16, 16,
    +
    B00000000, B00001100,
    +
    B00000000, B00011110,
    +
    B00000111, B11111110,
    +
    B00001111, B11111110,
    +
    B00011100, B11111100,
    +
    B00000001, B11111100,
    +
    B00000001, B11110000,
    +
    B00000011, B11111000,
    +
    B00000111, B00011000,
    +
    B00001110, B01110000,
    +
    B00011100, B01100000,
    +
    B00111000, B00000000,
    +
    B01110000, B00000000,
    +
    B01100000, B00000000,
    +
    B01000000, B00000000,
    +
    B00000000, B00000000
    +
    };
    +

    +

    As can be seen, the bitmap is made up of 0's and 1's; a 1 bit indicates that the corresponding LED will be lit when it is drawn to the dot matrix display. The first two bytes are the width and height of the bitmap in pixels. In this case, the first frame is 16x16 pixels. Other frames in the animation are 18x16 and 13x16.

    +

    We store pointers to all of the frames in a common array:

    +
    Bitmap::ProgMem frames[] = {
    +
    run1,
    +
    run2,
    +
    run3,
    +
    run4,
    +
    run5,
    +
    run6,
    +
    run7,
    +
    run8,
    +
    run9,
    +
    run10
    +
    };
    +
    #define NUM_FRAMES (sizeof(frames) / sizeof(frames[0]))
    +
    unsigned int frame = 0;
    +

    +

    All that remains is to run the animation loop:

    +
    #define ADVANCE_MS (1000 / NUM_FRAMES)
    +
    unsigned long lastFrame;
    +
    +
    void setup() {
    +
    lastFrame = millis() - ADVANCE_MS;
    +
    }
    +
    +
    void loop() {
    +
    if ((millis() - lastFrame) >= ADVANCE_MS) {
    +
    display.clear();
    +
    int x = (32 - pgm_read_byte(frames[frame])) / 2;
    +
    display.drawBitmap(x, 0, frames[frame]);
    +
    lastFrame += ADVANCE_MS;
    +
    frame = (frame + 1) % NUM_FRAMES;
    +
    }
    +
    display.loop();
    +
    }
    +

    +

    Each time ADVANCE_MS milliseconds expires, we clear the display and draw a bitmap centered on the screen. To help with the centering, we read the width value from the bitmap for the current frame (the height is always 16). We must also call DMD::loop() repeatedly from the application's main loop() function to ensure that the display is kept refreshed.

    +

    Sometimes it can be inconvenient to arrange for DMD::loop() to be called regularly. An alternative is to use Timer1 or Timer2 and interrupt-driven display refresh:

    +
    #define ADVANCE_MS (1000 / NUM_FRAMES)
    +
    +
    ISR(TIMER1_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.enableTimer1();
    +
    }
    +
    +
    void loop() {
    +
    display.clear();
    +
    int x = (32 - pgm_read_byte(frames[frame])) / 2;
    +
    display.drawBitmap(x, 0, frames[frame]);
    +
    frame = (frame + 1) % NUM_FRAMES;
    +
    +
    delay(ADVANCE_MS);
    +
    }
    +

    +

    In the case of Timer2, TIMER2_OVF_vect and enableTimer2() would be used in place of TIMER1_OVF_vect and enableTimer1().

    +

    The full source code for the example follows:

    +
    /*
    +
    * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
    +
    *
    +
    * 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 THE
    +
    * AUTHORS OR COPYRIGHT HOLDERS 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.
    +
    */
    +
    +
    #include <DMD.h>
    +
    +
    DMD display;
    +
    +
    // Running stick figure pictures are loosely based on those from this tutorial:
    +
    // http://www.fluidanims.com/FAelite/phpBB3/viewtopic.php?f=10&t=102
    +
    +
    byte const run1[] PROGMEM = {
    +
    16, 16,
    +
    B00000000, B00001100,
    +
    B00000000, B00011110,
    +
    B00000111, B11111110,
    +
    B00001111, B11111110,
    +
    B00011100, B11111100,
    +
    B00000001, B11111100,
    +
    B00000001, B11110000,
    +
    B00000011, B11111000,
    +
    B00000111, B00011000,
    +
    B00001110, B01110000,
    +
    B00011100, B01100000,
    +
    B00111000, B00000000,
    +
    B01110000, B00000000,
    +
    B01100000, B00000000,
    +
    B01000000, B00000000,
    +
    B00000000, B00000000
    +
    };
    +
    +
    byte const run2[] PROGMEM = {
    +
    18, 16,
    +
    B00000000, B01110011, B10000000,
    +
    B00000000, B11111111, B10000000,
    +
    B00000000, B00011111, B10000000,
    +
    B00000000, B00111111, B11000000,
    +
    B00000000, B01111011, B11000000,
    +
    B00000000, B11110011, B10000000,
    +
    B00000001, B11100000, B00000000,
    +
    B00000011, B11100000, B00000000,
    +
    B00000111, B01110000, B00000000,
    +
    B01111110, B00111000, B00000000,
    +
    B11111100, B00011100, B00000000,
    +
    B00000000, B00001110, B00000000,
    +
    B00000000, B00000111, B00000000,
    +
    B00000000, B00000011, B10000000,
    +
    B00000000, B00000001, B00000000,
    +
    B00000000, B00000000, B00000000
    +
    };
    +
    +
    byte const run3[] PROGMEM = {
    +
    18, 16,
    +
    B00000000, B00110000, B00000000,
    +
    B00000000, B01111000, B00000000,
    +
    B00000000, B00011111, B00000000,
    +
    B00000000, B00011111, B00000000,
    +
    B00000000, B00111111, B10000000,
    +
    B00000000, B01111111, B11000000,
    +
    B00000000, B11100011, B10000000,
    +
    B00000001, B11000000, B00000000,
    +
    B00000011, B11100000, B00000000,
    +
    B11111111, B01110000, B00000000,
    +
    B11111110, B00111000, B00000000,
    +
    B00000000, B00011000, B00000000,
    +
    B00000000, B00011100, B00000000,
    +
    B00000000, B00001110, B00000000,
    +
    B00000000, B00000100, B00000000,
    +
    B00000000, B00000000, B00000000
    +
    };
    +
    +
    byte const run4[] PROGMEM = {
    +
    16, 16,
    +
    B00000001, B11100000,
    +
    B00000011, B11111100,
    +
    B00000000, B00111110,
    +
    B00000000, B01111110,
    +
    B00000000, B11111100,
    +
    B00000001, B10011111,
    +
    B00000011, B00001110,
    +
    B00000011, B00000000,
    +
    B00000011, B10000000,
    +
    B11111111, B10000000,
    +
    B11111000, B11000000,
    +
    B00000001, B11000000,
    +
    B00000011, B10000000,
    +
    B00000111, B00000000,
    +
    B00000110, B00000000,
    +
    B00000100, B00000000
    +
    };
    +
    +
    byte const run5[] PROGMEM = {
    +
    13, 16,
    +
    B00000000, B00000000,
    +
    B00000000, B00110000,
    +
    B00000111, B11111000,
    +
    B00000111, B11111000,
    +
    B00000111, B11110000,
    +
    B00001111, B11100000,
    +
    B00000111, B00000000,
    +
    B00001111, B00000000,
    +
    B00001111, B00000000,
    +
    B00001111, B10000000,
    +
    B00011100, B00000000,
    +
    B00111000, B00000000,
    +
    B01110000, B00000000,
    +
    B11100000, B00000000,
    +
    B11000000, B00000000,
    +
    B10000000, B00000000
    +
    };
    +
    +
    byte const run6[] PROGMEM = {
    +
    16, 16,
    +
    B00000000, B00000000,
    +
    B00000000, B00011100,
    +
    B00000000, B00111110,
    +
    B00000001, B11111110,
    +
    B00000000, B11100000,
    +
    B00000001, B11100000,
    +
    B00000001, B11111000,
    +
    B00000011, B00011100,
    +
    B00000110, B00111000,
    +
    B00000110, B01110000,
    +
    B00001100, B00100000,
    +
    B00111000, B00000000,
    +
    B01100000, B00000000,
    +
    B11000000, B00000000,
    +
    B10000000, B00000000,
    +
    B10000000, B00000000
    +
    };
    +
    +
    byte const run7[] PROGMEM = {
    +
    18, 16,
    +
    B00000000, B00000011, B10000000,
    +
    B00000000, B01111011, B10000000,
    +
    B00000000, B01111111, B10000000,
    +
    B00000000, B00001111, B00100000,
    +
    B00000000, B00011001, B11000000,
    +
    B00000000, B00110000, B11000000,
    +
    B00000000, B01110000, B00000000,
    +
    B00000001, B11110000, B00000000,
    +
    B11111111, B10111000, B00000000,
    +
    B11111111, B00011100, B00000000,
    +
    B00000000, B00001110, B00000000,
    +
    B00000000, B00000111, B00000000,
    +
    B00000000, B00000011, B10000000,
    +
    B00000000, B00000001, B11000000,
    +
    B00000000, B00000000, B01000000,
    +
    B00000000, B00000000, B00000000
    +
    };
    +
    +
    byte const run8[] PROGMEM = {
    +
    18, 16,
    +
    B00000000, B00000110, B00000000,
    +
    B00000001, B11101111, B00000000,
    +
    B00000001, B11111111, B00000000,
    +
    B00000000, B00111110, B00000000,
    +
    B00000000, B01111111, B11000000,
    +
    B00000000, B11100011, B10000000,
    +
    B00000001, B11000000, B00000000,
    +
    B00000011, B11100000, B00000000,
    +
    B11111111, B01110000, B00000000,
    +
    B11111110, B00111000, B00000000,
    +
    B00000000, B00011100, B00000000,
    +
    B00000000, B00000110, B00000000,
    +
    B00000000, B00000110, B00000000,
    +
    B00000000, B00000111, B00000000,
    +
    B00000000, B00000011, B00000000,
    +
    B00000000, B00000001, B00000000
    +
    };
    +
    +
    byte const run9[] PROGMEM = {
    +
    16, 16,
    +
    B00000000, B00000000,
    +
    B00000000, B01001110,
    +
    B00000001, B11101110,
    +
    B00000011, B11111110,
    +
    B00000011, B11111110,
    +
    B00000001, B10111100,
    +
    B00000011, B00000000,
    +
    B00000111, B00000000,
    +
    B11111111, B10000000,
    +
    B11111100, B11000000,
    +
    B00000000, B11000000,
    +
    B00000000, B11000000,
    +
    B00000000, B11000000,
    +
    B00000000, B11000000,
    +
    B00000000, B11000000,
    +
    B00000000, B11000000
    +
    };
    +
    +
    byte const run10[] PROGMEM = {
    +
    13, 16,
    +
    B00000000, B00000000,
    +
    B00000000, B00110000,
    +
    B00000000, B01111000,
    +
    B00000111, B11111000,
    +
    B00001111, B11111000,
    +
    B00000111, B11000000,
    +
    B00001110, B00000000,
    +
    B00001100, B00000000,
    +
    B00001100, B00000000,
    +
    B01111100, B00000000,
    +
    B11111100, B00000000,
    +
    B00011000, B00000000,
    +
    B00110000, B00000000,
    +
    B01110000, B00000000,
    +
    B01100000, B00000000,
    +
    B01000000, B00000000
    +
    };
    +
    +
    Bitmap::ProgMem frames[] = {
    +
    run1,
    +
    run2,
    +
    run3,
    +
    run4,
    +
    run5,
    +
    run6,
    +
    run7,
    +
    run8,
    +
    run9,
    +
    run10
    +
    };
    +
    #define NUM_FRAMES (sizeof(frames) / sizeof(frames[0]))
    +
    unsigned int frame = 0;
    +
    +
    #define ADVANCE_MS (1000 / NUM_FRAMES)
    +
    unsigned long lastFrame;
    +
    +
    void setup() {
    +
    lastFrame = millis() - ADVANCE_MS;
    +
    }
    +
    +
    void loop() {
    +
    if ((millis() - lastFrame) >= ADVANCE_MS) {
    +
    display.clear();
    +
    int x = (32 - pgm_read_byte(frames[frame])) / 2;
    +
    display.drawBitmap(x, 0, frames[frame]);
    +
    lastFrame += ADVANCE_MS;
    +
    frame = (frame + 1) % NUM_FRAMES;
    +
    }
    +
    display.loop();
    +
    }
    +
    + + diff --git a/doxygen.css b/doxygen.css index 74445fe1..0c559a0a 100644 --- a/doxygen.css +++ b/doxygen.css @@ -1,8 +1,7 @@ /* The standard CSS for doxygen */ body, table, div, p, dl { - font-family: Lucida Grande, Verdana, Geneva, Arial, sans-serif; - font-size: 12px; + font: 400 14px/19px Roboto,sans-serif; } /* @group Heading Levels */ @@ -18,13 +17,33 @@ h1 { } h2 { - font-size: 120%; + border-bottom: 1px solid #879ECB; + color: #354C7B; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; } h3 { font-size: 100%; } +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + dt { font-weight: bold; } @@ -72,8 +91,6 @@ div.qindex, div.navtab{ background-color: #EBEFF6; border: 1px solid #A3B4D7; text-align: center; - margin: 2px; - padding: 2px; } div.qindex, div.navpath { @@ -123,12 +140,12 @@ a.el { a.elRef { } -a.code { - color: #4665A2; +a.code, a.code:visited { + color: #4665A2; } -a.codeRef { - color: #4665A2; +a.codeRef, a.codeRef:visited { + color: #4665A2; } /* @end */ @@ -137,20 +154,72 @@ dl.el { margin-left: -1cm; } -.fragment { - font-family: monospace, fixed; - font-size: 105%; +pre.fragment { + border: 1px solid #C4CFE5; + background-color: #FBFCFD; + padding: 4px 6px; + margin: 4px 8px 4px 2px; + overflow: auto; + word-wrap: break-word; + font-size: 9pt; + line-height: 125%; + font-family: monospace, fixed; + font-size: 105%; } -pre.fragment { - border: 1px solid #C4CFE5; +div.fragment { + padding: 4px; + margin: 4px; background-color: #FBFCFD; - padding: 4px 6px; - margin: 4px 8px 4px 2px; - overflow: auto; - word-wrap: break-word; - font-size: 9pt; - line-height: 125%; + border: 1px solid #C4CFE5; +} + +div.line { + font-family: monospace, fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.0; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + + +span.lineno { + padding-right: 4px; + text-align: right; + border-right: 2px solid #0F0; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a { + background-color: #D8D8D8; +} + +span.lineno a:hover { + background-color: #C8C8C8; } div.ah { @@ -183,15 +252,15 @@ div.groupText { } body { - background: white; + background-color: white; color: black; margin: 0; } div.contents { margin-top: 10px; - margin-left: 10px; - margin-right: 5px; + margin-left: 12px; + margin-right: 8px; } td.indexkey { @@ -200,6 +269,8 @@ td.indexkey { border: 1px solid #C4CFE5; margin: 2px 0px 2px 0; padding: 2px 10px; + white-space: nowrap; + vertical-align: top; } td.indexvalue { @@ -292,6 +363,13 @@ span.vhdllogic { color: #ff0000 } +blockquote { + background-color: #F7F8FB; + border-left: 2px solid #9CAFD4; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + /* @end */ /* @@ -345,6 +423,24 @@ table.memberdecls { padding: 0px; } +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + .mdescLeft, .mdescRight, .memItemLeft, .memItemRight, .memTemplItemLeft, .memTemplItemRight, .memTemplParams { @@ -360,7 +456,7 @@ table.memberdecls { } .memItemLeft, .memItemRight, .memTemplParams { - border-top: 1px solid #C4CFE5; + border-bottom: 1px solid #DEE4F0; } .memItemLeft, .memTemplItemLeft { @@ -406,15 +502,29 @@ table.memberdecls { padding: 0; margin-bottom: 10px; margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; } .memname { - white-space: nowrap; font-weight: bold; margin-left: 6px; } -.memproto { +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { border-top: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; @@ -422,45 +532,55 @@ table.memberdecls { color: #253555; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - /* opera specific markup */ - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 8px; - border-top-left-radius: 8px; - /* firefox specific markup */ - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - -moz-border-radius-topright: 8px; - -moz-border-radius-topleft: 8px; - /* webkit specific markup */ - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - -webkit-border-top-right-radius: 8px; - -webkit-border-top-left-radius: 8px; background-image:url('nav_f.png'); background-repeat:repeat-x; background-color: #E2E8F2; + /* opera specific markup */ + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; + border-top-left-radius: 4px; + /* firefox specific markup */ + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; + /* webkit specific markup */ + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; } -.memdoc { +.memdoc, dl.reflist dd { border-bottom: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; border-right: 1px solid #A8B8D9; - padding: 2px 5px; + padding: 6px 10px 2px 10px; background-color: #FBFCFD; border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: #FFFFFF; /* opera specific markup */ - border-bottom-left-radius: 8px; - border-bottom-right-radius: 8px; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); /* firefox specific markup */ - -moz-border-radius-bottomleft: 8px; - -moz-border-radius-bottomright: 8px; + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - background-image: -moz-linear-gradient(center top, #FFFFFF 0%, #FFFFFF 60%, #F7F8FB 95%, #EEF1F7); /* webkit specific markup */ - -webkit-border-bottom-left-radius: 8px; - -webkit-border-bottom-right-radius: 8px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - background-image: -webkit-gradient(linear,center top,center bottom,from(#FFFFFF), color-stop(0.6,#FFFFFF), color-stop(0.60,#FFFFFF), color-stop(0.95,#F7F8FB), to(#EEF1F7)); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; } .paramkey { @@ -478,9 +598,13 @@ table.memberdecls { .paramname em { font-style: normal; } +.paramname code { + line-height: 14px; +} .params, .retval, .exception, .tparams { - border-spacing: 6px 2px; + margin-left: 0px; + padding-left: 0px; } .params .paramname, .retval .paramname { @@ -498,105 +622,115 @@ table.memberdecls { vertical-align: top; } +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #728DC1; + border-top:1px solid #5373B4; + border-left:1px solid #5373B4; + border-right:1px solid #C4CFE5; + border-bottom:1px solid #C4CFE5; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; +} /* @end */ -/* @group Directory (tree) */ +/* these are for tree view when not used as main index */ -/* for the tree view */ - -.ftvtree { - font-family: sans-serif; - margin: 0px; +div.directory { + margin: 10px 0px; + border-top: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + width: 100%; } -/* these are for tree view when used as main index */ - -.directory { - font-size: 9pt; - font-weight: bold; - margin: 5px; +.directory table { + border-collapse:collapse; } -.directory h3 { - margin: 0px; - margin-top: 1em; - font-size: 11pt; +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; } -/* -The following two styles can be used to replace the root node title -with an image of your choice. Simply uncomment the next two styles, -specify the name of your image and be sure to set 'height' to the -proper pixel height of your image. -*/ - -/* -.directory h3.swap { - height: 61px; - background-repeat: no-repeat; - background-image: url("yourimage.gif"); -} -.directory h3.swap span { - display: none; -} -*/ - -.directory > h3 { - margin-top: 0; +.directory td.entry { + white-space: nowrap; + padding-right: 6px; } -.directory p { - margin: 0px; - white-space: nowrap; +.directory td.entry a { + outline:none; } -.directory div { - display: none; - margin: 0px; +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.even { + padding-left: 6px; + background-color: #F7F8FB; } .directory img { vertical-align: -30%; } -/* these are for tree view when not used as main index */ - -.directory-alt { - font-size: 100%; - font-weight: bold; +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; } -.directory-alt h3 { - margin: 0px; - margin-top: 1em; - font-size: 11pt; +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #3D578C; } -.directory-alt > h3 { - margin-top: 0; -} - -.directory-alt p { - margin: 0px; - white-space: nowrap; -} - -.directory-alt div { - display: none; - margin: 0px; -} - -.directory-alt img { - vertical-align: -30%; -} - -/* @end */ - div.dynheader { margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; } address { @@ -606,6 +740,8 @@ address { table.doxtable { border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; } table.doxtable td, table.doxtable th { @@ -619,9 +755,60 @@ table.doxtable th { font-size: 110%; padding-bottom: 4px; padding-top: 5px; - text-align:left; } +table.fieldtable { + width: 100%; + margin-bottom: 10px; + border: 1px solid #A8B8D9; + border-spacing: 0px; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + border-radius: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 2px 2px 2px; + -webkit-box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname { + white-space: nowrap; + border-right: 1px solid #A8B8D9; + border-bottom: 1px solid #A8B8D9; + vertical-align: top; +} + +.fieldtable td.fielddoc { + border-bottom: 1px solid #A8B8D9; + width: 100%; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; + font-size: 90%; + color: #253555; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + -moz-border-radius-topleft: 4px; + -moz-border-radius-topright: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #A8B8D9; +} + + .tabsearch { top: 0px; left: 10px; @@ -664,6 +851,7 @@ table.doxtable th { display:block; text-decoration: none; outline: none; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; } .navpath li.navelem a:hover @@ -702,7 +890,6 @@ div.summary a div.ingroups { font-size: 8pt; - padding-left: 5px; width: 50%; text-align: left; } @@ -731,47 +918,74 @@ dl padding: 0 0 0 10px; } -dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug +/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */ +dl.section { - border-left:4px solid; - padding: 0 0 0 6px; + margin-left: 0px; + padding-left: 0px; } dl.note { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; border-color: #D0C000; } dl.warning, dl.attention { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; border-color: #FF0000; } dl.pre, dl.post, dl.invariant { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; border-color: #00D000; } dl.deprecated { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; border-color: #505050; } dl.todo { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; border-color: #00C0E0; } dl.test { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; border-color: #3030E0; } dl.bug { + margin-left:-7px; + padding-left: 3px; + border-left:4px solid; border-color: #C08050; } +dl.section dd { + margin-bottom: 6px; +} + + #projectlogo { text-align: center; @@ -833,3 +1047,117 @@ dl.bug font-weight: bold; } +div.zoom +{ + border: 1px solid #90A5CE; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#334975; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; +} + +dl.citelist dd { + margin:2px 0; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F4F6FA; + border: 1px solid #D8DFEE; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 20px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("bdwn.png") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Arial,FreeSans,sans-serif; + color: #4665A2; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.level2 { + margin-left: 15px; +} + +div.toc li.level3 { + margin-left: 30px; +} + +div.toc li.level4 { + margin-left: 45px; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + diff --git a/doxygen.png b/doxygen.png index 635ed52fce7057ac24df92ec7664088a881fa5d0..3ff17d807fd8aa003bed8bb2a69e8f0909592fd1 100644 GIT binary patch literal 3779 zcmV;!4m|ORP)tMIv#Q0*~7*`IBSO7_x;@a8#Zk6_PeKR_s92J&)(m+);m9Iz3blw)z#Gi zP!9lj4$%+*>Hz@HCmM9L9|8c+0u=!H$O3?R0Kgx|#WP<6fKfC8fM-CQZT|_r@`>VO zX^Hgb|9cJqpdJA5$MCEK`F_2@2Y@s>^+;pF`~jdI0Pvr|vl4`=C)EH@1IFe7pdJ8F zH(qGi004~QnF)Ggga~8v08kGAs2hKTATxr7pwfNk|4#_AaT>w8P6TV+R2kbS$v==} zAjf`s0g#V8lB+b3)5oEI*q+{Yt$MZDruD2^;$+(_%Qn+%v0X-bJO=;@kiJ^ygLBnC z?1OVv_%aex1M@jKU|Z~$eI?PoF4Vj>fDzyo zAiLfpXY*a^Sj-S5D0S3@#V$sRW)g)_1e#$%8xdM>Jm7?!h zu0P2X=xoN>^!4DoPRgph2(2va07yfpXF+WH7EOg1GY%Zn z7~1A<(z7Q$ktEXhW_?GMpHp9l_UL18F3KOsxu81pqoBiNbFSGsof-W z6~eloMoz=4?OOnl2J268x5rOY`dCk0us(uS#Ud4yqOr@?=Q57a}tit|BhY>}~frH1sP`ScHS_d)oqH^lYy zZ%VP`#10MlE~P?cE(%(#(AUSv_T{+;t@$U}El}(1ig`vZo`Rm;+5&(AYzJ^Ae=h2X z@Re%vHwZU>|f0NI&%$*4eJweC5OROQrpPMA@*w|o z()A==l}(@bv^&>H1Ob3C=<^|hob?0+xJ?QQ3-ueQC}zy&JQNib!OqSO@-=>XzxlSF zAZ^U*1l6EEmg3r};_HY>&Jo_{dOPEFTWPmt=U&F#+0(O59^UIlHbNX+eF8UzyDR*T z(=5X$VF3!gm@RooS-&iiUYGG^`hMR(07zr_xP`d!^BH?uD>Phl8Rdifx3Af^Zr`Ku ztL+~HkVeL#bJ)7;`=>;{KNRvjmc}1}c58Sr#Treq=4{xo!ATy|c>iRSp4`dzMMVd@ zL8?uwXDY}Wqgh4mH`|$BTXpUIu6A1-cSq%hJw;@^Zr8TP=GMh*p(m(tN7@!^D~sl$ zz^tf4II4|};+irE$Fnm4NTc5%p{PRA`%}Zk`CE5?#h3|xcyQsS#iONZ z6H(@^i9td!$z~bZiJLTax$o>r(p}3o@< zyD7%(>ZYvy=6$U3e!F{Z`uSaYy`xQyl?b{}eg|G3&fz*`QH@mDUn)1%#5u`0m$%D} z?;tZ0u(mWeMV0QtzjgN!lT*pNRj;6510Wwx?Yi_=tYw|J#7@(Xe7ifDzXuK;JB;QO z#bg~K$cgm$@{QiL_3yr}y&~wuv=P=#O&Tj=Sr)aCUlYmZMcw?)T?c%0rUe1cS+o!qs_ zQ6Gp)-{)V!;=q}llyK3|^WeLKyjf%y;xHku;9(vM!j|~<7w1c*Mk-;P{T&yG) z@C-8E?QPynNQ<8f01D`2qexcVEIOU?y}MG)TAE6&VT5`rK8s(4PE;uQ92LTXUQ<>^ ztyQ@=@kRdh@ebUG^Z6NWWIL;_IGJ2ST>$t!$m$qvtj0Qmw8moN6GUV^!QKNK zHBXCtUH8)RY9++gH_TUV4^=-j$t}dD3qsN7GclJ^Zc&(j6&a_!$jCf}%c5ey`pm~1)@{yI3 zTdWyB+*X{JFw#z;PwRr5evb2!ueWF;v`B0HoUu4-(~aL=z;OXUUEtG`_$)Oxw6FKg zEzY`CyKaSBK3xt#8gA|r_|Kehn_HYVBMpEwbn9-fI*!u*eTA1ef8Mkl1=!jV4oYwWYM}i`A>_F4nhmlCIC6WLa zY%;4&@AlnaG11ejl61Jev21|r*m+?Kru3;1tFDl}#!OzUp6c>go4{C|^erwpG*&h6bspUPJag}oOkN2912Y3I?(eRc@U9>z#HPBHC?nps7H5!zP``90!Q1n80jo+B3TWXp!8Pe zwuKuLLI6l3Gv@+QH*Y}2wPLPQ1^EZhT#+Ed8q8Wo z1pTmIBxv14-{l&QVKxAyQF#8Q@NeJwWdKk>?cpiJLkJr+aZ!Me+Cfp!?FWSRf^j2k z73BRR{WSKaMkJ>1Nbx5dan5hg^_}O{Tj6u%iV%#QGz0Q@j{R^Ik)Z*+(YvY2ziBG)?AmJa|JV%4UT$k`hcOg5r9R?5>?o~JzK zJCrj&{i#hG>N7!B4kNX(%igb%kDj0fOQThC-8mtfap82PNRXr1D>lbgg)dYTQ(kbx z`Ee5kXG~Bh+BHQBf|kJEy6(ga%WfhvdQNDuOfQoe377l#ht&DrMGeIsI5C<&ai zWG$|hop2@@q5YDa)_-A?B02W;#fH!%k`daQLEItaJJ8Yf1L%8x;kg?)k)00P-lH+w z)5$QNV6r2$YtnV(4o=0^3{kmaXn*Dm0F*fU(@o)yVVjk|ln8ea6BMy%vZAhW9|wvA z8RoDkVoMEz1d>|5(k0Nw>22ZT){V<3$^C-cN+|~hKt2)){+l-?3m@-$c?-dlzQ)q- zZ)j%n^gerV{|+t}9m1_&&Ly!9$rtG4XX|WQ8`xYzGC~U@nYh~g(z9)bdAl#xH)xd5a=@|qql z|FzEil{P5(@gy!4ek05i$>`E^G~{;pnf6ftpLh$h#W?^#4UkPfa;;?bsIe&kz!+40 zI|6`F2n020)-r`pFaZ38F!S-lJM-o&inOw|66=GMeP@xQU5ghQH{~5Uh~TMTd;I9` z>YhVB`e^EVj*S7JF39ZgNf}A-0DwOcTT63ydN$I3b?yBQtUI*_fae~kPvzoD$zjX3 zoqBe#>12im4WzZ=f^4+u=!lA|#r%1`WB0-6*3BL#at`47#ebPpR|D1b)3BjT34nYY z%Ds%d?5$|{LgOIaRO{{oC&RK`O91$fqwM0(C_TALcozu*fWHb%%q&p-q{_8*2Zsi^ zh1ZCnr^UYa;4vQEtHk{~zi>wwMC5o{S=$P0X681y`SXwFH?Ewn{x-MOZynmc)JT5v zuHLwh;tLfxRrr%|k370}GofLl7thg>ACWWY&msqaVu&ry+`7+Ss>NL^%T1|z{IGMA zW-SKl=V-^{(f!Kf^#3(|T2W47d(%JVCI4JgRrT1pNz>+ietmFToNv^`gzC@&O-)+i zPQ~RwK8%C_vf%;%e>NyTp~dM5;!C|N0Q^6|CEb7Bw=Vz~$1#FA;Z*?mKSC)Hl-20s t8QyHj(g6VK0RYbl8UjE)0O0w=e*@m04r>stuEhWV002ovPDHLkV1hl;dM*F} literal 3942 zcmV-s51H_ZP)95ENDh(OT9xpYZC{M(=rqI* z+1erNEr&9zRjUI-4rN=4BBz>P@ys*xOjGRjzVE*Fx_qvyt9d@B@BO*&@8Mq!nM{Tc z_WoM84-~xLreSL9@vgZ{m2dF}`u=^ZF3syQ-s2tnBwCI3ZFvSfI20Wbj236~Urq*8Kfw@RKKfRQTgE>}uUHK^ptamY=o)LU(xy55zNQ(`qZ znZ&$O075mrrInIXQgw4%GCbMD8Vn`3n3$EaRwtP1D{A!Gs=e!L%3;ayv@I{rAw{xw z^x^>EIWQM8ob3m}$(BaupDMV;Ed8w5|i(*e`7rU$TOc&1o7`|!LyN5jHI z7uWAR!v4c2xMp?}QmRYyf>i}tYGU(g=>DW&==J@GbhR z5@BNVY3O$`^D%gk4khm9XpFhuwzxUhi9T=Du4rpVuYRSMPHeDqo+4htnZRU@G9`0& z9~p)CsFl1|t*wjfoTo&%davN^3RfJUhQ{ZZIAcD77X^XsF_iR&ZMQ;p>K5*+*48)x z+=<>nh+6Uq85jOkg>{z>a;+V`s(I;I%*5s+R@9a^wNoZ03(g9-EcH%uHvX&yp7`D#`9Kw>DU3s zjD-VuW_A-K)unlS4O3f>_B%pPONUmI#oyL};Lglp3=04>0eBBEw$D1k-$WTsoi#K* z$7h`NcyRZsZ#w~6I<%~u!^xDofYrzF>zVIj2N>Ijs`mVR(Oy&*9f}<{JtQj8jJT!oEc!NQXBq5y|6ET*N?7ox*E6#{i- z@_DLD^IYTtg|Pg?A~!7@OCd8p^)kxK%VBM84docx$Z{MvO)iiqep@or-N}TEU8$%; zJih?#yJ9)V1s_`}c3XbY9V}nEKwNz8ILmR|v)(w|D@oVG;=i`+$*)!(xH{9#$2Za;pyZ1wgU#)mHl|&8%iwu%yncO z`T32Ib0$D}j`c}}5M@M#7oR&G=QwU!!Ja*P7|NJt1@lo=d{_dY-q_lmDcH7{BHncF zR@^PmcLC6EsN?6N{fV3o8}>?h9X_@;=&-p7%tms7$_{3w(anwek_k&<&)~c$Ar?S> zy9gKavndTmxqAbE?SMgcWhXPENdKdz7ntt55Y3Hs3jjc~uR-#$tR(1a_abv9`-QzG z^J0Fsbd&yruq%xAsxf3rc=T}$Zx|AD%x{Fd=? z{qhl3kG5w-PqVK9-Gru%7UIEw)bt$ZMF|Z6HpmO)F%@GNT8yT|#FuWPxv@@Ic={;6 zU7)e!XG|1dx=kU|&|)+m+$&|Yw92Fa;*MnegXcCf8XsHfqg_F5t)3Jt8)EkXKuY21 zqt%4}@R8hK*(_JO0*H+Pa)6Pp&K49rKNeQEYb*x9WY`!`Vh3|80YF%I`lxv9_!$hD zOh$>zWaRIW!);6`vA$Zp;5lnGyX^^N%YEjCeJMHPolKCE1ttIqK<$0w&LcE8)`_c2 z^H^qf6ACV0t7FLLCsu#mL&Mb8gE@rZE#k+1Nrrxw+{N0^#bN*~!qt2>S4e#jC$a$` ze4@{)$aTEYq_!#2|t@Fj3e?w-XVuG$Z}kAR?_kgJAlZIJ)0{eHw#fybNooA zp02jyYVc&w!}m#BVP>ef2|U^J(A-#O1R#A&><*?Y! zOwml{CnE+aU3JfKE@uzge(qMY{^6siuXFt;+mMbapU;Ppejl=L#>s2#SMBbfP9AFT znEVA=TBtZ6d-GfF>kOxylg>Ek%qTp*h2ze!^^hOsmKOEE6b;maQ>~R>3#z`Zawbik z88OTykU3_!Atg^+vnM=1n}?%<$dHzn)?k&T#RWwb+*y;XNQbYNHKo3wr~&}Qa$id; z6^D*K9RTQZUuQVg)g~P%!BIiv+cXllt)KEP9IN)1udQKf>p|~lXj7K<-9}0Q%i9+K zXaF7qXclE>sf)7)J4_M%V{;(sFT7HN$o0#_qU#Ah1D{ zon=JihPcgG5xHuvQwOXBkt3(iUdx{6Gn|aa>@C9Cqg%rPK(+REZ4>6t3z7m@Aj;0l zSHh&%cKSJ*+WOJGwe?Y7d(9RAy)&NVS6uj}1m@U}jXH3oVQT9E0A)$ZDRdK>;_i;+ z7vbEoI7$1XK6vNxT(_sJ(GM4s92e;gB&Q zDO;(Ve^%gPG&lWW1fUf_=9-Q1%&`s%aD^o`Q2u`WI9V>Qm#D5?SW<)Njmt@aR5@6( zL4cdTo+Jg@>Brm1^_gf%0Z?}1AppR3NdFE5uzdpBZz;{Thd6SI-$gb2}pFAww$*j(2=s{mdz2E;lBvVcrN@}i2bC`Q5Y_;BID^f0J+ACVhyQsLg0@`okIk+i=LJ=3yvI*oASj62 za3C{Pu_fQ+atw!zN{$Shr*_UV=|jp4#CqWeGE?Jb`pq!|5bDES&-Ix=-N>DpydHqW z+-{QS+i)d;uGS)M%Suw9khR}3N82j|S{a#&Tctme0s%mTy<1S|;@M-+S4#o@!qr;r z+w(n=;@43Y_n#dI0Gb(T0{G7k-KY8k`MPM_Bss$?)SK){KJMrwv!vz42_U_Za zX7lDqiU8ZvCAfGpAtfVC5bQrYa4C)M9G$S4D&VqpJ8)lm$t5FAAR%ywf>*~VaivC70RVFXISv4Lx&tk^Cf1)qQ|rxp z*8H>)cgoM;(eKxH14u~~@JopNr9@A z#-yXVG?$es;EPqsn-j?45^L52U=nT#0A^T3JY$&B3EH&%2UHdv3P=_3$!n76!34ks zz^2ii@sXAu8LKYMmG=_^*qtiiOFNlG3?QYtG%wrCZh|)vlj8vq3sw~f1b8;_TMB>z zPSyDQy_9bbXD*#sNRGMzfSAwUD}ASX;ZGQcGdE=9q~ORU{v$}=z2Bc8EOe2S&);jS zCZB8P`hPoV1NBk)TQP2z{q$NL-GLUc7%>&fecE^E{I5gs?8!qTK7VgR7Z?}-`YG|z zVN-NvOlQ+B;~J*69_Xd1n-0MLKTY6&*%rTi*0^HXniz8{bCMsVpSXqs(GGO)*_#Kz z9YBCQ_VRhtwhMfppMh@OdxjCN0mH`5hKZr>UoxMx`W~u^kD&bskplglOiRxQvep*2 z0mk+kMP>J)K`8X3`6Zq|X~5IQ-_rrOn+_WvU{1Gs{ow1-Eb;K(Z?p$@ugXpr^?PM( z(5Hv;$*X=QZaqG_4q)N1v9sO(Dsei!;%IcIztt6YUs{yj z^77e`UYa^%<-Ts+d*b=ihKt?0_sj!ePNO@K*PGmGD*v^;rRAkduikx~UNk=@{XKeV zp_ir(dTaGVWBr{_02Kg2Xmlsn|IvIIRYivbo|L{yx}yX5Bte@P6C>1KyqvYnT{boB#j-07*qoM6N<$f^XQQ A+yDRo diff --git a/dynsections.js b/dynsections.js new file mode 100644 index 00000000..116542f1 --- /dev/null +++ b/dynsections.js @@ -0,0 +1,78 @@ +function toggleVisibility(linkObj) +{ + var base = $(linkObj).attr('id'); + var summary = $('#'+base+'-summary'); + var content = $('#'+base+'-content'); + var trigger = $('#'+base+'-trigger'); + var src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; +} + +function updateStripes() +{ + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); +} +function toggleLevel(level) +{ + $('table.directory tr').each(function(){ + var l = this.id.split('_').length-1; + var i = $('#img'+this.id.substring(3)); + var a = $('#arr'+this.id.substring(3)); + if (l + ArduinoLibs: File List + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    File List
    -
    -
    -
    Here is a list of all documented files with brief descriptions:
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Bitmap.cpp [code]
    Bitmap.h [code]
    BlinkLED.cpp [code]
    BlinkLED.h [code]
    BoolField.cpp [code]
    BoolField.h [code]
    Charlieplex.cpp [code]
    Charlieplex.h [code]
    ChaseLEDs.cpp [code]
    ChaseLEDs.h [code]
    DejaVuSans9.h [code]
    DejaVuSansBold9.h [code]
    DejaVuSansItalic9.h [code]
    DMD.cpp [code]
    DMD.h [code]
    DS1307RTC.cpp [code]
    DS1307RTC.h [code]
    DS3232RTC.cpp [code]
    DS3232RTC.h [code]
    EEPROM24.cpp [code]
    EEPROM24.h [code]
    Field.cpp [code]
    Field.h [code]
    Form.cpp [code]
    Form.h [code]
    I2CMaster.cpp [code]
    I2CMaster.h [code]
    IntField.cpp [code]
    IntField.h [code]
    IRreceiver.cpp [code]
    IRreceiver.h [code]
    LCD.cpp [code]
    LCD.h [code]
    ListField.cpp [code]
    ListField.h [code]
    Melody.cpp [code]
    Melody.h [code]
    Mono5x7.h [code]
    PowerSave.cpp [code]
    PowerSave.h [code]
    RC5.h [code]
    RTC.cpp [code]
    RTC.h [code]
    SoftI2C.cpp [code]
    SoftI2C.h [code]
    TextField.cpp [code]
    TextField.h [code]
    TimeField.cpp [code]
    TimeField.h [code]
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -127,8 +78,70 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    +
    File List
    +
    +
    +
    Here is a list of all documented files with brief descriptions:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    o*Bitmap.cpp
    o*Bitmap.h
    o*BlinkLED.cpp
    o*BlinkLED.h
    o*BoolField.cpp
    o*BoolField.h
    o*Charlieplex.cpp
    o*Charlieplex.h
    o*ChaseLEDs.cpp
    o*ChaseLEDs.h
    o*DejaVuSans9.h
    o*DejaVuSansBold9.h
    o*DejaVuSansItalic9.h
    o*DMD.cpp
    o*DMD.h
    o*DS1307RTC.cpp
    o*DS1307RTC.h
    o*DS3232RTC.cpp
    o*DS3232RTC.h
    o*EEPROM24.cpp
    o*EEPROM24.h
    o*Field.cpp
    o*Field.h
    o*Form.cpp
    o*Form.h
    o*I2CMaster.cpp
    o*I2CMaster.h
    o*IntField.cpp
    o*IntField.h
    o*IRreceiver.cpp
    o*IRreceiver.h
    o*LCD.cpp
    o*LCD.h
    o*ListField.cpp
    o*ListField.h
    o*Melody.cpp
    o*Melody.h
    o*Mono5x7.h
    o*PowerSave.cpp
    o*PowerSave.h
    o*RC5.h
    o*RTC.cpp
    o*RTC.h
    o*SoftI2C.cpp
    o*SoftI2C.h
    o*TextField.cpp
    o*TextField.h
    o*TimeField.cpp
    \*TimeField.h
    +
    +
    + + diff --git a/ftv2blank.png b/ftv2blank.png new file mode 100644 index 0000000000000000000000000000000000000000..63c605bb4c3d941c921a4b6cfa74951e946bcb48 GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!3HExu9B$%QnH>djv*C{Z|`mdau^P8_z}#X h?B8GEpdi4(BFDx$je&7RrDQEg&ePS;Wt~$(69Dh@6T1Ka literal 0 HcmV?d00001 diff --git a/ftv2cl.png b/ftv2cl.png new file mode 100644 index 0000000000000000000000000000000000000000..132f6577bf7f085344904602815a260d29f55d9b GIT binary patch literal 453 zcmV;$0XqJPP)VBF;ev;toEj8_OB0EQg5eYilIj#JZG_m^33l3^k4mtzx!TVD?g)Y$ zrvwRDSqT!wLIM$dWCIa$vtxE|mzbTzu-y&$FvF6WA2a{Wr1g}`WdPT-0JzEZ0IxAv z-Z+ejZc&H;I5-pb_SUB}04j0^V)3t{`z<7asDl2Tw3w3sP%)0^8$bhEg)IOTBcRXv zFfq~3&gvJ$F-U7mpBW8z1GY~HK&7h4^YI~Orv~wLnC0PP_dAkv;nzX{9Q|8Gv=2ca z@v)c9T;D#h`TZ2X&&$ff2wedmot995de~-s3I)yauahg;7qn*?1n?F$e+PwP37}~; z1NKUk7reVK^7A;$QRW7qAx40HHUZ<|k3U%nz(Ec`#i+q9K!dgcROAlCS?`L= v>#=f?wF5ZND!1uAfQsk;KN^4&*8~0npJiJ%2dj9(00000NkvXXu0mjfWVFf_ literal 0 HcmV?d00001 diff --git a/ftv2doc.png b/ftv2doc.png new file mode 100644 index 0000000000000000000000000000000000000000..17edabff95f7b8da13c9516a04efe05493c29501 GIT binary patch literal 746 zcmV7=@pnbNXRFEm&G8P!&WHG=d)>K?YZ1bzou)2{$)) zumDct!>4SyxL;zgaG>wy`^Hv*+}0kUfCrz~BCOViSb$_*&;{TGGn2^x9K*!Sf0=lV zpP=7O;GA0*Jm*tTYj$IoXvimpnV4S1Z5f$p*f$Db2iq2zrVGQUz~yq`ahn7ck(|CE z7Gz;%OP~J6)tEZWDzjhL9h2hdfoU2)Nd%T<5Kt;Y0XLt&<@6pQx!nw*5`@bq#?l*?3z{Hlzoc=Pr>oB5(9i6~_&-}A(4{Q$>c>%rV&E|a(r&;?i5cQB=} zYSDU5nXG)NS4HEs0it2AHe2>shCyr7`6@4*6{r@8fXRbTA?=IFVWAQJL&H5H{)DpM#{W(GL+Idzf^)uRV@oB8u$ z8v{MfJbTiiRg4bza<41NAzrl{=3fl_D+$t+^!xlQ8S}{UtY`e z;;&9UhyZqQRN%2pot{*Ei0*4~hSF_3AH2@fKU!$NSflS>{@tZpDT4`M2WRTTVH+D? z)GFlEGGHe?koB}i|1w45!BF}N_q&^HJ&-tyR{(afC6H7|aml|tBBbv}55C5DNP8p3 z)~jLEO4Z&2hZmP^i-e%(@d!(E|KRafiU8Q5u(wU((j8un3OR*Hvj+t literal 0 HcmV?d00001 diff --git a/ftv2folderclosed.png b/ftv2folderclosed.png new file mode 100644 index 0000000000000000000000000000000000000000..bb8ab35edce8e97554e360005ee9fc5bffb36e66 GIT binary patch literal 616 zcmV-u0+;=XP)a9#ETzayK)T~Jw&MMH>OIr#&;dC}is*2Mqdf&akCc=O@`qC+4i z5Iu3w#1M@KqXCz8TIZd1wli&kkl2HVcAiZ8PUn5z_kG@-y;?yK06=cA0U%H0PH+kU zl6dp}OR(|r8-RG+YLu`zbI}5TlOU6ToR41{9=uz^?dGTNL;wIMf|V3`d1Wj3y!#6` zBLZ?xpKR~^2x}?~zA(_NUu3IaDB$tKma*XUdOZN~c=dLt_h_k!dbxm_*ibDM zlFX`g{k$X}yIe%$N)cn1LNu=q9_CS)*>A zsX_mM4L@`(cSNQKMFc$RtYbx{79#j-J7hk*>*+ZZhM4Hw?I?rsXCi#mRWJ=-0LGV5a-WR0Qgt<|Nqf)C-@80`5gIz45^_20000IqP)X=#(TiCT&PiIIVc55T}TU}EUh*{q$|`3@{d>{Tc9Bo>e= zfmF3!f>fbI9#GoEHh0f`i5)wkLpva0ztf%HpZneK?w-7AK@b4Itw{y|Zd3k!fH?q2 zlhckHd_V2M_X7+)U&_Xcfvtw60l;--DgZmLSw-Y?S>)zIqMyJ1#FwLU*%bl38ok+! zh78H87n`ZTS;uhzAR$M`zZ`bVhq=+%u9^$5jDplgxd44}9;IRqUH1YHH|@6oFe%z( zo4)_>E$F&^P-f(#)>(TrnbE>Pefs9~@iN=|)Rz|V`sGfHNrJ)0gJb8xx+SBmRf@1l zvuzt=vGfI)<-F9!o&3l?>9~0QbUDT(wFdnQPv%xdD)m*g%!20>Bc9iYmGAp<9YAa( z0QgYgTWqf1qN++Gqp z8@AYPTB3E|6s=WLG?xw0tm|U!o=&zd+H0oRYE;Dbx+Na9s^STqX|Gnq%H8s(nGDGJ j8vwW|`Ts`)fSK|Kx=IK@RG@g200000NkvXXu0mjfauFEA literal 0 HcmV?d00001 diff --git a/ftv2lastnode.png b/ftv2lastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..63c605bb4c3d941c921a4b6cfa74951e946bcb48 GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!3HExu9B$%QnH>djv*C{Z|`mdau^P8_z}#X h?B8GEpdi4(BFDx$je&7RrDQEg&ePS;Wt~$(69Dh@6T1Ka literal 0 HcmV?d00001 diff --git a/ftv2link.png b/ftv2link.png new file mode 100644 index 0000000000000000000000000000000000000000..17edabff95f7b8da13c9516a04efe05493c29501 GIT binary patch literal 746 zcmV7=@pnbNXRFEm&G8P!&WHG=d)>K?YZ1bzou)2{$)) zumDct!>4SyxL;zgaG>wy`^Hv*+}0kUfCrz~BCOViSb$_*&;{TGGn2^x9K*!Sf0=lV zpP=7O;GA0*Jm*tTYj$IoXvimpnV4S1Z5f$p*f$Db2iq2zrVGQUz~yq`ahn7ck(|CE z7Gz;%OP~J6)tEZWDzjhL9h2hdfoU2)Nd%T<5Kt;Y0XLt&<@6pQx!nw*5`@bq#?l*?3z{Hlzoc=Pr>oB5(9i6~_&-}A(4{Q$>c>%rV&E|a(r&;?i5cQB=} zYSDU5nXG)NS4HEs0it2AHe2>shCyr7`6@4*6{r@8fXRbTA?=IFVWAQJL&H5H{)DpM#{W(GL+Idzf^)uRV@oB8u$ z8v{MfJbTiiRg4bza<41NAzrl{=3fl_D+$t+^!xlQ8S}{UtY`e z;;&9UhyZqQRN%2pot{*Ei0*4~hSF_3AH2@fKU!$NSflS>{@tZpDT4`M2WRTTVH+D? z)GFlEGGHe?koB}i|1w45!BF}N_q&^HJ&-tyR{(afC6H7|aml|tBBbv}55C5DNP8p3 z)~jLEO4Z&2hZmP^i-e%(@d!(E|KRafiU8Q5u(wU((j8un3OR*Hvj+t literal 0 HcmV?d00001 diff --git a/ftv2mlastnode.png b/ftv2mlastnode.png new file mode 100644 index 0000000000000000000000000000000000000000..0b63f6d38c4b9ec907b820192ebe9724ed6eca22 GIT binary patch literal 246 zcmVkw!R34#Lv2LOS^S2tZA31X++9RY}n zChwn@Z)Wz*WWHH{)HDtJnq&A2hk$b-y(>?@z0iHr41EKCGp#T5?07*qoM6N<$f(V3Pvj6}9 literal 0 HcmV?d00001 diff --git a/ftv2mnode.png b/ftv2mnode.png new file mode 100644 index 0000000000000000000000000000000000000000..0b63f6d38c4b9ec907b820192ebe9724ed6eca22 GIT binary patch literal 246 zcmVkw!R34#Lv2LOS^S2tZA31X++9RY}n zChwn@Z)Wz*WWHH{)HDtJnq&A2hk$b-y(>?@z0iHr41EKCGp#T5?07*qoM6N<$f(V3Pvj6}9 literal 0 HcmV?d00001 diff --git a/ftv2mo.png b/ftv2mo.png new file mode 100644 index 0000000000000000000000000000000000000000..4bfb80f76e65815989a9350ad79d8ce45380e2b1 GIT binary patch literal 403 zcmV;E0c`$>P)${!fXv7NWJ%@%u4(KapRY>T6_x;E zxE7kt!}Tiw8@d9Sd`rTGum>z#Q14vIm`wm1#-byD1muMi02@YNO5LRF0o!Y{`a!Ya z{^&p0Su|s705&2QxmqdexG+-zNKL3f@8gTQSJrKByfo+oNJ^-{|Mn||Q5SDwjQVsS zr1}7o5-QMs>gYIMD>GRw@$lT`z4r-_m{5U#cR{urD_)TOeY)(UD|qZ^&y`IVijqk~ xs(9-kWFr7E^!lgi8GsFK5kOY_{Xbgf0^etEU%fLevs?fG002ovPDHLkV1nB&vX1}& literal 0 HcmV?d00001 diff --git a/ftv2node.png b/ftv2node.png new file mode 100644 index 0000000000000000000000000000000000000000..63c605bb4c3d941c921a4b6cfa74951e946bcb48 GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!3HExu9B$%QnH>djv*C{Z|`mdau^P8_z}#X h?B8GEpdi4(BFDx$je&7RrDQEg&ePS;Wt~$(69Dh@6T1Ka literal 0 HcmV?d00001 diff --git a/ftv2ns.png b/ftv2ns.png new file mode 100644 index 0000000000000000000000000000000000000000..72e3d71c2892d6f00e259facebc88b45f6db2e35 GIT binary patch literal 388 zcmV-~0ek+5P)f+++#cT|!CkD&4pnIkeMEUEM*>`*9>+Juji$!h-mW%M^8s9957{3nvbrz^&=u<~TAUrFROkmt%^F~Ez+-c53Lv%iH3d38!Rv?K zrb&MYAhp;Gf<}wS;9ZZq2@;!uYG;=Z>~GKE^{HD4keu}lnyqhc>kWX^tQn|warJ~h zT+rtMkdz6aHoN%z(o|&wpu@@OpJnF_z{PA)6(FHw02iHslz^(N{4*+K9)QJHR87wT iTyp>aXaF{u2lxRou|^4tux6eB0000^P)R?RzRoKvklcaQ%HF6%rK2&ZgO(-ihJ_C zzrKgp4jgO( fd_(yg|3PpEQb#9`a?Pz_00000NkvXXu0mjftR`5K literal 0 HcmV?d00001 diff --git a/ftv2pnode.png b/ftv2pnode.png new file mode 100644 index 0000000000000000000000000000000000000000..c6ee22f937a07d1dbfc27c669d11f8ed13e2f152 GIT binary patch literal 229 zcmV^P)R?RzRoKvklcaQ%HF6%rK2&ZgO(-ihJ_C zzrKgp4jgO( fd_(yg|3PpEQb#9`a?Pz_00000NkvXXu0mjftR`5K literal 0 HcmV?d00001 diff --git a/ftv2splitbar.png b/ftv2splitbar.png new file mode 100644 index 0000000000000000000000000000000000000000..fe895f2c58179b471a22d8320b39a4bd7312ec8e GIT binary patch literal 314 zcmeAS@N?(olHy`uVBq!ia0vp^Yzz!63>-{AmhX=Jf(#6djGiuzAr*{o?=JLmPLyc> z_*`QK&+BH@jWrYJ7>r6%keRM@)Qyv8R=enp0jiI>aWlGyB58O zFVR20d+y`K7vDw(hJF3;>dD*3-?v=<8M)@x|EEGLnJsniYK!2U1 Y!`|5biEc?d1`HDhPgg&ebxsLQ02F6;9RL6T literal 0 HcmV?d00001 diff --git a/ftv2vertline.png b/ftv2vertline.png new file mode 100644 index 0000000000000000000000000000000000000000..63c605bb4c3d941c921a4b6cfa74951e946bcb48 GIT binary patch literal 86 zcmeAS@N?(olHy`uVBq!ia0vp^0zfRr!3HExu9B$%QnH>djv*C{Z|`mdau^P8_z}#X h?B8GEpdi4(BFDx$je&7RrDQEg&ePS;Wt~$(69Dh@6T1Ka literal 0 HcmV?d00001 diff --git a/functions.html b/functions.html index 3731b7a3..46bba22b 100644 --- a/functions.html +++ b/functions.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -129,23 +151,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , EEPROM24 -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x62.html b/functions_0x62.html index aba8b501..32ebdc16 100644 --- a/functions_0x62.html +++ b/functions_0x62.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -129,23 +151,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , DS1307RTC -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x63.html b/functions_0x63.html index 097e3ff0..cf60d999 100644 --- a/functions_0x63.html +++ b/functions_0x63.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -127,23 +149,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Form -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x64.html b/functions_0x64.html index 2ea29d97..4d69d566 100644 --- a/functions_0x64.html +++ b/functions_0x64.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -186,23 +208,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : DS3232RTC -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x65.html b/functions_0x65.html index bf24935d..791b3417 100644 --- a/functions_0x65.html +++ b/functions_0x65.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -134,23 +156,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , Field -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x66.html b/functions_0x66.html index 97554e5e..51626ec6 100644 --- a/functions_0x66.html +++ b/functions_0x66.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -115,35 +137,27 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : RTCAlarm
  • font() -: Bitmap +: Bitmap
  • -
  • form() -: Field +
  • Font +: Bitmap
  • Form() : Form
  • +
  • form() +: Field +
  • fromRGB() : DMD
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x67.html b/functions_0x67.html index 306c4d60..b5af9bd0 100644 --- a/functions_0x67.html +++ b/functions_0x67.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    Here is a list of all documented class members with links to the class documentation for each member:
    - -

    - g -

      -
    • getButton() -: LCD -
    • -
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -118,8 +117,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - g -

      +
    • getButton() +: LCD +
    • +
    +
    + + diff --git a/functions_0x68.html b/functions_0x68.html index 2f5a63fe..67568d7a 100644 --- a/functions_0x68.html +++ b/functions_0x68.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -118,23 +140,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , RTCTime -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x69.html b/functions_0x69.html index 1694c1bf..c085984f 100644 --- a/functions_0x69.html +++ b/functions_0x69.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -138,23 +160,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ListField -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x6c.html b/functions_0x6c.html index 213b612f..d187c4c6 100644 --- a/functions_0x6c.html +++ b/functions_0x6c.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -102,9 +124,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • label() : Field
  • -
  • LCD() -: LCD -
  • lcd() : Field
  • @@ -127,23 +146,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Melody -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x6d.html b/functions_0x6d.html index 2ced7b06..2590a2b0 100644 --- a/functions_0x6d.html +++ b/functions_0x6d.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -123,23 +145,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : RTCDate -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x6e.html b/functions_0x6e.html index 7d45e009..5b7e6e33 100644 --- a/functions_0x6e.html +++ b/functions_0x6e.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -112,23 +134,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Bitmap -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x6f.html b/functions_0x6f.html index 159a637e..0fb40a9d 100644 --- a/functions_0x6f.html +++ b/functions_0x6f.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -106,23 +128,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BlinkLED -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x70.html b/functions_0x70.html index 73930eee..3ed641bd 100644 --- a/functions_0x70.html +++ b/functions_0x70.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -120,27 +142,19 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • previousPin() : ChaseLEDs
  • +
  • ProgMem +: Bitmap +
  • pwmLed() : Charlieplex
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x72.html b/functions_0x72.html index da4f7e92..226aad53 100644 --- a/functions_0x72.html +++ b/functions_0x72.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -148,23 +170,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Melody -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x73.html b/functions_0x73.html index 47b8b14c..35422a02 100644 --- a/functions_0x73.html +++ b/functions_0x73.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -130,7 +152,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BoolField
  • setFont() -: Bitmap +: Bitmap
  • setHoldTime() : Charlieplex @@ -244,23 +266,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : IRreceiver
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x74.html b/functions_0x74.html index 381922aa..b4b349a0 100644 --- a/functions_0x74.html +++ b/functions_0x74.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -118,23 +140,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BoolField -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x75.html b/functions_0x75.html index b81f1d67..e6301c7a 100644 --- a/functions_0x75.html +++ b/functions_0x75.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    Here is a list of all documented class members with links to the class documentation for each member:
    - -

    - u -

      -
    • updateCursor() -: Field -
    • -
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -118,8 +117,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - u -

      +
    • updateCursor() +: Field +
    • +
    +
    + + diff --git a/functions_0x76.html b/functions_0x76.html index 4f54a7b8..1376f3c3 100644 --- a/functions_0x76.html +++ b/functions_0x76.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -107,23 +129,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , IntField -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x77.html b/functions_0x77.html index db3a9cf1..0b7a7ef3 100644 --- a/functions_0x77.html +++ b/functions_0x77.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -134,23 +156,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , RTC -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_0x79.html b/functions_0x79.html index 0a062a4a..cd1b600b 100644 --- a/functions_0x79.html +++ b/functions_0x79.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    Here is a list of all documented class members with links to the class documentation for each member:
    - -

    - y -

    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -118,8 +117,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    + +

    - y -

    +
    + + diff --git a/functions_0x7e.html b/functions_0x7e.html index 732e7e16..ded9841e 100644 --- a/functions_0x7e.html +++ b/functions_0x7e.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Here is a list of all documented class members with links to the class documentation for each member:
    @@ -115,23 +137,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Form -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_enum.html b/functions_enum.html index c274cc2c..d99c1f8d 100644 --- a/functions_enum.html +++ b/functions_enum.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Enumerations + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
     
    • DayOfWeek @@ -78,23 +100,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : LCD
    -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_eval.html b/functions_eval.html index 5f46d102..7651fde1 100644 --- a/functions_eval.html +++ b/functions_eval.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Enumerator + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
     
    • BacklightOff @@ -81,23 +103,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : LCD
    -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func.html b/functions_func.html index 271c4a11..7c4a2e9c 100644 --- a/functions_func.html +++ b/functions_func.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -122,23 +144,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , I2CMaster -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x62.html b/functions_func_0x62.html index fdacc5a5..4753b937 100644 --- a/functions_func_0x62.html +++ b/functions_func_0x62.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -119,23 +141,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , DS3232RTC -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x63.html b/functions_func_0x63.html index 1c110e7e..6288b4e5 100644 --- a/functions_func_0x63.html +++ b/functions_func_0x63.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -123,23 +145,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Form -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x64.html b/functions_func_0x64.html index 04b008cd..4d502756 100644 --- a/functions_func_0x64.html +++ b/functions_func_0x64.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -140,7 +162,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : DMD
  • drawBitmap() -: Bitmap +: Bitmap
  • drawChar() : Bitmap @@ -155,7 +177,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Bitmap
  • drawInvertedBitmap() -: Bitmap +: Bitmap
  • drawLine() : Bitmap @@ -173,23 +195,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : DS3232RTC
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x65.html b/functions_func_0x65.html index a1076b25..47f9bea0 100644 --- a/functions_func_0x65.html +++ b/functions_func_0x65.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -133,23 +155,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , Field -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x66.html b/functions_func_0x66.html index b802f69b..b63d5ef7 100644 --- a/functions_func_0x66.html +++ b/functions_func_0x66.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -111,35 +133,24 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : DS3232RTC
  • font() -: Bitmap -
  • -
  • form() -: Field +: Bitmap
  • Form() : Form
  • +
  • form() +: Field +
  • fromRGB() : DMD
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x67.html b/functions_func_0x67.html index 0c5edb9e..77a9701a 100644 --- a/functions_func_0x67.html +++ b/functions_func_0x67.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -  - -

    - g -

      -
    • getButton() -: LCD -
    • -
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -117,8 +116,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +  + +

    - g -

      +
    • getButton() +: LCD +
    • +
    +
    + + diff --git a/functions_func_0x68.html b/functions_func_0x68.html index 7550e4c1..5645b54c 100644 --- a/functions_func_0x68.html +++ b/functions_func_0x68.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -113,23 +135,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Charlieplex -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x69.html b/functions_func_0x69.html index 17474954..c776cb71 100644 --- a/functions_func_0x69.html +++ b/functions_func_0x69.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -134,23 +156,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : ListField -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x6c.html b/functions_func_0x6c.html index 3f250127..55644ba4 100644 --- a/functions_func_0x6c.html +++ b/functions_func_0x6c.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -101,9 +123,6 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
  • label() : Field
  • -
  • LCD() -: LCD -
  • lcd() : Field
  • @@ -126,23 +145,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Melody -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x6d.html b/functions_func_0x6d.html index d4d47b3e..17b79333 100644 --- a/functions_func_0x6d.html +++ b/functions_func_0x6d.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -115,23 +137,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : IntField -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x6e.html b/functions_func_0x6e.html index 1ccff2b3..793613e3 100644 --- a/functions_func_0x6e.html +++ b/functions_func_0x6e.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -105,23 +127,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : LCD -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x6f.html b/functions_func_0x6f.html index dc55dcb8..091d0a0d 100644 --- a/functions_func_0x6f.html +++ b/functions_func_0x6f.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -105,23 +127,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BlinkLED -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x70.html b/functions_func_0x70.html index 244e7e11..86c75bce 100644 --- a/functions_func_0x70.html +++ b/functions_func_0x70.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -123,23 +145,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Charlieplex -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x72.html b/functions_func_0x72.html index 0acb625e..11098b29 100644 --- a/functions_func_0x72.html +++ b/functions_func_0x72.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -147,23 +169,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Melody -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x73.html b/functions_func_0x73.html index 27385d99..99839f29 100644 --- a/functions_func_0x73.html +++ b/functions_func_0x73.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -123,7 +145,7 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BoolField
  • setFont() -: Bitmap +: Bitmap
  • setHoldTime() : Charlieplex @@ -237,23 +259,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : IRreceiver
  • -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x74.html b/functions_func_0x74.html index c4087c81..7a4df150 100644 --- a/functions_func_0x74.html +++ b/functions_func_0x74.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -117,23 +139,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : BoolField -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x75.html b/functions_func_0x75.html index ecb777b9..0f626f85 100644 --- a/functions_func_0x75.html +++ b/functions_func_0x75.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -  - -

    - u -

      -
    • updateCursor() -: Field -
    • -
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -117,8 +116,20 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +  + +

    - u -

      +
    • updateCursor() +: Field +
    • +
    +
    + + diff --git a/functions_func_0x76.html b/functions_func_0x76.html index 81d44b3d..cd552d19 100644 --- a/functions_func_0x76.html +++ b/functions_func_0x76.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -106,23 +128,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , IntField -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x77.html b/functions_func_0x77.html index 40f1461c..d438deb2 100644 --- a/functions_func_0x77.html +++ b/functions_func_0x77.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -128,23 +150,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); , RTC -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_func_0x7e.html b/functions_func_0x7e.html index d5d34365..29caf833 100644 --- a/functions_func_0x7e.html +++ b/functions_func_0x7e.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
      @@ -114,23 +136,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : Form -
    - - - - -
    - -
    - - +
    + + diff --git a/functions_type.html b/functions_type.html index e62c664b..9d01794b 100644 --- a/functions_type.html +++ b/functions_type.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Typedefs + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -90,8 +91,24 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    + + diff --git a/functions_vars.html b/functions_vars.html index c1224cc0..585ad99f 100644 --- a/functions_vars.html +++ b/functions_vars.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Members - Variables + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
     
    • ALARM_COUNT @@ -122,23 +144,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); : RTCDate
    -
    - - - - -
    - -
    - - +
    + + diff --git a/group__power__save.html b/group__power__save.html index cf8f1db8..987921d2 100644 --- a/group__power__save.html +++ b/group__power__save.html @@ -2,29 +2,37 @@ + ArduinoLibs: Power saving utility functions + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    Enumerations | @@ -58,12 +80,12 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); Functions
    Power saving utility functions
    -
    +
    - -SLEEP_8_SEC
    } - - +

    +

    Enumerations

    enum  SleepDuration {
    +
    enum  SleepDuration {
      SLEEP_15_MS, SLEEP_30_MS, SLEEP_60_MS, @@ -78,19 +100,20 @@ Enumerations
     Duration to put the CPU to sleep with sleepFor(). More...

    +

     Duration to put the CPU to sleep with sleepFor(). More...
    + - - - + + - +

    Functions

    void sleepFor (SleepDuration duration, uint8_t mode)
     Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detector will be disabled during sleep mode.
    +
    void sleepFor (SleepDuration duration, uint8_t mode)
     Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detector will be disabled during sleep mode.
    void unusedPin (uint8_t pin)
     Marks an I/O pin as unused.This function sets pin to be an input with pullups enabled, which will reduce power consumption compared to pins that are left floating.
     Marks an I/O pin as unused.This function sets pin to be an input with pullups enabled, which will reduce power consumption compared to pins that are left floating.
    -

    Detailed Description

    +

    Detailed Description

    The functions in this module assist with reducing power consumption on Arduino boards by disabling features that are not used or putting the device to sleep when it is inactive.

    -

    Enumeration Type Documentation

    - +

    Enumeration Type Documentation

    +
    @@ -98,40 +121,39 @@ void 
    enum SleepDuration
    -
    -
    +

    Duration to put the CPU to sleep with sleepFor().

    -
    See also:
    sleepFor()
    +
    See Also
    sleepFor()
    Enumerator:
    - - - - - - - - - -
    SLEEP_15_MS  +
    SLEEP_15_MS 

    Sleep for 15 milliseconds.

    SLEEP_30_MS  +
    SLEEP_30_MS 

    Sleep for 30 milliseconds.

    SLEEP_60_MS  +
    SLEEP_60_MS 

    Sleep for 60 milliseconds.

    SLEEP_120_MS  +
    SLEEP_120_MS 

    Sleep for 120 milliseconds.

    SLEEP_250_MS  +
    SLEEP_250_MS 

    Sleep for 250 milliseconds.

    SLEEP_500_MS  +
    SLEEP_500_MS 

    Sleep for 500 milliseconds.

    SLEEP_1_SEC  +
    SLEEP_1_SEC 

    Sleep for 1 second.

    SLEEP_2_SEC  +
    SLEEP_2_SEC 

    Sleep for 2 seconds.

    SLEEP_4_SEC  +
    SLEEP_4_SEC 

    Sleep for 4 seconds.

    SLEEP_8_SEC  +
    SLEEP_8_SEC 

    Sleep for 8 seconds.

    @@ -142,8 +164,8 @@ void 
    +

    Function Documentation

    +
    @@ -165,8 +187,7 @@ void ","
    +

    Puts the CPU to sleep for a specific duration.The analog to digital converter and the brown out detector will be disabled during sleep mode.

    The mode parameter indicates the mode to use when the device is sleeping. The default is SLEEP_MODE_IDLE.

    @@ -175,23 +196,12 @@ void 
    - All Classes Files Functions Variables Typedefs Enumerations Enumerator - - -
    - -
    - - + + + diff --git a/hierarchy.html b/hierarchy.html index 893a71c2..8c5cb20a 100644 --- a/hierarchy.html +++ b/hierarchy.html @@ -2,29 +2,37 @@ + ArduinoLibs: Class Hierarchy + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Class Hierarchy
    -
    -
    -
    This inheritance list is sorted roughly, but not completely, alphabetically:
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -113,8 +81,45 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    +
    Class Hierarchy
    +
    +
    +
    This inheritance list is sorted roughly, but not completely, alphabetically:
    +
    [detail level 12]
    + + + + + + + + + + + + + + + + + + + + + + + + +
    oCBitmapRepresents a monochrome bitmap within main memory
    |\CDMDHandle large dot matrix displays composed of LED's
    oCBlinkLEDBlink a LED on a digital output pin
    oCCharlieplexManage an array of LED's in a charlieplexed arrangement
    oCChaseLEDsChase LED's on output pins in a defined sequence
    oCEEPROM24Reading and writing EEPROM's from the 24LCXX family
    oCFieldManages a single data input/output field within a Form
    |oCBoolFieldField that manages the input of a boolean value
    |oCIntFieldField that manages the input of an integer value
    |oCListFieldField that manages selection from a static list of items
    |oCTextFieldField that displays a read-only text value
    |\CTimeFieldField that manages the display and editing of a time value
    oCFormManager for a form containing data input/output fields
    oCI2CMasterAbstract base class for I2C master implementations
    |\CSoftI2CBit-banged implementation of an I2C master
    oCIRreceiverManages the reception of RC-5 commands from an infrared remote control
    oCLCDEnhanced library for Freetronics 16x2 LCD shields
    oCMelodyPlays a melody on a digital output pin using tone()
    oCRTCBase class for realtime clock handlers
    |oCDS1307RTCCommunicates with a DS1307 realtime clock chip via I2C
    |\CDS3232RTCCommunicates with a DS3232 realtime clock chip via I2C
    oCRTCAlarmStores alarm information from a realtime clock chip
    oCRTCDateStores date information from a realtime clock chip
    \CRTCTimeStores time information from a realtime clock chip
    +
    +
    + + diff --git a/index.html b/index.html index b3a68854..2f9c5537 100644 --- a/index.html +++ b/index.html @@ -2,29 +2,37 @@ + ArduinoLibs: Main Page + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + +
    + + + + +
    +
    +
    ArduinoLibs Documentation
    -
    +
    -

    This distribution contains a bunch of libraries and example applications that I have made for Arduino, covering a variety of tasks from blinking LED's to LCD's and RTC-based alarm clocks. They are distributed under the terms of the MIT license, with the source code available from github.

    -

    For more information on these libraries, to report bugs, or to suggest improvements, please contact the author Rhys Weatherley via email.

    -

    -LCD Shield

    +

    This distribution contains a bunch of libraries and example applications that I have made for Arduino, covering a variety of tasks from blinking LED's to LCD's and RTC-based alarm clocks. They are distributed under the terms of the MIT license, with the source code available from github.

    +

    For more information on these libraries, to report bugs, or to suggest improvements, please contact the author Rhys Weatherley via email.

    +

    +LCD Shield

    • LCD class to manage the extended features of the Freetronics and DFRobot LCD shields.
    • Form and Field classes to build simple property sheet UI's on LCD displays.
    • Hello World example for the Freetronics LCD shield.
    • Form example for LCD displays.
    -

    -Freetronics Large Dot Matrix Display (DMD)

    +

    +Freetronics Large Dot Matrix Display (DMD)

    • DMD class to manage the initialize of the display.
    • Bitmap class to manage drawing to in-memory bitmaps and the DMD display.
    • @@ -75,8 +97,8 @@ Freetronics Large Dot Matrix Display (DMD)
    • RunningFigure example that demonstrates how to draw and animate bitmaps.
    • Snake game that combines the dot matrix display with IRreceiver to make a simple video game.
    -

    -BlinkLED Utility Library

    +

    +BlinkLED Utility Library

    • BlinkLED class that simplifies the process of blinking a LED connected to a output pin.
    • ChaseLEDs class that simplifies the process of performing a LED chase over several output pins.
    • @@ -86,51 +108,40 @@ BlinkLED Utility Library
    • StarTrek example for lighting a starship Enterprise model kit.
    • Charlieplex example.
    -

    -I2C Utility Library

    +

    +I2C Utility Library

    • I2CMaster abstract class that provides an improved API for implementing an I2C master.
    • SoftI2C class that implements the master side of the I2C protocol in software on any arbitrary pair of pins for DATA and CLOCK. This class supports both 7-bit and 10-bit I2C addresses.
    • EEPROM24 class for reading and writing 24LCXX family EEPROM's.
    -

    -Realtime Clock Library

    +

    +Realtime Clock Library

    • RTC class that acts as a base for all realtime clock implementations, including support for configuring alarms and storing clock settings. The default implementation simulates the time and date based on the value of millis().
    • DS1307RTC class that talks to the DS1307 realtime clock chip via I2C.
    • DS3232RTC class that talks to the DS3232 realtime clock chip via I2C.
    • Alarm Clock example that uses the DS1307 or DS3232 realtime clock and the LCD library to implement an alarm clock.
    -

    -Infrared Control Library

    +

    +Infrared Control Library

    • IRreceiver class that receives incoming RC-5 commands from an infrared remote control.
    • DumpIR example that dumps all incoming RC-5 commands.
    • Snake game that combines DMD with an infrared remote control to make a simple video game.
    -

    -Other

    +

    +Other

    -
    - - - - -
    - -
    - - +
    + + diff --git a/ir-dumpir_8dox.html b/ir-dumpir_8dox.html index 4db6c9dd..d87b9281 100644 --- a/ir-dumpir_8dox.html +++ b/ir-dumpir_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: ir-dumpir.dox File Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    ir-dumpir.dox File Reference
    -
    -
    - -
    -

    Detailed Description

    -
    -

    Definition in file ir-dumpir.dox.

    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    ir-dumpir.dox File Reference
    +
    +
    +

    Detailed Description

    +
    +

    Definition in file ir-dumpir.dox.

    +
    + + diff --git a/ir-snake_8dox.html b/ir-snake_8dox.html index dfd0b252..8d16b81e 100644 --- a/ir-snake_8dox.html +++ b/ir-snake_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: ir-snake.dox File Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    ir-snake.dox File Reference
    -
    -
    - -
    -

    Detailed Description

    -
    -

    Definition in file ir-snake.dox.

    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    ir-snake.dox File Reference
    +
    +
    +

    Detailed Description

    +
    +

    Definition in file ir-snake.dox.

    +
    + + diff --git a/ir_dumpir.html b/ir_dumpir.html index 059f758e..12894f77 100644 --- a/ir_dumpir.html +++ b/ir_dumpir.html @@ -2,29 +2,37 @@ + ArduinoLibs: Dumping Infrared Remote Control Codes + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Dumping Infrared Remote Control Codes
    -
    -
    -

    This example uses the IRreceiver class to dump commands that are received from an infrared remote control that is compatible with the Philips RC-5 protocol. Commands are dumped to the serial port. The example needs a 3-pin infrared receiver connected to D2, GND, and 5V:

    -
    -irchip.jpg -
    -

    The full source code for the example follows:

    -
    /* This example is placed into the public domain */
    -
    -#include <IRreceiver.h>
    -
    -IRreceiver ir;
    -
    -static const char *systems[32] = {
    -    "TV",
    -    "TV2",
    -    "TXT",
    -    "TV_EXT",
    -    "LV",
    -    "VCR",
    -    "VCR2",
    -    "Sys7",
    -    "SAT",
    -    "VCR_EXT",
    -    "SAT2",
    -    "Sys11",
    -    "CD_VIDEO",
    -    "Sys13",
    -    "CD_PHOTO",
    -    "Sys15",
    -    "PREAMP",
    -    "RADIO",
    -    "REC",
    -    "PREAMP2",
    -    "CD",
    -    "COMBI",
    -    "AUDIO_SAT",
    -    "REC2",
    -    "Sys24",
    -    "Sys25",
    -    "CD_R",
    -    "Sys27",
    -    "Sys28",
    -    "Sys29",
    -    "Sys30",
    -    "Sys31"
    -};
    -
    -// Selection of TV, VCR, and CD commands to assist with command identification.
    -// May not be correct for all system types.
    -static const char *commands[128] = {
    -    "0",
    -    "1",
    -    "2",
    -    "3",
    -    "4",
    -    "5",
    -    "6",
    -    "7",
    -    "8",
    -    "9",
    -    "123",
    -    "11",
    -    "STANDBY",
    -    "MUTE",
    -    "PREFERENCES",
    -    "DISPLAY_INFO",
    -    "INC_VOLUME",
    -    "DEC_VOLUME",
    -    "INC_BRIGHTNESS",
    -    "DEC_BRIGHTNESS",
    -    "INC_SATURATION",
    -    "DEC_SATURATION",
    -    "INC_BASS",
    -    "DEC_BASS",
    -    "INC_TREBLE",
    -    "DEC_TREBLE",
    -    "BALANCE_LEFT",
    -    "BALANCE_RIGHT",
    -    "INC_CONTRAST",
    -    "DEC_CONTRAST",
    -    "SEARCH_UP",
    -    "DEC_TINT",
    -    "CHANNEL_UP",
    -    "CHANNEL_DOWN",
    -    "CHANNEL_LAST",
    -    "STEREO_SELECT",
    -    "STEREO_SPATIAL",
    -    "STEREO_TOGGLE",
    -    "SLEEP_TIMER",
    -    "INC_TINT",
    -    "SWITCH_RF",
    -    "STORE",
    -    "TIME",
    -    "INC_SCAN",
    -    "DEC_SCAN",
    -    "TRAY",
    -    "SECONDARY_MENU",
    -    "CLOCK",
    -    "PAUSE",
    -    "ERASE",
    -    "REWIND",
    -    "GOTO",
    -    "WIND",
    -    "PLAY",
    -    "STOP",
    -    "RECORD",
    -    "EXTERNAL_1",
    -    "EXTERNAL_2",
    -    "CLEAR_MEMORY",
    -    "VIEW_DATA",
    -    "12",
    -    "SYSTEM_STANDBY",
    -    "CRISP",
    -    "TRANSMIT_MODE",
    -    "Cmd64",
    -    "Cmd65",
    -    "Cmd66",
    -    "Cmd67",
    -    "Cmd68",
    -    "Cmd69",
    -    "AUDIO_RESPONSE",
    -    "DIM",
    -    "Cmd72",
    -    "Cmd73",
    -    "Cmd74",
    -    "Cmd75",
    -    "Cmd76",
    -    "INC_LINEAR",
    -    "DEC_LINEAR",
    -    "SOUND_FUNCTIONS",
    -    "UP",
    -    "DOWN",
    -    "MENU_ON",
    -    "MENU_OFF",
    -    "AV_STATUS",
    -    "LEFT",
    -    "RIGHT",
    -    "OK",
    -    "PIP",
    -    "PIP_SHIFT",
    -    "PIP_SWAP",
    -    "PIP_STROBE",
    -    "PIP_MULTI_STROBE",
    -    "PIP_FREEZE_MAIN",
    -    "PIP_MULTI_SCAN",
    -    "PIP_SOURCE",
    -    "PIP_MOSAIC",
    -    "PIP_NOISE",
    -    "PIP_STORE",
    -    "PIP_PHOTO_FINISH",
    -    "PIP_RECALL",
    -    "PIP_FREEZE",
    -    "PIP_UP",
    -    "PIP_DOWN",
    -    "PIP_SIZE",
    -    "VERSION_FUNCTIONS",
    -    "COLOR_KEY",
    -    "RED",
    -    "GREEN",
    -    "YELLOW",
    -    "CYAN",
    -    "INDEX",
    -    "NEXT_OPTION",
    -    "PREVIOUS_OPTION",
    -    "Cmd114",
    -    "Cmd115",
    -    "Cmd116",
    -    "Cmd117",
    -    "SUBMODE",
    -    "OPTIONS",
    -    "FADE",
    -    "Cmd121",
    -    "STORE_OPEN_CLOSE",
    -    "CONNECT_EURO",
    -    "DISCONNECT_EURO",
    -    "Cmd125",
    -    "Cmd126",
    -    "Cmd127"
    -};
    -
    -void setup() {
    -    Serial.begin(9600);
    -}
    -
    -void loop() {
    -    int cmd = ir.command();
    -    if (cmd >= 0) {
    -        Serial.print("IR system=");
    -        Serial.print(ir.system());
    -        Serial.print(" (RC5_SYS_");
    -        Serial.print(systems[ir.system()]);
    -        Serial.print("), command=");
    -        Serial.print(cmd & 0x7F);
    -        Serial.print(" (RC5_");
    -        Serial.print(commands[cmd & 0x7F]);
    -        Serial.print(")");
    -        if (cmd & IRreceiver::AUTO_REPEAT)
    -            Serial.println(", auto-repeat");
    -        else
    -            Serial.println();
    -    }
    -}
    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -272,8 +72,219 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    Dumping Infrared Remote Control Codes
    +
    +
    +

    This example uses the IRreceiver class to dump commands that are received from an infrared remote control that is compatible with the Philips RC-5 protocol. Commands are dumped to the serial port. The example needs a 3-pin infrared receiver connected to D2, GND, and 5V:

    +
    +irchip.jpg +
    +

    The full source code for the example follows:

    +
    /* This example is placed into the public domain */
    +
    +
    #include <IRreceiver.h>
    +
    + +
    +
    static const char *systems[32] = {
    +
    "TV",
    +
    "TV2",
    +
    "TXT",
    +
    "TV_EXT",
    +
    "LV",
    +
    "VCR",
    +
    "VCR2",
    +
    "Sys7",
    +
    "SAT",
    +
    "VCR_EXT",
    +
    "SAT2",
    +
    "Sys11",
    +
    "CD_VIDEO",
    +
    "Sys13",
    +
    "CD_PHOTO",
    +
    "Sys15",
    +
    "PREAMP",
    +
    "RADIO",
    +
    "REC",
    +
    "PREAMP2",
    +
    "CD",
    +
    "COMBI",
    +
    "AUDIO_SAT",
    +
    "REC2",
    +
    "Sys24",
    +
    "Sys25",
    +
    "CD_R",
    +
    "Sys27",
    +
    "Sys28",
    +
    "Sys29",
    +
    "Sys30",
    +
    "Sys31"
    +
    };
    +
    +
    // Selection of TV, VCR, and CD commands to assist with command identification.
    +
    // May not be correct for all system types.
    +
    static const char *commands[128] = {
    +
    "0",
    +
    "1",
    +
    "2",
    +
    "3",
    +
    "4",
    +
    "5",
    +
    "6",
    +
    "7",
    +
    "8",
    +
    "9",
    +
    "123",
    +
    "11",
    +
    "STANDBY",
    +
    "MUTE",
    +
    "PREFERENCES",
    +
    "DISPLAY_INFO",
    +
    "INC_VOLUME",
    +
    "DEC_VOLUME",
    +
    "INC_BRIGHTNESS",
    +
    "DEC_BRIGHTNESS",
    +
    "INC_SATURATION",
    +
    "DEC_SATURATION",
    +
    "INC_BASS",
    +
    "DEC_BASS",
    +
    "INC_TREBLE",
    +
    "DEC_TREBLE",
    +
    "BALANCE_LEFT",
    +
    "BALANCE_RIGHT",
    +
    "INC_CONTRAST",
    +
    "DEC_CONTRAST",
    +
    "SEARCH_UP",
    +
    "DEC_TINT",
    +
    "CHANNEL_UP",
    +
    "CHANNEL_DOWN",
    +
    "CHANNEL_LAST",
    +
    "STEREO_SELECT",
    +
    "STEREO_SPATIAL",
    +
    "STEREO_TOGGLE",
    +
    "SLEEP_TIMER",
    +
    "INC_TINT",
    +
    "SWITCH_RF",
    +
    "STORE",
    +
    "TIME",
    +
    "INC_SCAN",
    +
    "DEC_SCAN",
    +
    "TRAY",
    +
    "SECONDARY_MENU",
    +
    "CLOCK",
    +
    "PAUSE",
    +
    "ERASE",
    +
    "REWIND",
    +
    "GOTO",
    +
    "WIND",
    +
    "PLAY",
    +
    "STOP",
    +
    "RECORD",
    +
    "EXTERNAL_1",
    +
    "EXTERNAL_2",
    +
    "CLEAR_MEMORY",
    +
    "VIEW_DATA",
    +
    "12",
    +
    "SYSTEM_STANDBY",
    +
    "CRISP",
    +
    "TRANSMIT_MODE",
    +
    "Cmd64",
    +
    "Cmd65",
    +
    "Cmd66",
    +
    "Cmd67",
    +
    "Cmd68",
    +
    "Cmd69",
    +
    "AUDIO_RESPONSE",
    +
    "DIM",
    +
    "Cmd72",
    +
    "Cmd73",
    +
    "Cmd74",
    +
    "Cmd75",
    +
    "Cmd76",
    +
    "INC_LINEAR",
    +
    "DEC_LINEAR",
    +
    "SOUND_FUNCTIONS",
    +
    "UP",
    +
    "DOWN",
    +
    "MENU_ON",
    +
    "MENU_OFF",
    +
    "AV_STATUS",
    +
    "LEFT",
    +
    "RIGHT",
    +
    "OK",
    +
    "PIP",
    +
    "PIP_SHIFT",
    +
    "PIP_SWAP",
    +
    "PIP_STROBE",
    +
    "PIP_MULTI_STROBE",
    +
    "PIP_FREEZE_MAIN",
    +
    "PIP_MULTI_SCAN",
    +
    "PIP_SOURCE",
    +
    "PIP_MOSAIC",
    +
    "PIP_NOISE",
    +
    "PIP_STORE",
    +
    "PIP_PHOTO_FINISH",
    +
    "PIP_RECALL",
    +
    "PIP_FREEZE",
    +
    "PIP_UP",
    +
    "PIP_DOWN",
    +
    "PIP_SIZE",
    +
    "VERSION_FUNCTIONS",
    +
    "COLOR_KEY",
    +
    "RED",
    +
    "GREEN",
    +
    "YELLOW",
    +
    "CYAN",
    +
    "INDEX",
    +
    "NEXT_OPTION",
    +
    "PREVIOUS_OPTION",
    +
    "Cmd114",
    +
    "Cmd115",
    +
    "Cmd116",
    +
    "Cmd117",
    +
    "SUBMODE",
    +
    "OPTIONS",
    +
    "FADE",
    +
    "Cmd121",
    +
    "STORE_OPEN_CLOSE",
    +
    "CONNECT_EURO",
    +
    "DISCONNECT_EURO",
    +
    "Cmd125",
    +
    "Cmd126",
    +
    "Cmd127"
    +
    };
    +
    +
    void setup() {
    +
    Serial.begin(9600);
    +
    }
    +
    +
    void loop() {
    +
    int cmd = ir.command();
    +
    if (cmd >= 0) {
    +
    Serial.print("IR system=");
    +
    Serial.print(ir.system());
    +
    Serial.print(" (RC5_SYS_");
    +
    Serial.print(systems[ir.system()]);
    +
    Serial.print("), command=");
    +
    Serial.print(cmd & 0x7F);
    +
    Serial.print(" (RC5_");
    +
    Serial.print(commands[cmd & 0x7F]);
    +
    Serial.print(")");
    + +
    Serial.println(", auto-repeat");
    +
    else
    +
    Serial.println();
    +
    }
    +
    }
    +
    + + diff --git a/ir_snake.html b/ir_snake.html index 69f7cd8d..aab2cade 100644 --- a/ir_snake.html +++ b/ir_snake.html @@ -2,29 +2,37 @@ + ArduinoLibs: Snake Video Game Using an Infrared Remote Control + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Snake Video Game Using an Infrared Remote Control
    -
    -
    -

    This example demonstrates the use of the DMD and IRreceiver classes. The full source code follows:

    -
    /*
    - * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
    - *
    - * 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 THE
    - * AUTHORS OR COPYRIGHT HOLDERS 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.
    - */
    -
    -#include <IRreceiver.h>
    -#include <DMD.h>
    -#include <Mono5x7.h>
    -
    -#define SNAKE_ADVANCE_TIME  150
    -#define SNAKE_BLINK_TIME    500
    -#define SNAKE_INC_STEPS     5
    -#define SNAKE_MAX_LENGTH    50
    -#define SNAKE_START_LENGTH  10
    -
    -struct Point
    -{
    -    int x, y;
    -};
    -
    -DMD display;
    -IRreceiver ir;
    -bool paused;
    -bool gameOver;
    -bool waitForStart;
    -bool snakeDrawn;
    -unsigned long lastChange;
    -Point direction;
    -Point snakeParts[SNAKE_MAX_LENGTH];
    -int snakeLength;
    -int incStep;
    -
    -ISR(TIMER1_OVF_vect)
    -{
    -    display.refresh();
    -}
    -
    -void setup() {
    -    display.enableTimer1();
    -    display.setFont(Mono5x7);
    -    startGame();
    -}
    -
    -void drawSnake(Bitmap::Color color) {
    -    for (int index = 0; index < snakeLength; ++index)
    -        display.setPixel(snakeParts[index].x, snakeParts[index].y, color);
    -}
    -
    -void loop() {
    -    // Handle the "Game Over" state.  Any key press starts a new game.
    -    int cmd = ir.command();
    -    if (gameOver) {
    -        if (cmd != -1 && (cmd & IRreceiver::AUTO_REPEAT) == 0)
    -            startGame();
    -        return;
    -    }
    -
    -    // Pause the game if waiting for the first start.  While waiting,
    -    // blink the location of the snake to help the player get their bearings.
    -    if (waitForStart) {
    -        if (cmd == -1) {
    -            if ((millis() - lastChange) >= SNAKE_BLINK_TIME) {
    -                snakeDrawn = !snakeDrawn;
    -                drawSnake(snakeDrawn ? Bitmap::White : Bitmap::Black);
    -                lastChange += SNAKE_BLINK_TIME;
    -            }
    -            return;
    -        }
    -        drawSnake(Bitmap::White);
    -        waitForStart = false;
    -        snakeDrawn = true;
    -        lastChange = millis();
    -    }
    -
    -    // Process commands from the player.
    -    switch (cmd) {
    -
    -    // Both arrow keys and numbers can be used to control the direction,
    -    // in case the remote control does not have arrow keys.
    -    case RC5_LEFT: case RC5_4:
    -        changeDirection(-1, 0);
    -        break;
    -    case RC5_RIGHT: case RC5_6:
    -        changeDirection(1, 0);
    -        break;
    -    case RC5_UP: case RC5_2:
    -        changeDirection(0, -1);
    -        break;
    -    case RC5_DOWN: case RC5_8:
    -        changeDirection(0, 1);
    -        break;
    -
    -    case RC5_PAUSE: case RC5_PLAY: case RC5_0:
    -        // Pause or resume the game.
    -        paused = !paused;
    -        lastChange = millis();
    -        break;
    -
    -    case RC5_STOP: case RC5_STANDBY:
    -        // Stop the game and start a new one.
    -        startGame();
    -        break;
    -    }
    -
    -    // Advance the snake position if not paused and the timeout has expired.
    -    if (!paused && (millis() - lastChange) >= SNAKE_ADVANCE_TIME) {
    -        ++incStep;
    -        advanceSnake(incStep >= SNAKE_INC_STEPS);
    -        lastChange += SNAKE_ADVANCE_TIME;
    -    }
    -}
    -
    -void startGame() {
    -    randomSeed(micros() + analogRead(A0)); // Analog read adds some noise.
    -    display.clear();
    -    display.drawRect(0, 0, display.width() - 1, display.height() - 1);
    -    for (int count = 0; count < 10; ++count) {
    -        int x, y;
    -        if (random(0, 2) == 0) {
    -            x = random(1, display.width() - 5);
    -            y = random(1, display.height() - 1);
    -            display.drawLine(x, y, x + 4, y);
    -        } else {
    -            x = random(1, display.width() - 1);
    -            y = random(1, display.height() - 3);
    -            display.drawLine(x, y, x, y + 2);
    -        }
    -    }
    -    paused = false;
    -    gameOver = false;
    -    waitForStart = true;
    -    snakeDrawn = true;
    -    lastChange = millis();
    -    direction.x = 1;
    -    direction.y = 0;
    -    incStep = 0;
    -    snakeLength = SNAKE_START_LENGTH;
    -    for (int index = 0; index < snakeLength; ++index) {
    -        snakeParts[index].x = 3 + index;
    -        snakeParts[index].y = 4;
    -        display.setPixel
    -            (snakeParts[index].x, snakeParts[index].y, Bitmap::White);
    -    }
    -}
    -
    -void changeDirection(int x, int y) {
    -    direction.x = x;
    -    direction.y = y;
    -}
    -
    -void advanceSnake(bool increase) {
    -    int x = snakeParts[snakeLength - 1].x + direction.x;
    -    int y = snakeParts[snakeLength - 1].y + direction.y;
    -    if (display.pixel(x, y) == Bitmap::White) {
    -        gameOver = true;
    -        display.clear();
    -        display.drawText(5, 0, "Game");
    -        display.drawText(3, 8, "Over!");
    -        return;
    -    }
    -    if (!increase || snakeLength >= SNAKE_MAX_LENGTH) {
    -        display.setPixel(snakeParts[0].x, snakeParts[0].y, Bitmap::Black);
    -        for (int index = 0; index < snakeLength - 1; ++index)
    -            snakeParts[index] = snakeParts[index + 1];
    -    } else {
    -        ++snakeLength;
    -    }
    -    snakeParts[snakeLength - 1].x = x;
    -    snakeParts[snakeLength - 1].y = y;
    -    display.setPixel(x, y, Bitmap::White);
    -    if (increase)
    -        incStep = 0;
    -}
    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -262,8 +72,209 @@ ISR(TIMER1_OVF_vect)
    - + +
    +
    +
    Snake Video Game Using an Infrared Remote Control
    +
    +
    +

    This example demonstrates the use of the DMD and IRreceiver classes. The full source code follows:

    +
    /*
    +
    * Copyright (C) 2012 Southern Storm Software, Pty Ltd.
    +
    *
    +
    * 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 THE
    +
    * AUTHORS OR COPYRIGHT HOLDERS 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.
    +
    */
    +
    +
    #include <IRreceiver.h>
    +
    #include <DMD.h>
    +
    #include <Mono5x7.h>
    +
    +
    #define SNAKE_ADVANCE_TIME 150
    +
    #define SNAKE_BLINK_TIME 500
    +
    #define SNAKE_INC_STEPS 5
    +
    #define SNAKE_MAX_LENGTH 50
    +
    #define SNAKE_START_LENGTH 10
    +
    +
    struct Point
    +
    {
    +
    int x, y;
    +
    };
    +
    +
    DMD display;
    + +
    bool paused;
    +
    bool gameOver;
    +
    bool waitForStart;
    +
    bool snakeDrawn;
    +
    unsigned long lastChange;
    +
    Point direction;
    +
    Point snakeParts[SNAKE_MAX_LENGTH];
    +
    int snakeLength;
    +
    int incStep;
    +
    +
    ISR(TIMER1_OVF_vect)
    +
    {
    +
    display.refresh();
    +
    }
    +
    +
    void setup() {
    +
    display.enableTimer1();
    +
    display.setFont(Mono5x7);
    +
    startGame();
    +
    }
    +
    +
    void drawSnake(Bitmap::Color color) {
    +
    for (int index = 0; index < snakeLength; ++index)
    +
    display.setPixel(snakeParts[index].x, snakeParts[index].y, color);
    +
    }
    +
    +
    void loop() {
    +
    // Handle the "Game Over" state. Any key press starts a new game.
    +
    int cmd = ir.command();
    +
    if (gameOver) {
    +
    if (cmd != -1 && (cmd & IRreceiver::AUTO_REPEAT) == 0)
    +
    startGame();
    +
    return;
    +
    }
    +
    +
    // Pause the game if waiting for the first start. While waiting,
    +
    // blink the location of the snake to help the player get their bearings.
    +
    if (waitForStart) {
    +
    if (cmd == -1) {
    +
    if ((millis() - lastChange) >= SNAKE_BLINK_TIME) {
    +
    snakeDrawn = !snakeDrawn;
    +
    drawSnake(snakeDrawn ? Bitmap::White : Bitmap::Black);
    +
    lastChange += SNAKE_BLINK_TIME;
    +
    }
    +
    return;
    +
    }
    +
    drawSnake(Bitmap::White);
    +
    waitForStart = false;
    +
    snakeDrawn = true;
    +
    lastChange = millis();
    +
    }
    +
    +
    // Process commands from the player.
    +
    switch (cmd) {
    +
    +
    // Both arrow keys and numbers can be used to control the direction,
    +
    // in case the remote control does not have arrow keys.
    +
    case RC5_LEFT: case RC5_4:
    +
    changeDirection(-1, 0);
    +
    break;
    +
    case RC5_RIGHT: case RC5_6:
    +
    changeDirection(1, 0);
    +
    break;
    +
    case RC5_UP: case RC5_2:
    +
    changeDirection(0, -1);
    +
    break;
    +
    case RC5_DOWN: case RC5_8:
    +
    changeDirection(0, 1);
    +
    break;
    +
    +
    case RC5_PAUSE: case RC5_PLAY: case RC5_0:
    +
    // Pause or resume the game.
    +
    paused = !paused;
    +
    lastChange = millis();
    +
    break;
    +
    +
    case RC5_STOP: case RC5_STANDBY:
    +
    // Stop the game and start a new one.
    +
    startGame();
    +
    break;
    +
    }
    +
    +
    // Advance the snake position if not paused and the timeout has expired.
    +
    if (!paused && (millis() - lastChange) >= SNAKE_ADVANCE_TIME) {
    +
    ++incStep;
    +
    advanceSnake(incStep >= SNAKE_INC_STEPS);
    +
    lastChange += SNAKE_ADVANCE_TIME;
    +
    }
    +
    }
    +
    +
    void startGame() {
    +
    randomSeed(micros() + analogRead(A0)); // Analog read adds some noise.
    +
    display.clear();
    +
    display.drawRect(0, 0, display.width() - 1, display.height() - 1);
    +
    for (int count = 0; count < 10; ++count) {
    +
    int x, y;
    +
    if (random(0, 2) == 0) {
    +
    x = random(1, display.width() - 5);
    +
    y = random(1, display.height() - 1);
    +
    display.drawLine(x, y, x + 4, y);
    +
    } else {
    +
    x = random(1, display.width() - 1);
    +
    y = random(1, display.height() - 3);
    +
    display.drawLine(x, y, x, y + 2);
    +
    }
    +
    }
    +
    paused = false;
    +
    gameOver = false;
    +
    waitForStart = true;
    +
    snakeDrawn = true;
    +
    lastChange = millis();
    +
    direction.x = 1;
    +
    direction.y = 0;
    +
    incStep = 0;
    +
    snakeLength = SNAKE_START_LENGTH;
    +
    for (int index = 0; index < snakeLength; ++index) {
    +
    snakeParts[index].x = 3 + index;
    +
    snakeParts[index].y = 4;
    +
    display.setPixel
    +
    (snakeParts[index].x, snakeParts[index].y, Bitmap::White);
    +
    }
    +
    }
    +
    +
    void changeDirection(int x, int y) {
    +
    direction.x = x;
    +
    direction.y = y;
    +
    }
    +
    +
    void advanceSnake(bool increase) {
    +
    int x = snakeParts[snakeLength - 1].x + direction.x;
    +
    int y = snakeParts[snakeLength - 1].y + direction.y;
    +
    if (display.pixel(x, y) == Bitmap::White) {
    +
    gameOver = true;
    +
    display.clear();
    +
    display.drawText(5, 0, "Game");
    +
    display.drawText(3, 8, "Over!");
    +
    return;
    +
    }
    +
    if (!increase || snakeLength >= SNAKE_MAX_LENGTH) {
    +
    display.setPixel(snakeParts[0].x, snakeParts[0].y, Bitmap::Black);
    +
    for (int index = 0; index < snakeLength - 1; ++index)
    +
    snakeParts[index] = snakeParts[index + 1];
    +
    } else {
    +
    ++snakeLength;
    +
    }
    +
    snakeParts[snakeLength - 1].x = x;
    +
    snakeParts[snakeLength - 1].y = y;
    +
    display.setPixel(x, y, Bitmap::White);
    +
    if (increase)
    +
    incStep = 0;
    +
    }
    +
    + + diff --git a/jquery.js b/jquery.js index c052173a..63939e76 100644 --- a/jquery.js +++ b/jquery.js @@ -1,54 +1,8 @@ -/* - * jQuery JavaScript Library v1.3.2 - * http://jquery.com/ - * - * Copyright (c) 2009 John Resig - * Dual licensed under the MIT and GPL licenses. - * http://docs.jquery.com/License - * - * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009) - * Revision: 6246 - */ -(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"","
    "]||!O.indexOf("
    "]||(!O.indexOf("
    "]||!O.indexOf("
    "]||!o.support.htmlSerialize&&[1,"div
    ","
    "]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/
    ';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})(); -/* - * jQuery UI 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI - */ -jQuery.ui||(function(c){var i=c.fn.remove,d=c.browser.mozilla&&(parseFloat(c.browser.version)<1.9);c.ui={version:"1.7.2",plugin:{add:function(k,l,n){var m=c.ui[k].prototype;for(var j in n){m.plugins[j]=m.plugins[j]||[];m.plugins[j].push([l,n[j]])}},call:function(j,l,k){var n=j.plugins[l];if(!n||!j.element[0].parentNode){return}for(var m=0;m0){return true}m[j]=1;l=(m[j]>0);m[j]=0;return l},isOverAxis:function(k,j,l){return(k>j)&&(k<(j+l))},isOver:function(o,k,n,m,j,l){return c.ui.isOverAxis(o,n,j)&&c.ui.isOverAxis(k,m,l)},keyCode:{BACKSPACE:8,CAPS_LOCK:20,COMMA:188,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38}};if(d){var f=c.attr,e=c.fn.removeAttr,h="http://www.w3.org/2005/07/aaa",a=/^aria-/,b=/^wairole:/;c.attr=function(k,j,l){var m=l!==undefined;return(j=="role"?(m?f.call(this,k,j,"wairole:"+l):(f.apply(this,arguments)||"").replace(b,"")):(a.test(j)?(m?k.setAttributeNS(h,j.replace(a,"aaa:"),l):f.call(this,k,j.replace(a,"aaa:"))):f.apply(this,arguments)))};c.fn.removeAttr=function(j){return(a.test(j)?this.each(function(){this.removeAttributeNS(h,j.replace(a,""))}):e.call(this,j))}}c.fn.extend({remove:function(){c("*",this).add(this).each(function(){c(this).triggerHandler("remove")});return i.apply(this,arguments)},enableSelection:function(){return this.attr("unselectable","off").css("MozUserSelect","").unbind("selectstart.ui")},disableSelection:function(){return this.attr("unselectable","on").css("MozUserSelect","none").bind("selectstart.ui",function(){return false})},scrollParent:function(){var j;if((c.browser.msie&&(/(static|relative)/).test(this.css("position")))||(/absolute/).test(this.css("position"))){j=this.parents().filter(function(){return(/(relative|absolute|fixed)/).test(c.curCSS(this,"position",1))&&(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}else{j=this.parents().filter(function(){return(/(auto|scroll)/).test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0)}return(/fixed/).test(this.css("position"))||!j.length?c(document):j}});c.extend(c.expr[":"],{data:function(l,k,j){return !!c.data(l,j[3])},focusable:function(k){var l=k.nodeName.toLowerCase(),j=c.attr(k,"tabindex");return(/input|select|textarea|button|object/.test(l)?!k.disabled:"a"==l||"area"==l?k.href||!isNaN(j):!isNaN(j))&&!c(k)["area"==l?"parents":"closest"](":hidden").length},tabbable:function(k){var j=c.attr(k,"tabindex");return(isNaN(j)||j>=0)&&c(k).is(":focusable")}});function g(m,n,o,l){function k(q){var p=c[m][n][q]||[];return(typeof p=="string"?p.split(/,?\s+/):p)}var j=k("getter");if(l.length==1&&typeof l[0]=="string"){j=j.concat(k("getterSetter"))}return(c.inArray(o,j)!=-1)}c.widget=function(k,j){var l=k.split(".")[0];k=k.split(".")[1];c.fn[k]=function(p){var n=(typeof p=="string"),o=Array.prototype.slice.call(arguments,1);if(n&&p.substring(0,1)=="_"){return this}if(n&&g(l,k,p,o)){var m=c.data(this[0],k);return(m?m[p].apply(m,o):undefined)}return this.each(function(){var q=c.data(this,k);(!q&&!n&&c.data(this,k,new c[l][k](this,p))._init());(q&&n&&c.isFunction(q[p])&&q[p].apply(q,o))})};c[l]=c[l]||{};c[l][k]=function(o,n){var m=this;this.namespace=l;this.widgetName=k;this.widgetEventPrefix=c[l][k].eventPrefix||k;this.widgetBaseClass=l+"-"+k;this.options=c.extend({},c.widget.defaults,c[l][k].defaults,c.metadata&&c.metadata.get(o)[k],n);this.element=c(o).bind("setData."+k,function(q,p,r){if(q.target==o){return m._setData(p,r)}}).bind("getData."+k,function(q,p){if(q.target==o){return m._getData(p)}}).bind("remove",function(){return m.destroy()})};c[l][k].prototype=c.extend({},c.widget.prototype,j);c[l][k].getterSetter="option"};c.widget.prototype={_init:function(){},destroy:function(){this.element.removeData(this.widgetName).removeClass(this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").removeAttr("aria-disabled")},option:function(l,m){var k=l,j=this;if(typeof l=="string"){if(m===undefined){return this._getData(l)}k={};k[l]=m}c.each(k,function(n,o){j._setData(n,o)})},_getData:function(j){return this.options[j]},_setData:function(j,k){this.options[j]=k;if(j=="disabled"){this.element[k?"addClass":"removeClass"](this.widgetBaseClass+"-disabled "+this.namespace+"-state-disabled").attr("aria-disabled",k)}},enable:function(){this._setData("disabled",false)},disable:function(){this._setData("disabled",true)},_trigger:function(l,m,n){var p=this.options[l],j=(l==this.widgetEventPrefix?l:this.widgetEventPrefix+l);m=c.Event(m);m.type=j;if(m.originalEvent){for(var k=c.event.props.length,o;k;){o=c.event.props[--k];m[o]=m.originalEvent[o]}}this.element.trigger(m,n);return !(c.isFunction(p)&&p.call(this.element[0],m,n)===false||m.isDefaultPrevented())}};c.widget.defaults={disabled:false};c.ui.mouse={_mouseInit:function(){var j=this;this.element.bind("mousedown."+this.widgetName,function(k){return j._mouseDown(k)}).bind("click."+this.widgetName,function(k){if(j._preventClickEvent){j._preventClickEvent=false;k.stopImmediatePropagation();return false}});if(c.browser.msie){this._mouseUnselectable=this.element.attr("unselectable");this.element.attr("unselectable","on")}this.started=false},_mouseDestroy:function(){this.element.unbind("."+this.widgetName);(c.browser.msie&&this.element.attr("unselectable",this._mouseUnselectable))},_mouseDown:function(l){l.originalEvent=l.originalEvent||{};if(l.originalEvent.mouseHandled){return}(this._mouseStarted&&this._mouseUp(l));this._mouseDownEvent=l;var k=this,m=(l.which==1),j=(typeof this.options.cancel=="string"?c(l.target).parents().add(l.target).filter(this.options.cancel).length:false);if(!m||j||!this._mouseCapture(l)){return true}this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){k.mouseDelayMet=true},this.options.delay)}if(this._mouseDistanceMet(l)&&this._mouseDelayMet(l)){this._mouseStarted=(this._mouseStart(l)!==false);if(!this._mouseStarted){l.preventDefault();return true}}this._mouseMoveDelegate=function(n){return k._mouseMove(n)};this._mouseUpDelegate=function(n){return k._mouseUp(n)};c(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);(c.browser.safari||l.preventDefault());l.originalEvent.mouseHandled=true;return true},_mouseMove:function(j){if(c.browser.msie&&!j.button){return this._mouseUp(j)}if(this._mouseStarted){this._mouseDrag(j);return j.preventDefault()}if(this._mouseDistanceMet(j)&&this._mouseDelayMet(j)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,j)!==false);(this._mouseStarted?this._mouseDrag(j):this._mouseUp(j))}return !this._mouseStarted},_mouseUp:function(j){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(j.target==this._mouseDownEvent.target);this._mouseStop(j)}return false},_mouseDistanceMet:function(j){return(Math.max(Math.abs(this._mouseDownEvent.pageX-j.pageX),Math.abs(this._mouseDownEvent.pageY-j.pageY))>=this.options.distance)},_mouseDelayMet:function(j){return this.mouseDelayMet},_mouseStart:function(j){},_mouseDrag:function(j){},_mouseStop:function(j){},_mouseCapture:function(j){return true}};c.ui.mouse.defaults={cancel:null,distance:1,delay:0}})(jQuery);;/* * jQuery UI Resizable 1.7.2 - * - * Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT (MIT-LICENSE.txt) - * and GPL (GPL-LICENSE.txt) licenses. - * - * http://docs.jquery.com/UI/Resizables - * - * Depends: - * ui.core.js - */ -(function(c){c.widget("ui.resizable",c.extend({},c.ui.mouse,{_init:function(){var e=this,j=this.options;this.element.addClass("ui-resizable");c.extend(this,{_aspectRatio:!!(j.aspectRatio),aspectRatio:j.aspectRatio,originalElement:this.element,_proportionallyResizeElements:[],_helper:j.helper||j.ghost||j.animate?j.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){if(/relative/.test(this.element.css("position"))&&c.browser.opera){this.element.css({position:"relative",top:"auto",left:"auto"})}this.element.wrap(c('
    ').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=j.handles||(!c(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all"){this.handles="n,e,s,w,se,sw,ne,nw"}var k=this.handles.split(",");this.handles={};for(var f=0;f
    ');if(/sw|se|ne|nw/.test(h)){g.css({zIndex:++j.zIndex})}if("se"==h){g.addClass("ui-icon ui-icon-gripsmall-diagonal-se")}this.handles[h]=".ui-resizable-"+h;this.element.append(g)}}this._renderAxis=function(p){p=p||this.element;for(var m in this.handles){if(this.handles[m].constructor==String){this.handles[m]=c(this.handles[m],this.element).show()}if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var n=c(this.handles[m],this.element),o=0;o=/sw|ne|nw|se|n|s/.test(m)?n.outerHeight():n.outerWidth();var l=["padding",/ne|nw|n/.test(m)?"Top":/se|sw|s/.test(m)?"Bottom":/^e$/.test(m)?"Right":"Left"].join("");p.css(l,o);this._proportionallyResize()}if(!c(this.handles[m]).length){continue}}};this._renderAxis(this.element);this._handles=c(".ui-resizable-handle",this.element).disableSelection();this._handles.mouseover(function(){if(!e.resizing){if(this.className){var i=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)}e.axis=i&&i[1]?i[1]:"se"}});if(j.autoHide){this._handles.hide();c(this.element).addClass("ui-resizable-autohide").hover(function(){c(this).removeClass("ui-resizable-autohide");e._handles.show()},function(){if(!e.resizing){c(this).addClass("ui-resizable-autohide");e._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var d=function(f){c(f).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var e=this.element;e.parent().append(this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")})).end().remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement)},_mouseCapture:function(e){var f=false;for(var d in this.handles){if(c(this.handles[d])[0]==e.target){f=true}}return this.options.disabled||!!f},_mouseStart:function(f){var i=this.options,e=this.element.position(),d=this.element;this.resizing=true;this.documentScroll={top:c(document).scrollTop(),left:c(document).scrollLeft()};if(d.is(".ui-draggable")||(/absolute/).test(d.css("position"))){d.css({position:"absolute",top:e.top,left:e.left})}if(c.browser.opera&&(/relative/).test(d.css("position"))){d.css({position:"relative",top:"auto",left:"auto"})}this._renderProxy();var j=b(this.helper.css("left")),g=b(this.helper.css("top"));if(i.containment){j+=c(i.containment).scrollLeft()||0;g+=c(i.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:j,top:g};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:j,top:g};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:f.pageX,top:f.pageY};this.aspectRatio=(typeof i.aspectRatio=="number")?i.aspectRatio:((this.originalSize.width/this.originalSize.height)||1);var h=c(".ui-resizable-"+this.axis).css("cursor");c("body").css("cursor",h=="auto"?this.axis+"-resize":h);d.addClass("ui-resizable-resizing");this._propagate("start",f);return true},_mouseDrag:function(d){var g=this.helper,f=this.options,l={},p=this,i=this.originalMousePosition,m=this.axis;var q=(d.pageX-i.left)||0,n=(d.pageY-i.top)||0;var h=this._change[m];if(!h){return false}var k=h.apply(this,[d,q,n]),j=c.browser.msie&&c.browser.version<7,e=this.sizeDiff;if(this._aspectRatio||d.shiftKey){k=this._updateRatio(k,d)}k=this._respectSize(k,d);this._propagate("resize",d);g.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});if(!this._helper&&this._proportionallyResizeElements.length){this._proportionallyResize()}this._updateCache(k);this._trigger("resize",d,this.ui());return false},_mouseStop:function(g){this.resizing=false;var h=this.options,l=this;if(this._helper){var f=this._proportionallyResizeElements,d=f.length&&(/textarea/i).test(f[0].nodeName),e=d&&c.ui.hasScroll(f[0],"left")?0:l.sizeDiff.height,j=d?0:l.sizeDiff.width;var m={width:(l.size.width-j),height:(l.size.height-e)},i=(parseInt(l.element.css("left"),10)+(l.position.left-l.originalPosition.left))||null,k=(parseInt(l.element.css("top"),10)+(l.position.top-l.originalPosition.top))||null;if(!h.animate){this.element.css(c.extend(m,{top:k,left:i}))}l.helper.height(l.size.height);l.helper.width(l.size.width);if(this._helper&&!h.animate){this._proportionallyResize()}}c("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",g);if(this._helper){this.helper.remove()}return false},_updateCache:function(d){var e=this.options;this.offset=this.helper.offset();if(a(d.left)){this.position.left=d.left}if(a(d.top)){this.position.top=d.top}if(a(d.height)){this.size.height=d.height}if(a(d.width)){this.size.width=d.width}},_updateRatio:function(g,f){var h=this.options,i=this.position,e=this.size,d=this.axis;if(g.height){g.width=(e.height*this.aspectRatio)}else{if(g.width){g.height=(e.width/this.aspectRatio)}}if(d=="sw"){g.left=i.left+(e.width-g.width);g.top=null}if(d=="nw"){g.top=i.top+(e.height-g.height);g.left=i.left+(e.width-g.width)}return g},_respectSize:function(k,f){var i=this.helper,h=this.options,q=this._aspectRatio||f.shiftKey,p=this.axis,s=a(k.width)&&h.maxWidth&&(h.maxWidthk.width),r=a(k.height)&&h.minHeight&&(h.minHeight>k.height);if(g){k.width=h.minWidth}if(r){k.height=h.minHeight}if(s){k.width=h.maxWidth}if(l){k.height=h.maxHeight}var e=this.originalPosition.left+this.originalSize.width,n=this.position.top+this.size.height;var j=/sw|nw|w/.test(p),d=/nw|ne|n/.test(p);if(g&&j){k.left=e-h.minWidth}if(s&&j){k.left=e-h.maxWidth}if(r&&d){k.top=n-h.minHeight}if(l&&d){k.top=n-h.maxHeight}var m=!k.width&&!k.height;if(m&&!k.left&&k.top){k.top=null}else{if(m&&!k.top&&k.left){k.left=null}}return k},_proportionallyResize:function(){var j=this.options;if(!this._proportionallyResizeElements.length){return}var f=this.helper||this.element;for(var e=0;e
    ');var d=c.browser.msie&&c.browser.version<7,f=(d?1:0),g=(d?2:-1);this.helper.addClass(this._helper).css({width:this.element.outerWidth()+g,height:this.element.outerHeight()+g,position:"absolute",left:this.elementOffset.left-f+"px",top:this.elementOffset.top-f+"px",zIndex:++h.zIndex});this.helper.appendTo("body").disableSelection()}else{this.helper=this.element}},_change:{e:function(f,e,d){return{width:this.originalSize.width+e}},w:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{left:h.left+e,width:f.width-e}},n:function(g,e,d){var i=this.options,f=this.originalSize,h=this.originalPosition;return{top:h.top+d,height:f.height-d}},s:function(f,e,d){return{height:this.originalSize.height+d}},se:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},sw:function(f,e,d){return c.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[f,e,d]))},ne:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[f,e,d]))},nw:function(f,e,d){return c.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[f,e,d]))}},_propagate:function(e,d){c.ui.plugin.call(this,e,[d,this.ui()]);(e!="resize"&&this._trigger(e,d,this.ui()))},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}));c.extend(c.ui.resizable,{version:"1.7.2",eventPrefix:"resize",defaults:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,cancel:":input,option",containment:false,delay:0,distance:1,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1000}});c.ui.plugin.add("resizable","alsoResize",{start:function(e,f){var d=c(this).data("resizable"),g=d.options;_store=function(h){c(h).each(function(){c(this).data("resizable-alsoresize",{width:parseInt(c(this).width(),10),height:parseInt(c(this).height(),10),left:parseInt(c(this).css("left"),10),top:parseInt(c(this).css("top"),10)})})};if(typeof(g.alsoResize)=="object"&&!g.alsoResize.parentNode){if(g.alsoResize.length){g.alsoResize=g.alsoResize[0];_store(g.alsoResize)}else{c.each(g.alsoResize,function(h,i){_store(h)})}}else{_store(g.alsoResize)}},resize:function(f,h){var e=c(this).data("resizable"),i=e.options,g=e.originalSize,k=e.originalPosition;var j={height:(e.size.height-g.height)||0,width:(e.size.width-g.width)||0,top:(e.position.top-k.top)||0,left:(e.position.left-k.left)||0},d=function(l,m){c(l).each(function(){var p=c(this),q=c(this).data("resizable-alsoresize"),o={},n=m&&m.length?m:["width","height","top","left"];c.each(n||["width","height","top","left"],function(r,t){var s=(q[t]||0)+(j[t]||0);if(s&&s>=0){o[t]=s||null}});if(/relative/.test(p.css("position"))&&c.browser.opera){e._revertToRelativePosition=true;p.css({position:"absolute",top:"auto",left:"auto"})}p.css(o)})};if(typeof(i.alsoResize)=="object"&&!i.alsoResize.nodeType){c.each(i.alsoResize,function(l,m){d(l,m)})}else{d(i.alsoResize)}},stop:function(e,f){var d=c(this).data("resizable");if(d._revertToRelativePosition&&c.browser.opera){d._revertToRelativePosition=false;el.css({position:"relative"})}c(this).removeData("resizable-alsoresize-start")}});c.ui.plugin.add("resizable","animate",{stop:function(h,m){var n=c(this).data("resizable"),i=n.options;var g=n._proportionallyResizeElements,d=g.length&&(/textarea/i).test(g[0].nodeName),e=d&&c.ui.hasScroll(g[0],"left")?0:n.sizeDiff.height,k=d?0:n.sizeDiff.width;var f={width:(n.size.width-k),height:(n.size.height-e)},j=(parseInt(n.element.css("left"),10)+(n.position.left-n.originalPosition.left))||null,l=(parseInt(n.element.css("top"),10)+(n.position.top-n.originalPosition.top))||null;n.element.animate(c.extend(f,l&&j?{top:l,left:j}:{}),{duration:i.animateDuration,easing:i.animateEasing,step:function(){var o={width:parseInt(n.element.css("width"),10),height:parseInt(n.element.css("height"),10),top:parseInt(n.element.css("top"),10),left:parseInt(n.element.css("left"),10)};if(g&&g.length){c(g[0]).css({width:o.width,height:o.height})}n._updateCache(o);n._propagate("resize",h)}})}});c.ui.plugin.add("resizable","containment",{start:function(e,q){var s=c(this).data("resizable"),i=s.options,k=s.element;var f=i.containment,j=(f instanceof c)?f.get(0):(/parent/.test(f))?k.parent().get(0):f;if(!j){return}s.containerElement=c(j);if(/document/.test(f)||f==document){s.containerOffset={left:0,top:0};s.containerPosition={left:0,top:0};s.parentData={element:c(document),left:0,top:0,width:c(document).width(),height:c(document).height()||document.body.parentNode.scrollHeight}}else{var m=c(j),h=[];c(["Top","Right","Left","Bottom"]).each(function(p,o){h[p]=b(m.css("padding"+o))});s.containerOffset=m.offset();s.containerPosition=m.position();s.containerSize={height:(m.innerHeight()-h[3]),width:(m.innerWidth()-h[1])};var n=s.containerOffset,d=s.containerSize.height,l=s.containerSize.width,g=(c.ui.hasScroll(j,"left")?j.scrollWidth:l),r=(c.ui.hasScroll(j)?j.scrollHeight:d);s.parentData={element:j,left:n.left,top:n.top,width:g,height:r}}},resize:function(f,p){var s=c(this).data("resizable"),h=s.options,e=s.containerSize,n=s.containerOffset,l=s.size,m=s.position,q=s._aspectRatio||f.shiftKey,d={top:0,left:0},g=s.containerElement;if(g[0]!=document&&(/static/).test(g.css("position"))){d=n}if(m.left<(s._helper?n.left:0)){s.size.width=s.size.width+(s._helper?(s.position.left-n.left):(s.position.left-d.left));if(q){s.size.height=s.size.width/h.aspectRatio}s.position.left=h.helper?n.left:0}if(m.top<(s._helper?n.top:0)) -{s.size.height=s.size.height+(s._helper?(s.position.top-n.top):s.position.top);if(q){s.size.width=s.size.height*h.aspectRatio}s.position.top=s._helper?n.top:0}s.offset.left=s.parentData.left+s.position.left;s.offset.top=s.parentData.top+s.position.top;var k=Math.abs((s._helper?s.offset.left-d.left:(s.offset.left-d.left))+s.sizeDiff.width),r=Math.abs((s._helper?s.offset.top-d.top:(s.offset.top-n.top))+s.sizeDiff.height);var j=s.containerElement.get(0)==s.element.parent().get(0),i=/relative|absolute/.test(s.containerElement.css("position"));if(j&&i){k-=s.parentData.left}if(k+s.size.width>=s.parentData.width){s.size.width=s.parentData.width-k;if(q){s.size.height=s.size.width/s.aspectRatio}}if(r+s.size.height>=s.parentData.height){s.size.height=s.parentData.height-r;if(q){s.size.width=s.size.height*s.aspectRatio}}},stop:function(e,m){var p=c(this).data("resizable"),f=p.options,k=p.position,l=p.containerOffset,d=p.containerPosition,g=p.containerElement;var i=c(p.helper),q=i.offset(),n=i.outerWidth()-p.sizeDiff.width,j=i.outerHeight()-p.sizeDiff.height;if(p._helper&&!f.animate&&(/relative/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}if(p._helper&&!f.animate&&(/static/).test(g.css("position"))){c(this).css({left:q.left-d.left-l.left,width:n,height:j})}}});c.ui.plugin.add("resizable","ghost",{start:function(f,g){var d=c(this).data("resizable"),h=d.options,e=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof h.ghost=="string"?h.ghost:"");d.ghost.appendTo(d.helper)},resize:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost){d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})}},stop:function(e,f){var d=c(this).data("resizable"),g=d.options;if(d.ghost&&d.helper){d.helper.get(0).removeChild(d.ghost.get(0))}}});c.ui.plugin.add("resizable","grid",{resize:function(d,l){var n=c(this).data("resizable"),g=n.options,j=n.size,h=n.originalSize,i=n.originalPosition,m=n.axis,k=g._aspectRatio||d.shiftKey;g.grid=typeof g.grid=="number"?[g.grid,g.grid]:g.grid;var f=Math.round((j.width-h.width)/(g.grid[0]||1))*(g.grid[0]||1),e=Math.round((j.height-h.height)/(g.grid[1]||1))*(g.grid[1]||1);if(/^(se|s|e)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e}else{if(/^(ne)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e}else{if(/^(sw)$/.test(m)){n.size.width=h.width+f;n.size.height=h.height+e;n.position.left=i.left-f}else{n.size.width=h.width+f;n.size.height=h.height+e;n.position.top=i.top-e;n.position.left=i.left-f}}}}});var b=function(d){return parseInt(d,10)||0};var a=function(d){return !isNaN(parseInt(d,10))}})(jQuery);; -/** - * jQuery.ScrollTo - Easy element scrolling using jQuery. - * Copyright (c) 2008 Ariel Flesler - aflesler(at)gmail(dot)com - * Licensed under GPL license (http://www.opensource.org/licenses/gpl-license.php). - * Date: 2/8/2008 - * @author Ariel Flesler - * @version 1.3.2 - */ -;(function($){var o=$.scrollTo=function(a,b,c){o.window().scrollTo(a,b,c)};o.defaults={axis:'y',duration:1};o.window=function(){return $($.browser.safari?'body':'html')};$.fn.scrollTo=function(l,m,n){if(typeof m=='object'){n=m;m=0}n=$.extend({},o.defaults,n);m=m||n.speed||n.duration;n.queue=n.queue&&n.axis.length>1;if(n.queue)m/=2;n.offset=j(n.offset);n.over=j(n.over);return this.each(function(){var a=this,b=$(a),t=l,c,d={},w=b.is('html,body');switch(typeof t){case'number':case'string':if(/^([+-]=)?\d+(px)?$/.test(t)){t=j(t);break}t=$(t,this);case'object':if(t.is||t.style)c=(t=$(t)).offset()}$.each(n.axis.split(''),function(i,f){var P=f=='x'?'Left':'Top',p=P.toLowerCase(),k='scroll'+P,e=a[k],D=f=='x'?'Width':'Height';if(c){d[k]=c[p]+(w?0:e-b.offset()[p]);if(n.margin){d[k]-=parseInt(t.css('margin'+P))||0;d[k]-=parseInt(t.css('border'+P+'Width'))||0}d[k]+=n.offset[p]||0;if(n.over[p])d[k]+=t[D.toLowerCase()]()*n.over[p]}else d[k]=t[p];if(/^\d+$/.test(d[k]))d[k]=d[k]<=0?0:Math.min(d[k],h(D));if(!i&&n.queue){if(e!=d[k])g(n.onAfterFirst);delete d[k]}});g(n.onAfter);function g(a){b.animate(d,m,n.easing,a&&function(){a.call(this,l)})};function h(D){var b=w?$.browser.opera?document.body:document.documentElement:a;return b['scroll'+D]-b['client'+D]}})};function j(a){return typeof a=='object'?a:{top:a,left:a}}})(jQuery); - +/*! jQuery v1.7.1 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; +f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/
    ","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")), +f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() +{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c) +{if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); diff --git a/lcd-form_8dox.html b/lcd-form_8dox.html index 0da5064c..27ffa1a6 100644 --- a/lcd-form_8dox.html +++ b/lcd-form_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: lcd-form.dox File Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    lcd-form.dox File Reference
    -
    -
    - -
    -

    Detailed Description

    -
    -

    Definition in file lcd-form.dox.

    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    lcd-form.dox File Reference
    +
    +
    +

    Detailed Description

    +
    +

    Definition in file lcd-form.dox.

    +
    + + diff --git a/lcd-helloworld_8dox.html b/lcd-helloworld_8dox.html index c0c9698b..2b25a247 100644 --- a/lcd-helloworld_8dox.html +++ b/lcd-helloworld_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: lcd-helloworld.dox File Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    lcd-helloworld.dox File Reference
    -
    -
    - -
    -

    Detailed Description

    -
    -

    Definition in file lcd-helloworld.dox.

    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    lcd-helloworld.dox File Reference
    +
    +
    +

    Detailed Description

    +
    +

    Definition in file lcd-helloworld.dox.

    +
    + + diff --git a/lcd_form.html b/lcd_form.html index 948b51f2..3aee8bec 100644 --- a/lcd_form.html +++ b/lcd_form.html @@ -2,29 +2,37 @@ + ArduinoLibs: Form example for LCD displays + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    Form example for LCD displays
    -
    +

    The Form and Field classes simplify the process of building user interfaces for Arduino projects that use a Freetronics LCD shield. That shield has a 16x2 LCD display and five buttons for Up, Down, Left, Right, and Select.

    The user interface is organised as a "form" which consists of one or more "fields" that display or modify a single program parameter. The Left and Right buttons are used to navigate between fields, and the Up and Down buttons are used to modify the value of the currently-displayed field.

    @@ -62,22 +84,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search'); FormText.png

    We start by including the classes from the library that we will need:

    -
    #include <LCD.h>
    -#include <Form.h>
    -#include <TextField.h>
    -#include <TimeField.h>
    -#include <IntField.h>
    -#include <BoolField.h>
    -

    +
    #include <LCD.h>
    +
    #include <Form.h>
    +
    #include <TextField.h>
    +
    #include <TimeField.h>
    +
    #include <IntField.h>
    +
    #include <BoolField.h>
    +

    Next, we initialize the LCD display, create the main form, and populate it with fields:

    -
    LCD lcd;
    -Form mainForm(lcd);
    -TextField welcomeField(mainForm, "Form example", "v1.0");
    -TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
    -IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
    -BoolField ledField(mainForm, "Status LED", "On", "Off", true);
    -TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
    -

    +
    LCD lcd;
    +
    Form mainForm(lcd);
    +
    TextField welcomeField(mainForm, "Form example", "v1.0");
    +
    TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
    +
    IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
    +
    BoolField ledField(mainForm, "Status LED", "On", "Off", true);
    +
    TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
    +

    Each field has a specific type, which may be one of the following classes:

    • BoolField displays a boolean on/off value with the Up and Down buttons used to toggle its state.
    • @@ -94,119 +116,108 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    • durationField which displays a read-write time field for selecting a duration between 0 and 24 hours.

    Now that we have defined our form, we need to initialize the program and show the form for the first time:

    -
    #define STATUS_LED 13
    -
    -void setup() {
    -  // Status LED initially on.
    -  pinMode(STATUS_LED, OUTPUT);
    -  digitalWrite(STATUS_LED, HIGH);
    -  
    -  // Enable the screen saver, which will automatically blank the screen after 10 seconds.
    -  // The screen will wake up again when a button is pressed or lcd.display() is called.
    -  lcd.enableScreenSaver();
    -  
    -  // Show the main form for the first time.
    -  mainForm.show();
    -}
    -

    +
    #define STATUS_LED 13
    +
    +
    void setup() {
    +
    // Status LED initially on.
    +
    pinMode(STATUS_LED, OUTPUT);
    +
    digitalWrite(STATUS_LED, HIGH);
    +
    +
    // Enable the screen saver, which will automatically blank the screen after 10 seconds.
    +
    // The screen will wake up again when a button is pressed or lcd.display() is called.
    + +
    +
    // Show the main form for the first time.
    +
    mainForm.show();
    +
    }
    +

    An application can have multiple forms, but only one can be shown at any given time. To switch to another form, call Form::hide() on the old form and Form::show() on the new form.

    All that remains is to define our application's loop function which retrieves button events from LCD::getButton() and dispatches them to the form:

    -
    void loop() {
    -  // Update the number of seconds since reset:
    -  timeField.setValue(millis() / 1000);
    -
    -  // Dispatch button events to the main form.
    -  int event = lcd.getButton();
    -  if (mainForm.dispatch(event) == FORM_CHANGED) {
    -    if (mainForm.isCurrent(ledField)) {
    -      if (ledField.value())
    -        digitalWrite(STATUS_LED, HIGH);
    -      else
    -        digitalWrite(STATUS_LED, LOW);
    -    }
    -  }
    -}
    -

    +
    void loop() {
    +
    // Update the number of seconds since reset:
    +
    timeField.setValue(millis() / 1000);
    +
    +
    // Dispatch button events to the main form.
    +
    int event = lcd.getButton();
    +
    if (mainForm.dispatch(event) == FORM_CHANGED) {
    +
    if (mainForm.isCurrent(ledField)) {
    +
    if (ledField.value())
    +
    digitalWrite(STATUS_LED, HIGH);
    +
    else
    +
    digitalWrite(STATUS_LED, LOW);
    +
    }
    +
    }
    +
    }
    +

    The full source code for the example follows:

    -
    /*
    -This example demonstrates how to use the Form and Field classes from the
    -LCD library to provide a simple UI on the 16x2 LCD display.
    -
    -This example is placed into the public domain.
    -*/
    -
    -// include the library code:
    -#include <LCD.h>
    -#include <Form.h>
    -#include <TextField.h>
    -#include <TimeField.h>
    -#include <IntField.h>
    -#include <BoolField.h>
    -
    -// Initialize the LCD
    -LCD lcd;
    -
    -// Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
    -// other pin (e.g. A1), then you will need to initialize the shield with something like:
    -// LCD lcd(A1);
    -// See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
    -
    -// Create the main form and its fields.
    -Form mainForm(lcd);
    -TextField welcomeField(mainForm, "Form example", "v1.0");
    -TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
    -IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
    -BoolField ledField(mainForm, "Status LED", "On", "Off", true);
    -TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
    -
    -#define STATUS_LED 13
    -
    -void setup() {
    -  // Status LED initially on.
    -  pinMode(STATUS_LED, OUTPUT);
    -  digitalWrite(STATUS_LED, HIGH);
    -  
    -  // Enable the screen saver, which will automatically blank the screen after 10 seconds.
    -  // The screen will wake up again when a button is pressed or lcd.display() is called.
    -  lcd.enableScreenSaver();
    -  
    -  // Show the main form for the first time.
    -  mainForm.show();
    -}
    -
    -void loop() {
    -  // Update the number of seconds since reset:
    -  timeField.setValue(millis() / 1000);
    -
    -  // Dispatch button events to the main form.
    -  int event = lcd.getButton();
    -  if (mainForm.dispatch(event) == FORM_CHANGED) {
    -    if (mainForm.isCurrent(ledField)) {
    -      if (ledField.value())
    -        digitalWrite(STATUS_LED, HIGH);
    -      else
    -        digitalWrite(STATUS_LED, LOW);
    -    }
    -  }
    -}
    -
    -
    - - - - -
    - -
    - - +
    /*
    +
    This example demonstrates how to use the Form and Field classes from the
    +
    LCD library to provide a simple UI on the 16x2 LCD display.
    +
    +
    This example is placed into the public domain.
    +
    */
    +
    +
    // include the library code:
    +
    #include <LCD.h>
    +
    #include <Form.h>
    +
    #include <TextField.h>
    +
    #include <TimeField.h>
    +
    #include <IntField.h>
    +
    #include <BoolField.h>
    +
    +
    // Initialize the LCD
    +
    LCD lcd;
    +
    +
    // Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
    +
    // other pin (e.g. A1), then you will need to initialize the shield with something like:
    +
    // LCD lcd(A1);
    +
    // See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
    +
    +
    // Create the main form and its fields.
    +
    Form mainForm(lcd);
    +
    TextField welcomeField(mainForm, "Form example", "v1.0");
    +
    TimeField timeField(mainForm, "Time since reset", 24, TIMEFIELD_READ_ONLY);
    +
    IntField volumeField(mainForm, "Volume", 0, 100, 5, 85, "%");
    +
    BoolField ledField(mainForm, "Status LED", "On", "Off", true);
    +
    TimeField durationField(mainForm, "Timer duration", 24, TIMEFIELD_READ_WRITE);
    +
    +
    #define STATUS_LED 13
    +
    +
    void setup() {
    +
    // Status LED initially on.
    +
    pinMode(STATUS_LED, OUTPUT);
    +
    digitalWrite(STATUS_LED, HIGH);
    +
    +
    // Enable the screen saver, which will automatically blank the screen after 10 seconds.
    +
    // The screen will wake up again when a button is pressed or lcd.display() is called.
    + +
    +
    // Show the main form for the first time.
    +
    mainForm.show();
    +
    }
    +
    +
    void loop() {
    +
    // Update the number of seconds since reset:
    +
    timeField.setValue(millis() / 1000);
    +
    +
    // Dispatch button events to the main form.
    +
    int event = lcd.getButton();
    +
    if (mainForm.dispatch(event) == FORM_CHANGED) {
    +
    if (mainForm.isCurrent(ledField)) {
    +
    if (ledField.value())
    +
    digitalWrite(STATUS_LED, HIGH);
    +
    else
    +
    digitalWrite(STATUS_LED, LOW);
    +
    }
    +
    }
    +
    }
    +
    +
    + + diff --git a/lcd_hello_world.html b/lcd_hello_world.html index dee70941..1f9f1f66 100644 --- a/lcd_hello_world.html +++ b/lcd_hello_world.html @@ -2,29 +2,37 @@ + ArduinoLibs: Hello World for Freetronics LCD + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Hello World for Freetronics LCD
    -
    -
    -

    The LCD class provides an enhanced version of the standard Arduino LiquidCrystal library that supports the additional features of the Freetronics LCD shield; namely the back light and the Up, Down, Left, Right, and Select buttons. This tutorial explains how to use the LCD class to perform basic text output and to use the enhanced shield features.

    -
    -HelloWorld.png -
    -

    We start by including the library and initializing it:

    -
    #include <LCD.h>
    -LCD lcd;
    -

    -

    Unlike the LiquidCrystal library we don't normally need to specify the pin assignments for this shield. The one exception is when the shield is used with the USBDroid and the D9 pin is reassigned as described on this page. In that case, the initialization sequence would look something like this instead:

    -
    LCD lcd(A1);
    -

    The next step is to enable the screen saver and print some text in the setup function:

    -
    void setup() {
    -  lcd.enableScreenSaver();
    -  lcd.print("hello, world!");
    -}
    -

    -

    The screen saver is a built-in feature of the LCD class that turns off the display and the back light after a specific timeout (the default is 10 seconds). Pressing any of the keys on the shield or calling LCD::display() will wake up the screen again.

    -

    In the program's loop function we print the number of seconds since startup to the second line of the LCD display:

    -
    void loop() {
    -  lcd.setCursor(0, 1);
    -  lcd.print(millis() / 1000);
    -

    -

    We then print the name of the button that is currently pressed:

    -
      lcd.setCursor(8, 1);
    -  int button = lcd.getButton();
    -  if (button == LCD_BUTTON_LEFT)
    -    lcd.print("LEFT");
    -  else if (button == LCD_BUTTON_RIGHT)
    -    lcd.print("RIGHT");
    -  else if (button == LCD_BUTTON_UP)
    -    lcd.print("UP");
    -  else if (button == LCD_BUTTON_DOWN)
    -    lcd.print("DOWN");
    -  else if (button == LCD_BUTTON_SELECT)
    -    lcd.print("SELECT");
    -  else if (button < 0) // button release
    -    lcd.print("      ");
    -}
    -

    -

    The LCD::getButton() function returns the key that has been pressed or released, or LCD_BUTTON_NONE if no key has been pressed or released this time through the loop.

    -

    The full source code for the example follows:

    -
    /*
    -This example demonstrates how to use the LCD library, which extends the
    -standard LiquidCrystal library to provide support for the Freetronics back light
    -and Up/Down/Left/Right/Select buttons.  More information on the shield here:
    -
    -http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide
    -
    -This example is placed into the public domain.
    -*/
    -
    -#include <LCD.h>
    -LCD lcd;
    -
    -// Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
    -// other pin (e.g. A1), then you will need to initialize the shield with something like:
    -// LCD lcd(A1);
    -// See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
    -
    -void setup() {
    -  lcd.enableScreenSaver();
    -  lcd.print("hello, world!");
    -}
    -
    -void loop() {
    -  lcd.setCursor(0, 1);
    -  lcd.print(millis() / 1000);
    -
    -  lcd.setCursor(8, 1);
    -  int button = lcd.getButton();
    -  if (button == LCD_BUTTON_LEFT)
    -    lcd.print("LEFT");
    -  else if (button == LCD_BUTTON_RIGHT)
    -    lcd.print("RIGHT");
    -  else if (button == LCD_BUTTON_UP)
    -    lcd.print("UP");
    -  else if (button == LCD_BUTTON_DOWN)
    -    lcd.print("DOWN");
    -  else if (button == LCD_BUTTON_SELECT)
    -    lcd.print("SELECT");
    -  else if (button < 0) // button release
    -    lcd.print("      ");
    -}
    -
    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -155,8 +72,102 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    Hello World for Freetronics LCD
    +
    +
    +

    The LCD class provides an enhanced version of the standard Arduino LiquidCrystal library that supports the additional features of the Freetronics LCD shield; namely the back light and the Up, Down, Left, Right, and Select buttons. This tutorial explains how to use the LCD class to perform basic text output and to use the enhanced shield features.

    +
    +HelloWorld.png +
    +

    We start by including the library and initializing it:

    +
    #include <LCD.h>
    +
    LCD lcd;
    +

    +

    Unlike the LiquidCrystal library we don't normally need to specify the pin assignments for this shield. The one exception is when the shield is used with the USBDroid and the D9 pin is reassigned as described on this page. In that case, the initialization sequence would look something like this instead:

    +
    LCD lcd(A1);
    +

    The next step is to enable the screen saver and print some text in the setup function:

    +
    void setup() {
    + +
    lcd.print("hello, world!");
    +
    }
    +

    +

    The screen saver is a built-in feature of the LCD class that turns off the display and the back light after a specific timeout (the default is 10 seconds). Pressing any of the keys on the shield or calling LCD::display() will wake up the screen again.

    +

    In the program's loop function we print the number of seconds since startup to the second line of the LCD display:

    +
    void loop() {
    +
    lcd.setCursor(0, 1);
    +
    lcd.print(millis() / 1000);
    +

    +

    We then print the name of the button that is currently pressed:

    +
    lcd.setCursor(8, 1);
    +
    int button = lcd.getButton();
    +
    if (button == LCD_BUTTON_LEFT)
    +
    lcd.print("LEFT");
    +
    else if (button == LCD_BUTTON_RIGHT)
    +
    lcd.print("RIGHT");
    +
    else if (button == LCD_BUTTON_UP)
    +
    lcd.print("UP");
    +
    else if (button == LCD_BUTTON_DOWN)
    +
    lcd.print("DOWN");
    +
    else if (button == LCD_BUTTON_SELECT)
    +
    lcd.print("SELECT");
    +
    else if (button < 0) // button release
    +
    lcd.print(" ");
    +
    }
    +

    +

    The LCD::getButton() function returns the key that has been pressed or released, or LCD_BUTTON_NONE if no key has been pressed or released this time through the loop.

    +

    The full source code for the example follows:

    +
    /*
    +
    This example demonstrates how to use the LCD library, which extends the
    +
    standard LiquidCrystal library to provide support for the Freetronics back light
    +
    and Up/Down/Left/Right/Select buttons. More information on the shield here:
    +
    +
    http://www.freetronics.com/pages/16x2-lcd-shield-quickstart-guide
    +
    +
    This example is placed into the public domain.
    +
    */
    +
    +
    #include <LCD.h>
    +
    LCD lcd;
    +
    +
    // Note: if you are using the USBDroid and have reassigned pin D9 on the LCD shield to some
    +
    // other pin (e.g. A1), then you will need to initialize the shield with something like:
    +
    // LCD lcd(A1);
    +
    // See also: http://www.freetronics.com/pages/combining-the-lcd-keypad-shield-and-the-usbdroid
    +
    +
    void setup() {
    + +
    lcd.print("hello, world!");
    +
    }
    +
    +
    void loop() {
    +
    lcd.setCursor(0, 1);
    +
    lcd.print(millis() / 1000);
    +
    +
    lcd.setCursor(8, 1);
    +
    int button = lcd.getButton();
    +
    if (button == LCD_BUTTON_LEFT)
    +
    lcd.print("LEFT");
    +
    else if (button == LCD_BUTTON_RIGHT)
    +
    lcd.print("RIGHT");
    +
    else if (button == LCD_BUTTON_UP)
    +
    lcd.print("UP");
    +
    else if (button == LCD_BUTTON_DOWN)
    +
    lcd.print("DOWN");
    +
    else if (button == LCD_BUTTON_SELECT)
    +
    lcd.print("SELECT");
    +
    else if (button < 0) // button release
    +
    lcd.print(" ");
    +
    }
    +
    +
    + + diff --git a/mainpage_8dox.html b/mainpage_8dox.html index 4db525eb..f76e4de0 100644 --- a/mainpage_8dox.html +++ b/mainpage_8dox.html @@ -2,29 +2,37 @@ + ArduinoLibs: mainpage.dox File Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    mainpage.dox File Reference
    -
    -
    - -
    -

    Detailed Description

    -
    -

    Definition in file mainpage.dox.

    -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -81,8 +77,21 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - + +
    +
    +
    mainpage.dox File Reference
    +
    +
    +

    Detailed Description

    +
    +

    Definition in file mainpage.dox.

    +
    + + diff --git a/modules.html b/modules.html index 16d4a08d..e0c904a9 100644 --- a/modules.html +++ b/modules.html @@ -2,29 +2,37 @@ + ArduinoLibs: Modules + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Modules
    -
    -
    -
    Here is a list of all modules:
    -
    +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -74,8 +73,22 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    +
    Modules
    +
    +
    +
    Here is a list of all modules:
    +
    + + diff --git a/nav_f.png b/nav_f.png index 1b07a16207e67c95fe2ee17e7016e6d08ac7ac99..72a58a529ed3a9ed6aa0c51a79cf207e026deee2 100644 GIT binary patch delta 124 zcmV-?0E7RZ0hs}iBz0g(L_t(|0qxyO4uBvGMbVbGTL*^tfkM%3YvRPhNE{fKaB|bU zE`pBpg6fW>8&Wn}AXZ5Qu@Xg)f;DQhglrV^nwx1!n5^FF=Snb)(Gk%vj{BRL9T9c- e@$=rlHgf|=7$DsN0QGqQ0000u1W`M6+rL23&uBa0+90uE%OD|+(2G{R zL&)v^AmWO}#(ZP3n7)~|7`7NQ=yTCV&_+h($07*qoM6N<$f|0vDeEFMGaQo;E4t|J$N1BX-KT4wgmvu@A6u&D20{R2$}&DVbwUM3!Wac4i{ Xv3!>HpqvZ$8Gyjk)z4*}Q$iB}sjeJQ delta 66 zcmYdFoS;pyTSQo;E4?nX`q10H6_y+#`jhHjhAEv}d?b4SFhXw`bg=6O+n|1%uR WXKDW<@M10l5O})!xvX_sd$oj(R;{eZG48+5s|MCC;002ovPDHLkV1lT^BSioJ diff --git a/pages.html b/pages.html index 850a24d6..b6b5eb51 100644 --- a/pages.html +++ b/pages.html @@ -2,29 +2,37 @@ + ArduinoLibs: Related Pages + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    -
    -
    Related Pages
    -
    - +
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -95,8 +73,32 @@ var searchBox = new SearchBox("searchBox", "search",false,'Search');
    - +
    +
    +
    Related Pages
    +
    + + + diff --git a/search/all_61.html b/search/all_61.html index 6b9f6462..a3164d55 100644 --- a/search/all_61.html +++ b/search/all_61.html @@ -2,74 +2,16 @@ +
    Loading...
    -
    -
    - addField - Form -
    -
    -
    -
    - adjustDays - RTC -
    -
    -
    -
    - adjustMonths - RTC -
    -
    -
    -
    - adjustYears - RTC -
    -
    -
    -
    - advance - ChaseLEDs -
    -
    -
    -
    - advanceTime - ChaseLEDs -
    -
    - -
    -
    - ALARM_COUNT - RTC -
    -
    -
    -
    - AUTO_REPEAT - IRreceiver -
    -
    - +
    +
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/enumvalues_73.js b/search/enumvalues_73.js new file mode 100644 index 00000000..8a0737e6 --- /dev/null +++ b/search/enumvalues_73.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['sleep_5f120_5fms',['SLEEP_120_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a96fa577b54aa6f2341ea5ddd839aa8bc',1,'PowerSave.h']]], + ['sleep_5f15_5fms',['SLEEP_15_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a3d16487a7386c6348f1c1d886564e3c4',1,'PowerSave.h']]], + ['sleep_5f1_5fsec',['SLEEP_1_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a92310daf29e5899770b80c1c4e850b9b',1,'PowerSave.h']]], + ['sleep_5f250_5fms',['SLEEP_250_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36abcbf68cfdb688220da61ac98b1a2ec69',1,'PowerSave.h']]], + ['sleep_5f2_5fsec',['SLEEP_2_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a04571aa0b801c28cd756513303b229cd',1,'PowerSave.h']]], + ['sleep_5f30_5fms',['SLEEP_30_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36af31050c5ef733b3e231920143b041825',1,'PowerSave.h']]], + ['sleep_5f4_5fsec',['SLEEP_4_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a4cba1036d7a69225110b68b372f10410',1,'PowerSave.h']]], + ['sleep_5f500_5fms',['SLEEP_500_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36aa49e4d5f92a5f48070dde0babf75a9b0',1,'PowerSave.h']]], + ['sleep_5f60_5fms',['SLEEP_60_MS',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a716f5a9f35e77a2d334ad71f05bd5fdc',1,'PowerSave.h']]], + ['sleep_5f8_5fsec',['SLEEP_8_SEC',['../group__power__save.html#ggabdc6266a040b28c4d79028ddb0ceae36a8c47dd1ef81c2f41da7525b5ee4bfc3a',1,'PowerSave.h']]] +]; diff --git a/search/files_61.html b/search/files_61.html index 763d3765..5a8e4549 100644 --- a/search/files_61.html +++ b/search/files_61.html @@ -2,16 +2,16 @@ +
    Loading...
    - +
    +
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/groups_70.js b/search/groups_70.js new file mode 100644 index 00000000..ba9cdad3 --- /dev/null +++ b/search/groups_70.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['power_20saving_20utility_20functions',['Power saving utility functions',['../group__power__save.html',1,'']]] +]; diff --git a/search/pages_61.html b/search/pages_61.html new file mode 100644 index 00000000..d5d1efa6 --- /dev/null +++ b/search/pages_61.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_61.js b/search/pages_61.js new file mode 100644 index 00000000..0a4d8fa1 --- /dev/null +++ b/search/pages_61.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['alarm_20clock',['Alarm Clock',['../alarm_clock.html',1,'']]] +]; diff --git a/search/pages_62.html b/search/pages_62.html new file mode 100644 index 00000000..d7774750 --- /dev/null +++ b/search/pages_62.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_62.js b/search/pages_62.js new file mode 100644 index 00000000..f952a477 --- /dev/null +++ b/search/pages_62.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['blinking_20led_20example',['Blinking LED Example',['../blink_blink.html',1,'']]] +]; diff --git a/search/pages_63.html b/search/pages_63.html new file mode 100644 index 00000000..3971181e --- /dev/null +++ b/search/pages_63.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_63.js b/search/pages_63.js new file mode 100644 index 00000000..a8b9c230 --- /dev/null +++ b/search/pages_63.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['charlieplexing_20example',['Charlieplexing Example',['../blink_charlieplex.html',1,'']]], + ['cylon_20eyes_20example',['Cylon Eyes Example',['../blink_cylon.html',1,'']]] +]; diff --git a/search/pages_64.html b/search/pages_64.html new file mode 100644 index 00000000..f416a918 --- /dev/null +++ b/search/pages_64.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_64.js b/search/pages_64.js new file mode 100644 index 00000000..5c3709d4 --- /dev/null +++ b/search/pages_64.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['dot_20matrix_20display_20demo',['Dot Matrix Display Demo',['../dmd_demo.html',1,'']]], + ['dumping_20infrared_20remote_20control_20codes',['Dumping Infrared Remote Control Codes',['../ir_dumpir.html',1,'']]] +]; diff --git a/search/pages_66.html b/search/pages_66.html new file mode 100644 index 00000000..40514344 --- /dev/null +++ b/search/pages_66.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_66.js b/search/pages_66.js new file mode 100644 index 00000000..e10a92e8 --- /dev/null +++ b/search/pages_66.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['form_20example_20for_20lcd_20displays',['Form example for LCD displays',['../lcd_form.html',1,'']]] +]; diff --git a/search/pages_68.html b/search/pages_68.html new file mode 100644 index 00000000..7c1d5207 --- /dev/null +++ b/search/pages_68.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_68.js b/search/pages_68.js new file mode 100644 index 00000000..31dd37a2 --- /dev/null +++ b/search/pages_68.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['hello_20world_20for_20freetronics_20lcd',['Hello World for Freetronics LCD',['../lcd_hello_world.html',1,'']]] +]; diff --git a/search/pages_72.html b/search/pages_72.html new file mode 100644 index 00000000..ee0d002b --- /dev/null +++ b/search/pages_72.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_72.js b/search/pages_72.js new file mode 100644 index 00000000..623f2317 --- /dev/null +++ b/search/pages_72.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['running_20figure_20example',['Running figure example',['../dmd_running_figure.html',1,'']]] +]; diff --git a/search/pages_73.html b/search/pages_73.html new file mode 100644 index 00000000..ba42c509 --- /dev/null +++ b/search/pages_73.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/pages_73.js b/search/pages_73.js new file mode 100644 index 00000000..c70dda2c --- /dev/null +++ b/search/pages_73.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['star_20trek_20example',['Star Trek Example',['../blink_startrek.html',1,'']]], + ['snake_20video_20game_20using_20an_20infrared_20remote_20control',['Snake Video Game Using an Infrared Remote Control',['../ir_snake.html',1,'']]] +]; diff --git a/search/search.css b/search/search.css index 50249e56..d18c1da8 100644 --- a/search/search.css +++ b/search/search.css @@ -4,13 +4,6 @@ float: left; } -#searchli { - float: right; - display: block; - width: 170px; - height: 36px; -} - #MSearchBox { white-space : nowrap; position: absolute; @@ -20,6 +13,7 @@ right: 0px; width: 170px; z-index: 102; + background-color: white; } #MSearchBox .left @@ -224,6 +218,10 @@ a.SRScope:focus, a.SRScope:active { text-decoration: underline; } +span.SRScope { + padding-left: 4px; +} + .SRPage .SRStatus { padding: 2px 5px; font-size: 8pt; diff --git a/search/search.js b/search/search.js index 4c876b24..140627b2 100644 --- a/search/search.js +++ b/search/search.js @@ -12,9 +12,11 @@ var indexSectionsWithContent = 2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110100001001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", 3: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111001111101111110000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", 4: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000110101011000110000100010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 5: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 5: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001001000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", 6: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - 7: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" + 7: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010100000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 8: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + 9: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111101010000000001100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" }; var indexSectionNames = @@ -26,7 +28,9 @@ var indexSectionNames = 4: "variables", 5: "typedefs", 6: "enums", - 7: "enumvalues" + 7: "enumvalues", + 8: "groups", + 9: "pages" }; function convertToId(search) @@ -271,7 +275,7 @@ function SearchBox(name, resultsPath, inFrame, label) var node = child.firstChild; if (j==id) { - node.innerHTML='•'; + node.innerHTML='•'; } else { @@ -368,7 +372,7 @@ function SearchBox(name, resultsPath, inFrame, label) hasResultsPage = false; } - window.frames.MSearchResults.location.href = resultsPageWithSearch; + window.frames.MSearchResults.location = resultsPageWithSearch; var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); if (domPopupSearchResultsWindow.style.display!='block') @@ -738,3 +742,72 @@ function SearchResults(name) return false; } } + +function setKeyActions(elem,action) +{ + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); +} + +function setClassAttr(elem,attr) +{ + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); +} + +function createResults() +{ + var results = document.getElementById("SRResults"); + for (var e=0; e +
    Loading...
    -
    -
    - Color - Bitmap -
    -
    +
    +
    Searching...
    No Matches
    +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/typedefs_66.js b/search/typedefs_66.js new file mode 100644 index 00000000..58dd39bd --- /dev/null +++ b/search/typedefs_66.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['font',['Font',['../classBitmap.html#a456f7d6da03189c1e7148563a891b3cf',1,'Bitmap']]] +]; diff --git a/search/typedefs_70.html b/search/typedefs_70.html new file mode 100644 index 00000000..77095275 --- /dev/null +++ b/search/typedefs_70.html @@ -0,0 +1,25 @@ + + + + + + + + +
    +
    Loading...
    +
    + +
    Searching...
    +
    No Matches
    + +
    + + diff --git a/search/typedefs_70.js b/search/typedefs_70.js new file mode 100644 index 00000000..e0c3fb61 --- /dev/null +++ b/search/typedefs_70.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['progmem',['ProgMem',['../classBitmap.html#a2fcc98fd7580932b218134126a29ce43',1,'Bitmap']]] +]; diff --git a/search/variables_61.html b/search/variables_61.html index d919b889..ff1f937d 100644 --- a/search/variables_61.html +++ b/search/variables_61.html @@ -2,23 +2,16 @@ +
    Loading...
    -
    -
    - ALARM_COUNT - RTC -
    -
    -
    -
    - AUTO_REPEAT - IRreceiver -
    -
    +
    +
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    Searching...
    No Matches
    -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + + + + + +
    +
    + +
    RTCAlarm Class Reference
    -
    +
    - +

    Stores alarm information from a realtime clock chip. More...

    #include <RTC.h>

    - -

    List of all members.

    - - - - + - - - + + +

    +

    Public Attributes

    +
    uint8_t hour
     Hour of the day for the alarm (0-23).
    +
     Hour of the day for the alarm (0-23).
    uint8_t minute
     Minute of the hour for the alarm (0-59).
    uint8_t flags
     Additional flags for the alarm.
     Minute of the hour for the alarm (0-59).
    uint8_t flags
     Additional flags for the alarm.
    -

    Detailed Description

    +

    Detailed Description

    Stores alarm information from a realtime clock chip.

    -
    See also:
    RTCTime, RTCDate, RTC
    +
    See Also
    RTCTime, RTCDate, RTC

    Definition at line 42 of file RTC.h.

    -

    Member Data Documentation

    - +

    Member Data Documentation

    +
    - +
    RTCAlarm::flagsRTCAlarm::flags
    -
    -
    +

    Additional flags for the alarm.

    The least significant bit will be 0 if the alarm is disabled or 1 if the alarm is enabled. Other bits can be used by the application for any purpose.

    @@ -113,23 +133,12 @@ uint8_t 
    RTC.h
  • RTC.cpp
  • - - - - - -
    - -
    - - + + + diff --git a/structRTCDate.html b/structRTCDate.html index 49fe44d4..9386955c 100644 --- a/structRTCDate.html +++ b/structRTCDate.html @@ -2,29 +2,37 @@ + ArduinoLibs: RTCDate Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    - -
    -
    RTCDate Class Reference
    -
    -
    - -

    Stores date information from a realtime clock chip. - More...

    - -

    #include <RTC.h>

    - -

    List of all members.

    - - - - - - - - -

    -Public Attributes

    -unsigned int year
     Year (4-digit)
    -uint8_t month
     Month of the year (1-12)
    -uint8_t day
     Day of the month (1-31)
    -

    Detailed Description

    -

    Stores date information from a realtime clock chip.

    -
    See also:
    RTCTime, RTCAlarm, RTC
    - -

    Definition at line 35 of file RTC.h.

    -

    The documentation for this class was generated from the following files: -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -110,8 +80,48 @@ uint8_t 
    + +
    + +
    +
    RTCDate Class Reference
    +
    +
    + +

    Stores date information from a realtime clock chip. + More...

    + +

    #include <RTC.h>

    + + + + + + + + +

    +Public Attributes

    +unsigned int year
     Year (4-digit)
    +uint8_t month
     Month of the year (1-12)
    +uint8_t day
     Day of the month (1-31)
    +

    Detailed Description

    +

    Stores date information from a realtime clock chip.

    +
    See Also
    RTCTime, RTCAlarm, RTC
    + +

    Definition at line 35 of file RTC.h.

    +

    The documentation for this class was generated from the following files: +
    + + diff --git a/structRTCTime.html b/structRTCTime.html index 81407847..f4628d8c 100644 --- a/structRTCTime.html +++ b/structRTCTime.html @@ -2,29 +2,37 @@ + ArduinoLibs: RTCTime Class Reference + + - + + - - - -
    + +
    -
    ArduinoLibs
    +
    ArduinoLibs +
    + + + -
    -
    - -
    -
    RTCTime Class Reference
    -
    -
    - -

    Stores time information from a realtime clock chip. - More...

    - -

    #include <RTC.h>

    - -

    List of all members.

    - - - - - - - - -

    -Public Attributes

    -uint8_t hour
     Hour of the day (0-23)
    -uint8_t minute
     Minute within the hour (0-59)
    -uint8_t second
     Second within the minute (0-59)
    -

    Detailed Description

    -

    Stores time information from a realtime clock chip.

    -
    See also:
    RTCDate, RTCAlarm, RTC
    - -

    Definition at line 28 of file RTC.h.

    -

    The documentation for this class was generated from the following files: -
    + All Classes Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
    @@ -110,8 +80,48 @@ uint8_t 
    + +
    + +
    +
    RTCTime Class Reference
    +
    +
    + +

    Stores time information from a realtime clock chip. + More...

    + +

    #include <RTC.h>

    + + + + + + + + +

    +Public Attributes

    +uint8_t hour
     Hour of the day (0-23)
    +uint8_t minute
     Minute within the hour (0-59)
    +uint8_t second
     Second within the minute (0-59)
    +

    Detailed Description

    +

    Stores time information from a realtime clock chip.

    +
    See Also
    RTCDate, RTCAlarm, RTC
    + +

    Definition at line 28 of file RTC.h.

    +

    The documentation for this class was generated from the following files: +
    + + diff --git a/sync_off.png b/sync_off.png new file mode 100644 index 0000000000000000000000000000000000000000..3b443fc62892114406e3d399421b2a881b897acc GIT binary patch literal 853 zcmV-b1FHOqP)oT|#XixUYy%lpuf3i8{fX!o zUyDD0jOrAiT^tq>fLSOOABs-#u{dV^F$b{L9&!2=9&RmV;;8s^x&UqB$PCj4FdKbh zoB1WTskPUPu05XzFbA}=KZ-GP1fPpAfSs>6AHb12UlR%-i&uOlTpFNS7{jm@mkU1V zh`nrXr~+^lsV-s1dkZOaI|kYyVj3WBpPCY{n~yd%u%e+d=f%`N0FItMPtdgBb@py; zq@v6NVArhyTC7)ULw-Jy8y42S1~4n(3LkrW8mW(F-4oXUP3E`e#g**YyqI7h-J2zK zK{m9##m4ri!7N>CqQqCcnI3hqo1I;Yh&QLNY4T`*ptiQGozK>FF$!$+84Z`xwmeMh zJ0WT+OH$WYFALEaGj2_l+#DC3t7_S`vHpSivNeFbP6+r50cO8iu)`7i%Z4BTPh@_m3Tk!nAm^)5Bqnr%Ov|Baunj#&RPtRuK& z4RGz|D5HNrW83-#ydk}tVKJrNmyYt-sTxLGlJY5nc&Re zU4SgHNPx8~Yxwr$bsju?4q&%T1874xxzq+_%?h8_ofw~(bld=o3iC)LUNR*BY%c0y zWd_jX{Y8`l%z+ol1$@Qa?Cy!(0CVIEeYpKZ`(9{z>3$CIe;pJDQk$m3p}$>xBm4lb zKo{4S)`wdU9Ba9jJbVJ0C=SOefZe%d$8=2r={nu<_^a3~>c#t_U6dye5)JrR(_a^E f@}b6j1K9lwFJq@>o)+Ry00000NkvXXu0mjfWa5j* literal 0 HcmV?d00001 diff --git a/sync_on.png b/sync_on.png new file mode 100644 index 0000000000000000000000000000000000000000..e08320fb64e6fa33b573005ed6d8fe294e19db76 GIT binary patch literal 845 zcmV-T1G4;yP)Y;xxyHF2B5Wzm| zOOGupOTn@c(JmBOl)e;XMNnZuiTJP>rM8<|Q`7I_))aP?*T)ow&n59{}X4$3Goat zgjs?*aasfbrokzG5cT4K=uG`E14xZl@z)F={P0Y^?$4t z>v!teRnNZym<6h{7sLyF1V0HsfEl+l6TrZpsfr1}luH~F7L}ktXu|*uVX^RG$L0`K zWs3j|0tIvVe(N%_?2{(iCPFGf#B6Hjy6o&}D$A%W%jfO8_W%ZO#-mh}EM$LMn7joJ z05dHr!5Y92g+31l<%i1(=L1a1pXX+OYnalY>31V4K}BjyRe3)9n#;-cCVRD_IG1fT zOKGeNY8q;TL@K{dj@D^scf&VCs*-Jb>8b>|`b*osv52-!A?BpbYtTQBns5EAU**$m zSnVSm(teh>tQi*S*A>#ySc=n;`BHz`DuG4&g4Kf8lLhca+zvZ7t7RflD6-i-mcK=M z!=^P$*u2)bkY5asG4gsss!Hn%u~>}kIW`vMs%lJLH+u*9<4PaV_c6U`KqWXQH%+Nu zTv41O(^ZVi@qhjQdG!fbZw&y+2o!iYymO^?ud3{P*HdoX83YV*Uu_HB=?U&W9%AU# z80}k1SS-CXTU7dcQlsm<^oYLxVSseqY6NO}dc`Nj?8vrhNuCdm@^{a3AQ_>6myOj+ z`1RsLUXF|dm|3k7s2jD(B{rzE>WI2scH8i1;=O5Cc9xB3^aJk%fQjqsu+kH#0=_5a z0nCE8@dbQa-|YIuUVvG0L_IwHMEhOj$Mj4Uq05 X8=0q~qBNan00000NkvXXu0mjfptF>5 literal 0 HcmV?d00001 diff --git a/tab_a.png b/tab_a.png index 2d99ef23fed78c7683f0b5aa803d937060d288c4..3b725c41c5a527a3a3e40097077d0e206a681247 100644 GIT binary patch delta 113 zcmV-%0FM8R0geHXBx+SjL_t(|0qvbj3V<*WLnm*fD2j+%#l7Gq+<5;Z*{QAP2nqR} z!S?f}A6KSjBMmcj2}v0s95XABy!b`qeq0Yk9=#tquiN10l6OtFzxMxqe_8ck>OlfD TS)Sv400000NkvXXu0mjf*h4XO delta 111 zcmV-#0FeKV0gM5VBxqAfL_t(|0qvc;34lNp1b64jp`3`AD&~SsnAm?w2Jg;BhW$(p zIUdP_Df=vx!f>I?0(t zKHnd0dsF*K?I*b&{UxHwIzfwZONo2D>P}*5FZ{S$A-vslh?n^dRGxrJ0*riHMqvP_yay2NVE9BH-vyJ%9iJ002ov JPDHLkV1gb?O0fU{ diff --git a/tab_s.png b/tab_s.png index 978943ac807718de0e69e5a585a8f0a1e5999285..ab478c95b67371d700a20869f7de1ddd73522d50 100644 GIT binary patch delta 156 zcmV;N0Av5X0k{E>B!7QNL_t(|0qxy^34%ZXK+&T=Q4$n|q#~N4C8kM{mx^YVHd`CC zNWLn{S^f~#UuRg?v)<^0000< KMNUMnLSTXuTSx)` delta 161 zcmV;S0AByN0lfi`B!7fSL_t(|0qx!E34%}nK;cVgA|)siNkx32C8kNCHx(ag+H7sm zA`R1z8sytUyxt%3+ml=_WaUp<%%sIaa-E4UkH3j1pNP&QVK(BQ27>gCn+!N{j~(~e z#}4bzVMZ