crystalfontz
AtxPowerSwitchFunction
Bases: Enum
An ATX power switch function.
Refer to your device's datasheet for the effects of each of these functions.
Source code in crystalfontz/atx.py
10 11 12 13 14 15 16 17 18 19 20 | |
AtxPowerSwitchFunctionalitySettings
dataclass
Source code in crystalfontz/atx.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
power_pulse_length_seconds = None
class-attribute
instance-attribute
Settings for command 28 (0x1C): Set ATX Power Switch Functionality.
| Parameters: |
|
|---|
Client
Bases: Protocol
A crystalfontz client. Typically created through a call to connection or
create_connection.
This client has methods for every command supported by the CFA533. For more details, refer to the datasheet for your device.
In addition, this client will accept a ReportHandler class, and will call
the appropriate method on it whenever a key activity or temperature report is
received.
Also supported are configurations for command timeouts and retry behavior. The default behavior is a timeout of 0.25 seconds with no retries. This 250ms timeout is based on the datasheet for the CFA533.
Source code in crystalfontz/client.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 | |
baud_rate
property
writable
The transport's baud rate.
closed
property
An asyncio.Future that resolves when the connection is closed. This
may be due either to calling client.close() or an Exception.
firmware_rev
property
The firmware revision of the current device.
hardware_rev
property
The hardware revision of the current device.
model
property
The model of the current device.
clear_screen(timeout=None, retry_times=None)
async
6 (0x06): Clear LCD Screen
Sets the contents of the LCD screen DDRAM to '' = 0x20 = 32 and moves the cursor to the left-most column of the top line.
Source code in crystalfontz/client.py
784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 | |
close()
Close the connection.
Source code in crystalfontz/client.py
344 345 346 347 348 349 350 351 | |
configure_key_reporting(when_pressed, when_released, timeout=None, retry_times=None)
async
23 (0x17): Configure Key Reporting
By default, the device reports any key event to the host. This command allows the key events to be enabled or disabled on an individual basis.
Source code in crystalfontz/client.py
1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 | |
configure_watchdog(timeout_seconds, timeout=None, retry_times=None)
async
29 (0x1D): Enable/Disable and Reset the Watchdog
Some high-availability systems use hardware watchdog timers to ensure that a software or hardware failure does not result in an extended system outage. Once the host system has booted, a system monitor program is started. The system monitor program would enable the watchdog timer on the device. If the system monitor program fails to reset the device's watchdog timer, the device will reset the host system.
The GPIO pins used for ATX control must not be configured as user GPIO. For more details, review your device's datasheet.
Source code in crystalfontz/client.py
1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 | |
dance_party(tick=None, timeout=None, retry_times=None)
Display a dance party effect on the LCD screen.
Source code in crystalfontz/client.py
1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 | |
detect_baud_rate(timeout=None, retry_times=None)
async
Detect the device's configured baud rate by testing the connection at each potential baud setting.
Source code in crystalfontz/client.py
594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 | |
detect_device(timeout=None, retry_times=None)
async
Get model, hardware and firmware versions from the device, then configure the client to use that device. This is useful if you don't know a priori what device you're using.
Source code in crystalfontz/client.py
641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 | |
dow_transaction(index, bytes_to_read, data_to_write=None, timeout=None, retry_times=None)
async
20 (0x14): Arbitrary DOW Transaction
The unit can function as an RS-232 to Dallas 1-Wire bridge. The unit can send up to 15 bytes and receive up to 14 bytes. This will be sufficient for many devices, but some devices require larger transactions and cannot by fully used with the unit.
For more information, review your unit's datasheet.
Source code in crystalfontz/client.py
1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 | |
expect(cls, timeout=None)
async
Wait for a response of an expected class, with a timeout.
This method accepts a timeout parameter. If defined, it will override
the client's default timeout.
This is a low level method. Most use cases are met by individual command methods.
Source code in crystalfontz/client.py
506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 | |
marquee(row, text, pause=None, tick=None, timeout=None, retry_times=None)
Display a marquee effect on the LCD screen.
Source code in crystalfontz/client.py
1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 | |
ping(payload, timeout=None, retry_times=None)
async
0 (0x00): Ping Command
The device will return the Ping Command to the host.
Source code in crystalfontz/client.py
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 | |
poll_keypad(timeout=None, retry_times=None)
async
24 (0x18): Read Keypad, Polled Mode
In some situations, it may be convenient for the host to poll the device for key activity. This command allows the host to detect which keys are currently pressed, which keys have been pressed since the last poll, and which keys have been released since the last poll.
Source code in crystalfontz/client.py
1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 | |
read_dow_device_information(index, timeout=None, retry_times=None)
async
18 (0x12): Read DOW Device Information
When power is applied to the unit, it detects any devices connected to the Dallas Semiconductor One-Wire (DOW) bus and stores the device's information. This command will allow the host to read the device's information.
Note: The GPIO pin used for DOW must not be configured as user GPIO. For more information, review your unit's datasheet.
Source code in crystalfontz/client.py
975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 | |
read_gpio(index, timeout=None, retry_times=None)
async
35 (0x23): Read GPIO Pin Levels and Configuration State
See method client.set_gpio for details on the GPIO architecture.
This functionality comes with many caveats. Please review the documentation in your device's datasheet.
Source code in crystalfontz/client.py
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 | |
read_lcd_memory(address, timeout=None, retry_times=None)
async
10 (0x0A): Read 8 bytes of LCD Memory
This command will return the contents of the LCD's DDRAM or CGRAM. This command is intended for debugging.
Source code in crystalfontz/client.py
878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 | |
read_status(timeout=None, retry_times=None)
async
30 (0x1E): Read Reporting & Status
This command can be used to verify the current items configured to report to the host, as well as some other miscellaneous status information. Please note that the information returned is not identical between devices, and may in fact vary between firmware versions of the same model. As such, the return value of this function is not type-safe.
Source code in crystalfontz/client.py
1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 | |
read_user_flash_area(timeout=None, retry_times=None)
async
3 (0x03): Read User Flash Area
This command will read the User Flash Area and return the data to the host.
For more information, review the documentation for
client.write_user_flash_area.
Source code in crystalfontz/client.py
678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | |
reboot_lcd(timeout=None, retry_times=None)
async
Reboot the device, using 5 (0x05): Reboot Device, Reset Host, or Power Off Host.
Rebooting the device may be useful for testing the boot configuration. It may also be useful to re-enumerate the devices on the One-Wire bus.
Source code in crystalfontz/client.py
733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 | |
reset_host(timeout=None, retry_times=None)
async
Reset the host, using 5 (0x05): Reboot Device, Reset Host, or Power Off Host.
This command assumes the host's reset line is connected to GPIO[3]. For more information, review your device's datasheet.
Source code in crystalfontz/client.py
750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 | |
screensaver(text, tick=None, timeout=None, retry_times=None)
Display a screensaver effect on the LCD screen.
Source code in crystalfontz/client.py
1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 | |
send_command(command, response_cls, timeout=None, retry_times=None)
async
Send a Command, then wait for and return its expected Response.
This method accepts timeout and retry_times parameters. If defined, they
will override the client's default timeout.
This is a low level method. Most use cases are met by individual command methods.
Source code in crystalfontz/client.py
531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 | |
send_command_to_lcd_controller(location, data, timeout=None, retry_times=None)
async
22 (0x16): Send Command Directly to the LCD Controller
The controller on the CFA533 is HD44780 compatible. Generally, you will not need low-level access to the LCD controller but some arcane functions of the HD44780 are not exposed by the CFA533's command set. This command allows you to access the CFA533's LCD controller directly.
Source code in crystalfontz/client.py
1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 | |
send_data(row, column, data, timeout=None, retry_times=None)
async
31 (0x1F): Send Data to LCD
This command allows data to be placed at any position on the LCD.
Source code in crystalfontz/client.py
1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 | |
set_atx_power_switch_functionality(settings, timeout=None, retry_times=None)
async
28 (0x1C): Set ATX Power Switch Functionality
The combination of this device with the Crystalfontz WR-PWR-Y14 cable can be used to replace the function of the power and reset switches in a standard ATX-compatible system.
This functionality comes with a number of caveats. Please review your device's datasheet for more information.
Source code in crystalfontz/client.py
1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 | |
set_backlight(lcd_brightness, keypad_brightness=None, timeout=None, retry_times=None)
async
14 (0x0E): Set LCD & Keypad Backlight
This command sets the brightness of the LCD and keypad backlights.
Source code in crystalfontz/client.py
955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 | |
set_baud_rate(baud_rate, timeout=None, retry_times=None)
async
33 (0x21): Set Baud Rate
This command will change the device's baud rate. This method sends the baud
rate command, waits for a positive acknowledgement from the device at the old
baud rate, and then switches to the new baud rate. The baud rate must be saved
by a call to client.store_boot_state if you want the device to power up at
the new baud rate.
Source code in crystalfontz/client.py
1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 | |
set_contrast(contrast, timeout=None, retry_times=None)
async
13 (0x0D): Set LCD Contrast
This command sets the contrast or vertical viewing angle of the display.
Source code in crystalfontz/client.py
936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 | |
set_cursor_position(row, column, timeout=None, retry_times=None)
async
11 (0x0B): Set LCD Cursor Position
This command allows the cursor to be placed at the desired location on the device's LCD screen.
Source code in crystalfontz/client.py
895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 | |
set_cursor_style(style, timeout=None, retry_times=None)
async
12 (0x0C): Set LCD Cursor Style
This command allows you to select among four hardware generated cursor options.
Source code in crystalfontz/client.py
916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 | |
set_gpio(index, output_state, settings=None, timeout=None, retry_times=None)
async
34 (0x22): Set or Set and Configure GPIO Pins
The CFA533 (hardware versions 1.4 and up, firmware versions 1.9 and up) has five pins for user-definable general purpose input / output (GPIO). These pins are shared with the DOW and ATX functions. Be careful when you configure GPIO if you want to use the ATX or DOW at the same time.
This functionality comes with many caveats. Please review the documentation in your device's datasheet.
Source code in crystalfontz/client.py
1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 | |
set_line_1(line, timeout=None, retry_times=None)
async
7 (0x07): Set LCD Contents, Line 1
Sets the center 16 characters displayed on the top line of the LCD screen.
Please use this command only if you need backwards compatibility with older
devices. For new applications, please use the more flexible command
client.send_data.
Source code in crystalfontz/client.py
800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 | |
set_line_2(line, timeout=None, retry_times=None)
async
8 (0x08): Set LCD Contents, Line 2
Sets the center 16 characters displayed on the bottom line of the LCD screen.
Please use this command only if you need backwards compatibility with older
devices. For new applications, please use the more flexible command
client.send_data.
Source code in crystalfontz/client.py
823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 | |
set_special_character_data(index, character, timeout=None, retry_times=None)
async
9 (0x09): Set LCD Special Character Data
Sets the font definition for one of the special characters (CGRAM).
Source code in crystalfontz/client.py
846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 | |
set_special_character_encoding(character, index)
Configure a unicode character to encode to the index of a given special character on CGRAM.
Source code in crystalfontz/client.py
866 867 868 869 870 871 872 873 874 875 876 | |
setup_live_temperature_display(slot, item, timeout=None, retry_times=None)
async
21 (0x15): Set Up Live Temperature Display
You can configure the device to automatically update a portion of the LCD with a "live" temperature reading. Once the display is configured using this command, the device will continue to display the live reading on the LCD without host intervention.
Source code in crystalfontz/client.py
1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 | |
setup_temperature_reporting(enabled, timeout=None, retry_times=None)
async
19 (0x13): Set Up Temperature Reporting
This command will configure the device to report the temperature information to the host every second.
Source code in crystalfontz/client.py
999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 | |
shutdown_host(timeout=None, retry_times=None)
async
Turn off the host's power, using 5 (0x05): Reboot Device, Reset Host, or Power Off Host.
This command assumes the host's power control line is connected to GPIO[2]. For more information, review your device's datasheet.
Source code in crystalfontz/client.py
767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 | |
store_boot_state(timeout=None, retry_times=None)
async
4 (0x04): Store Current State as Boot State
The device loads its power-up configuration from nonvolatile memory when power is applied. The device is configured at the factory to display a "welcome" screen when power is applied. This command can be used to customize the "welcome" screen, as well as the following items:
- Characters shown on LCD
- Special character font definitions
- Cursor position
- Cursor style
- Contrast setting
- LCD backlight setting
- Settings of any "live" displays, such as temperature display
- Key press and release masks
- ATX function enable and pulse length settings
- Baud rate
- GPIO settings
You cannot store the temperature reporting (although the live display of temperatures can be saved). You cannot store the host watchdog. The host software should enable this item once the system is initialized and is ready to receive the data.
Source code in crystalfontz/client.py
698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 | |
subscribe(cls, expect=True)
Subscribe to results of a given response class. Returns a
Receiver[Response].
This is a low level method. Most use cases not met by individual command
methods or a ReportHandler are best handled with client.expect.
Source code in crystalfontz/client.py
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | |
test_connection(timeout=None, retry_times=None)
async
Test the connection by sending a ping and checking that the response matches.
Source code in crystalfontz/client.py
574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 | |
unsubscribe(cls, receiver)
Unsubscribe from results of a given response class and queue. This queue is
typically created by a call to client.subscribe.
This is a low level method. Most use cases not met by individual command
methods or a ReportHandler are best handled with client.expect.
Source code in crystalfontz/client.py
487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 | |
versions(timeout=None, retry_times=None)
async
1 (0x01): Get Hardware & Firmware Version
The device will return the hardware and firmware version information to the host.
Source code in crystalfontz/client.py
625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 | |
write_user_flash_area(data, timeout=None, retry_times=None)
async
2 (0x02): Write User Flash Area
The CFA533 reserves 16 bytes of nonvolatile memory for arbitrary use by the host. This memory can be used to store a serial number, IP address, gateway address, netmask, or any other data required. All 16 bytes must be supplied.
Source code in crystalfontz/client.py
657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 | |
Config
Bases: BaseConfig
A configuration object. This class is typically used by the Crystalfontz CLI, but may also be useful for scripts or Jupyter notebooks using its configuration.
Source code in crystalfontz/config.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
ConnectionError
Bases: CrystalfontzError
A connection error.
Source code in crystalfontz/error.py
12 13 14 15 16 17 | |
CrystalfontzError
Bases: Exception
An error in the Crystalfontz client.
Source code in crystalfontz/error.py
4 5 6 7 8 9 | |
CursorStyle
Bases: Enum
A cursor style, as set with command 12 (0x0C): Set LCD Cursor Style.
- NONE: No cursor.
- BLINKING_BLOCK: Blinking block cursor.
- STATIC_UNDERSCORE: Static underscore cursor.
- BLINKING_UNDERSCORE: Blinking underscore cursor. On the CFA633, this represents a blinking block plus an underscore.
Source code in crystalfontz/cursor.py
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | |
DanceParty
Bases: Effect
A dance party effect. Randomly changes the backlight and contrast settings on an interval.
Source code in crystalfontz/effects.py
246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 | |
DecodeError
Bases: CrystalfontzError
An error while decoding incoming data.
Source code in crystalfontz/error.py
28 29 30 31 32 33 | |
Device
Bases: ABC
An abstract device. Subclasses of Device contain parameter and methods particular to a given model, hardware revision and firmware revision.
Source code in crystalfontz/device.py
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | |
brightness(lcd_brightness, keypad_brightness)
Set the brightness of the device's LCD and keypad. This is device-dependent.
Source code in crystalfontz/device.py
102 103 104 105 106 107 108 109 | |
contrast(contrast)
Set the contrast of the device. This is device-dependent.
Source code in crystalfontz/device.py
96 97 98 99 100 | |
status(data)
Parse the status included in a device response into a status object. This is highly device-dependent.
Source code in crystalfontz/device.py
111 112 113 114 115 116 117 | |
DeviceError
Bases: CrystalfontzError
An error returned from the device.
Source code in crystalfontz/error.py
77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 | |
DeviceLookupError
Bases: CrystalfontzError
An error while looking up a device.
Source code in crystalfontz/error.py
54 55 56 57 58 59 | |
Effect
Bases: ABC
An effect. Effects are time-based actions implemented on top of the client, such as marquees and screensavers.
Source code in crystalfontz/effects.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 | |
EffectClient
Bases: Protocol
A protocol for any client used by effects.
This protocol covers a subset of the Client class which may be used by effects.
Source code in crystalfontz/effects.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
EncodeError
Bases: CrystalfontzError
An error while encoding outgoing data.
Source code in crystalfontz/error.py
46 47 48 49 50 51 | |
GpioDriveMode
Bases: Enum
Pin drive mode, based on the output state.
For details on these settings and the supported combination, refer to your device's datasheet.
Source code in crystalfontz/gpio.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 | |
GpioFunction
Bases: Enum
Pin function.
- UNUSED: Port unused for GPIO. It will take on the default function such as ATX, DOW or unused.
- USED: Port used for GPIO under user control.
Source code in crystalfontz/gpio.py
34 35 36 37 38 39 40 41 42 43 44 | |
GpioSettings
GPIO pin settings.
| Attributes: |
|
|---|
Source code in crystalfontz/gpio.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | |
GpioState
dataclass
Pin state & changes since last poll.
| Attributes: |
|
|---|
Source code in crystalfontz/gpio.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | |
KeyActivity
Bases: Enum
A key activity. This is either a "press" event or a "release" event for a given key.
Source code in crystalfontz/keys.py
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
KeyActivityReport
Bases: Response
A key activity report from the Crystalfontz LCD.
| Attributes: |
|
|---|
Source code in crystalfontz/response.py
484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 | |
KeyState
dataclass
A key's state.
| Attributes: |
|
|---|
Source code in crystalfontz/keys.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
KeyStates
dataclass
The state of all keys.
| Attributes: |
|---|
Source code in crystalfontz/keys.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
KeypadPolled
Bases: Response
| Attributes: |
|
|---|
Source code in crystalfontz/response.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | |
LcdMemory
Bases: Response
| Attributes: |
|
|---|
Source code in crystalfontz/response.py
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 | |
LcdRegister
Bases: Enum
An LCD register. The LCD supports two registers, "DATA" and "CONTROL".
Source code in crystalfontz/lcd.py
4 5 6 7 8 9 10 | |
LoggingReportHandler
Bases: ReportHandler
A report handler which logs, using Python's logging module.
Source code in crystalfontz/report.py
44 45 46 47 48 49 50 51 52 53 54 55 56 | |
Marquee
Bases: Effect
A marquee. Prints text to a row, and scrolls it across the screen.
Source code in crystalfontz/effects.py
139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
NoopReportHandler
Bases: ReportHandler
A report handler which does nothing.
Source code in crystalfontz/report.py
32 33 34 35 36 37 38 39 40 41 | |
Pong
Bases: Response
| Attributes: |
|
|---|
Source code in crystalfontz/response.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | |
RawResponse
Bases: Response
A raw response. This class may be used with client.expect to capture
an otherwise unsupported response type.
Source code in crystalfontz/response.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |
ReportHandler
Bases: ABC
Handle reporting. Reports are issued for key activities and temperature readings.
Source code in crystalfontz/report.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
on_key_activity(report)
abstractmethod
async
This method is called on any new key activity report.
Source code in crystalfontz/report.py
15 16 17 18 19 20 21 | |
on_temperature(report)
abstractmethod
async
This method is called on any new temperature report.
Source code in crystalfontz/report.py
23 24 25 26 27 28 29 | |
Response
Bases: ABC
A response received from the Crystalfontz LCD.
To implement a new response type, subclass this class and implement the init method.
Source code in crystalfontz/response.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
Screensaver
Bases: Effect
A screensaver effect. Prints text at a random position, and moves it around the screen on an interval.
Source code in crystalfontz/effects.py
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 | |
StatusRead
Bases: Response
A raw status response. This status is parsed based on the device.
Source code in crystalfontz/response.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 | |
TemperatureDisplayItem
dataclass
A temperature display item, as used in command 21 (0x15): Set Up Live Temperature Display.
| Parameters: |
|
|---|
Source code in crystalfontz/temperature.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 | |
TemperatureReport
Bases: Response
A temperature sensor report from the Crystalfontz LCD.
| Attributes: |
|
|---|
Source code in crystalfontz/response.py
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 | |
TemperatureUnit
Bases: Enum
A temperature unit. Either CELSIUS or FAHRENHEIT.
Source code in crystalfontz/temperature.py
12 13 14 15 16 17 18 | |
UnknownResponseError
Bases: DecodeError
An error raised when the response code is unrecognized.
Source code in crystalfontz/error.py
62 63 64 65 66 67 68 69 70 71 72 73 74 | |
UserFlashAreaRead
Bases: Response
| Attributes: |
|
|---|
Source code in crystalfontz/response.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 | |
Versions
Bases: Response
| Attributes: |
|
|---|
Source code in crystalfontz/response.py
112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 | |
connection(port, model='CFA533', hardware_rev=None, firmware_rev=None, device=None, report_handler=None, timeout=DEFAULT_TIMEOUT, retry_times=DEFAULT_RETRY_TIMES, loop=None, baud_rate=SLOW_BAUD_RATE)
async
Create a connection to the specified device, with an associated context.
This context will automatically close the connection on exit and wait for the connection to close.
Source code in crystalfontz/client.py
1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 | |
create_connection(port, model='CFA533', hardware_rev=None, firmware_rev=None, device=None, report_handler=None, timeout=DEFAULT_TIMEOUT, retry_times=DEFAULT_RETRY_TIMES, loop=None, baud_rate=SLOW_BAUD_RATE)
async
Create a connection to the specified device. Returns a Client object.
To close the connection, call client.close(). The client.closed property is a
Future that will resolve when the client is closed (either due to a call to
client.close() or an error) and should be awaited.
Source code in crystalfontz/client.py
1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 | |