├── .gdbinit ├── .gitattributes ├── .gitignore ├── EDC-Schematics ├── EDC-Schematics.kicad_pcb ├── EDC-Schematics.kicad_prl ├── EDC-Schematics.kicad_pro └── EDC-Schematics.kicad_sch ├── IMG_1243.jpg ├── LICENSE ├── README.md ├── alire.toml ├── edc.gpr ├── gnat.adc └── src ├── edc.adb ├── evaluate-leds.adb ├── evaluate-leds.ads ├── evaluate-matrices.adb ├── evaluate-matrices.ads ├── evaluate.ads ├── execute-leds.adb ├── execute-leds.ads ├── execute-matrices.adb ├── execute-matrices.ads ├── execute.ads ├── font.adb ├── font.ads ├── hex_2digits_display.adb ├── hex_2digits_display.ads ├── initializer.adb ├── initializer.ads ├── itsybitsy.ads ├── led_control.adb ├── led_control.ads ├── matrix_area_double_word.adb ├── matrix_area_double_word.ads ├── matrix_area_word.adb ├── matrix_area_word.ads ├── pimoroni_led_dot_matrix.adb ├── pimoroni_led_dot_matrix.ads ├── transport-serial.adb ├── transport-serial.ads └── transport.ads /.gdbinit: -------------------------------------------------------------------------------- 1 | file bin/edc 2 | target extended-remote localhost:3333 3 | load 4 | break Edc 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Set the default behavior, in case people don't have core.autocrlf set. 2 | * text=auto 3 | 4 | # Explicitly declare text files you want to always be normalized and converted 5 | # to native line endings on checkout. 6 | ## Project file 7 | *.gpr text 8 | 9 | ## Compiler flags file 10 | *.adc text 11 | 12 | 13 | ## Ada source code files 14 | *.adb text 15 | *.ads text 16 | 17 | ## Kicad files 18 | *.kicad_pcb 19 | *.kicad_prl 20 | *.kicad_pro 21 | *.kicad_sch 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object file 2 | *.o 3 | 4 | # Ada Library Information 5 | *.ali 6 | obj/ 7 | lib/ 8 | bin/ 9 | alire/ 10 | config/ 11 | 12 | # Kicak Backup files 13 | *-backups/ 14 | -------------------------------------------------------------------------------- /EDC-Schematics/EDC-Schematics.kicad_pcb: -------------------------------------------------------------------------------- 1 | (kicad_pcb (version 20211014) (generator pcbnew) 2 | ) -------------------------------------------------------------------------------- /EDC-Schematics/EDC-Schematics.kicad_prl: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "active_layer": 0, 4 | "active_layer_preset": "", 5 | "auto_track_width": true, 6 | "hidden_nets": [], 7 | "high_contrast_mode": 0, 8 | "net_color_mode": 1, 9 | "opacity": { 10 | "pads": 1.0, 11 | "tracks": 1.0, 12 | "vias": 1.0, 13 | "zones": 0.6 14 | }, 15 | "ratsnest_display_mode": 0, 16 | "selection_filter": { 17 | "dimensions": true, 18 | "footprints": true, 19 | "graphics": true, 20 | "keepouts": true, 21 | "lockedItems": true, 22 | "otherItems": true, 23 | "pads": true, 24 | "text": true, 25 | "tracks": true, 26 | "vias": true, 27 | "zones": true 28 | }, 29 | "visible_items": [ 30 | 0, 31 | 1, 32 | 2, 33 | 3, 34 | 4, 35 | 5, 36 | 8, 37 | 9, 38 | 10, 39 | 11, 40 | 12, 41 | 13, 42 | 14, 43 | 15, 44 | 16, 45 | 17, 46 | 18, 47 | 19, 48 | 20, 49 | 21, 50 | 22, 51 | 23, 52 | 24, 53 | 25, 54 | 26, 55 | 27, 56 | 28, 57 | 29, 58 | 30, 59 | 32, 60 | 33, 61 | 34, 62 | 35, 63 | 36 64 | ], 65 | "visible_layers": "fffffff_ffffffff", 66 | "zone_display_mode": 0 67 | }, 68 | "meta": { 69 | "filename": "EDC-Schematics.kicad_prl", 70 | "version": 3 71 | }, 72 | "project": { 73 | "files": [] 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /EDC-Schematics/EDC-Schematics.kicad_pro: -------------------------------------------------------------------------------- 1 | { 2 | "board": { 3 | "design_settings": { 4 | "defaults": { 5 | "board_outline_line_width": 0.1, 6 | "copper_line_width": 0.2, 7 | "copper_text_size_h": 1.5, 8 | "copper_text_size_v": 1.5, 9 | "copper_text_thickness": 0.3, 10 | "other_line_width": 0.15, 11 | "silk_line_width": 0.15, 12 | "silk_text_size_h": 1.0, 13 | "silk_text_size_v": 1.0, 14 | "silk_text_thickness": 0.15 15 | }, 16 | "diff_pair_dimensions": [], 17 | "drc_exclusions": [], 18 | "rules": { 19 | "min_copper_edge_clearance": 0.0, 20 | "solder_mask_clearance": 0.0, 21 | "solder_mask_min_width": 0.0 22 | }, 23 | "track_widths": [], 24 | "via_dimensions": [] 25 | }, 26 | "layer_presets": [] 27 | }, 28 | "boards": [], 29 | "cvpcb": { 30 | "equivalence_files": [] 31 | }, 32 | "erc": { 33 | "erc_exclusions": [], 34 | "meta": { 35 | "version": 0 36 | }, 37 | "pin_map": [ 38 | [ 39 | 0, 40 | 0, 41 | 0, 42 | 0, 43 | 0, 44 | 0, 45 | 1, 46 | 0, 47 | 0, 48 | 0, 49 | 0, 50 | 2 51 | ], 52 | [ 53 | 0, 54 | 2, 55 | 0, 56 | 1, 57 | 0, 58 | 0, 59 | 1, 60 | 0, 61 | 2, 62 | 2, 63 | 2, 64 | 2 65 | ], 66 | [ 67 | 0, 68 | 0, 69 | 0, 70 | 0, 71 | 0, 72 | 0, 73 | 1, 74 | 0, 75 | 1, 76 | 0, 77 | 1, 78 | 2 79 | ], 80 | [ 81 | 0, 82 | 1, 83 | 0, 84 | 0, 85 | 0, 86 | 0, 87 | 1, 88 | 1, 89 | 2, 90 | 1, 91 | 1, 92 | 2 93 | ], 94 | [ 95 | 0, 96 | 0, 97 | 0, 98 | 0, 99 | 0, 100 | 0, 101 | 1, 102 | 0, 103 | 0, 104 | 0, 105 | 0, 106 | 2 107 | ], 108 | [ 109 | 0, 110 | 0, 111 | 0, 112 | 0, 113 | 0, 114 | 0, 115 | 0, 116 | 0, 117 | 0, 118 | 0, 119 | 0, 120 | 2 121 | ], 122 | [ 123 | 1, 124 | 1, 125 | 1, 126 | 1, 127 | 1, 128 | 0, 129 | 1, 130 | 1, 131 | 1, 132 | 1, 133 | 1, 134 | 2 135 | ], 136 | [ 137 | 0, 138 | 0, 139 | 0, 140 | 1, 141 | 0, 142 | 0, 143 | 1, 144 | 0, 145 | 0, 146 | 0, 147 | 0, 148 | 2 149 | ], 150 | [ 151 | 0, 152 | 2, 153 | 1, 154 | 2, 155 | 0, 156 | 0, 157 | 1, 158 | 0, 159 | 2, 160 | 2, 161 | 2, 162 | 2 163 | ], 164 | [ 165 | 0, 166 | 2, 167 | 0, 168 | 1, 169 | 0, 170 | 0, 171 | 1, 172 | 0, 173 | 2, 174 | 0, 175 | 0, 176 | 2 177 | ], 178 | [ 179 | 0, 180 | 2, 181 | 1, 182 | 1, 183 | 0, 184 | 0, 185 | 1, 186 | 0, 187 | 2, 188 | 0, 189 | 0, 190 | 2 191 | ], 192 | [ 193 | 2, 194 | 2, 195 | 2, 196 | 2, 197 | 2, 198 | 2, 199 | 2, 200 | 2, 201 | 2, 202 | 2, 203 | 2, 204 | 2 205 | ] 206 | ], 207 | "rule_severities": { 208 | "bus_definition_conflict": "error", 209 | "bus_entry_needed": "error", 210 | "bus_label_syntax": "error", 211 | "bus_to_bus_conflict": "error", 212 | "bus_to_net_conflict": "error", 213 | "different_unit_footprint": "error", 214 | "different_unit_net": "error", 215 | "duplicate_reference": "error", 216 | "duplicate_sheet_names": "error", 217 | "extra_units": "error", 218 | "global_label_dangling": "warning", 219 | "hier_label_mismatch": "error", 220 | "label_dangling": "error", 221 | "lib_symbol_issues": "warning", 222 | "multiple_net_names": "warning", 223 | "net_not_bus_member": "warning", 224 | "no_connect_connected": "warning", 225 | "no_connect_dangling": "warning", 226 | "pin_not_connected": "error", 227 | "pin_not_driven": "error", 228 | "pin_to_pin": "error", 229 | "power_pin_not_driven": "error", 230 | "similar_labels": "warning", 231 | "unannotated": "error", 232 | "unit_value_mismatch": "error", 233 | "unresolved_variable": "error", 234 | "wire_dangling": "error" 235 | } 236 | }, 237 | "libraries": { 238 | "pinned_footprint_libs": [], 239 | "pinned_symbol_libs": [] 240 | }, 241 | "meta": { 242 | "filename": "EDC-Schematics.kicad_pro", 243 | "version": 1 244 | }, 245 | "net_settings": { 246 | "classes": [ 247 | { 248 | "bus_width": 12.0, 249 | "clearance": 0.2, 250 | "diff_pair_gap": 0.25, 251 | "diff_pair_via_gap": 0.25, 252 | "diff_pair_width": 0.2, 253 | "line_style": 0, 254 | "microvia_diameter": 0.3, 255 | "microvia_drill": 0.1, 256 | "name": "Default", 257 | "pcb_color": "rgba(0, 0, 0, 0.000)", 258 | "schematic_color": "rgba(0, 0, 0, 0.000)", 259 | "track_width": 0.25, 260 | "via_diameter": 0.8, 261 | "via_drill": 0.4, 262 | "wire_width": 6.0 263 | } 264 | ], 265 | "meta": { 266 | "version": 2 267 | }, 268 | "net_colors": null 269 | }, 270 | "pcbnew": { 271 | "last_paths": { 272 | "gencad": "", 273 | "idf": "", 274 | "netlist": "", 275 | "specctra_dsn": "", 276 | "step": "", 277 | "vrml": "" 278 | }, 279 | "page_layout_descr_file": "" 280 | }, 281 | "schematic": { 282 | "annotate_start_num": 0, 283 | "drawing": { 284 | "default_line_thickness": 6.0, 285 | "default_text_size": 50.0, 286 | "field_names": [], 287 | "intersheets_ref_own_page": false, 288 | "intersheets_ref_prefix": "", 289 | "intersheets_ref_short": false, 290 | "intersheets_ref_show": false, 291 | "intersheets_ref_suffix": "", 292 | "junction_size_choice": 3, 293 | "label_size_ratio": 0.375, 294 | "pin_symbol_size": 25.0, 295 | "text_offset_ratio": 0.15 296 | }, 297 | "legacy_lib_dir": "", 298 | "legacy_lib_list": [], 299 | "meta": { 300 | "version": 1 301 | }, 302 | "net_format_name": "", 303 | "ngspice": { 304 | "fix_include_paths": true, 305 | "fix_passive_vals": false, 306 | "meta": { 307 | "version": 0 308 | }, 309 | "model_mode": 0, 310 | "workbook_filename": "" 311 | }, 312 | "page_layout_descr_file": "", 313 | "plot_directory": "", 314 | "spice_adjust_passive_values": false, 315 | "spice_external_command": "spice \"%I\"", 316 | "subpart_first_id": 65, 317 | "subpart_id_separator": 0 318 | }, 319 | "sheets": [ 320 | [ 321 | "e63e39d7-6ac0-4ffd-8aa3-1841a4541b55", 322 | "" 323 | ] 324 | ], 325 | "text_variables": {} 326 | } 327 | -------------------------------------------------------------------------------- /EDC-Schematics/EDC-Schematics.kicad_sch: -------------------------------------------------------------------------------- 1 | (kicad_sch (version 20211123) (generator eeschema) 2 | 3 | (uuid e63e39d7-6ac0-4ffd-8aa3-1841a4541b55) 4 | 5 | (paper "A4") 6 | 7 | (lib_symbols 8 | (symbol "Device:LED" (pin_numbers hide) (pin_names (offset 1.016) hide) (in_bom yes) (on_board yes) 9 | (property "Reference" "D" (id 0) (at 0 2.54 0) 10 | (effects (font (size 1.27 1.27))) 11 | ) 12 | (property "Value" "LED" (id 1) (at 0 -2.54 0) 13 | (effects (font (size 1.27 1.27))) 14 | ) 15 | (property "Footprint" "" (id 2) (at 0 0 0) 16 | (effects (font (size 1.27 1.27)) hide) 17 | ) 18 | (property "Datasheet" "~" (id 3) (at 0 0 0) 19 | (effects (font (size 1.27 1.27)) hide) 20 | ) 21 | (property "ki_keywords" "LED diode" (id 4) (at 0 0 0) 22 | (effects (font (size 1.27 1.27)) hide) 23 | ) 24 | (property "ki_description" "Light emitting diode" (id 5) (at 0 0 0) 25 | (effects (font (size 1.27 1.27)) hide) 26 | ) 27 | (property "ki_fp_filters" "LED* LED_SMD:* LED_THT:*" (id 6) (at 0 0 0) 28 | (effects (font (size 1.27 1.27)) hide) 29 | ) 30 | (symbol "LED_0_1" 31 | (polyline 32 | (pts 33 | (xy -1.27 -1.27) 34 | (xy -1.27 1.27) 35 | ) 36 | (stroke (width 0.254) (type default) (color 0 0 0 0)) 37 | (fill (type none)) 38 | ) 39 | (polyline 40 | (pts 41 | (xy -1.27 0) 42 | (xy 1.27 0) 43 | ) 44 | (stroke (width 0) (type default) (color 0 0 0 0)) 45 | (fill (type none)) 46 | ) 47 | (polyline 48 | (pts 49 | (xy 1.27 -1.27) 50 | (xy 1.27 1.27) 51 | (xy -1.27 0) 52 | (xy 1.27 -1.27) 53 | ) 54 | (stroke (width 0.254) (type default) (color 0 0 0 0)) 55 | (fill (type none)) 56 | ) 57 | (polyline 58 | (pts 59 | (xy -3.048 -0.762) 60 | (xy -4.572 -2.286) 61 | (xy -3.81 -2.286) 62 | (xy -4.572 -2.286) 63 | (xy -4.572 -1.524) 64 | ) 65 | (stroke (width 0) (type default) (color 0 0 0 0)) 66 | (fill (type none)) 67 | ) 68 | (polyline 69 | (pts 70 | (xy -1.778 -0.762) 71 | (xy -3.302 -2.286) 72 | (xy -2.54 -2.286) 73 | (xy -3.302 -2.286) 74 | (xy -3.302 -1.524) 75 | ) 76 | (stroke (width 0) (type default) (color 0 0 0 0)) 77 | (fill (type none)) 78 | ) 79 | ) 80 | (symbol "LED_1_1" 81 | (pin passive line (at -3.81 0 0) (length 2.54) 82 | (name "K" (effects (font (size 1.27 1.27)))) 83 | (number "1" (effects (font (size 1.27 1.27)))) 84 | ) 85 | (pin passive line (at 3.81 0 180) (length 2.54) 86 | (name "A" (effects (font (size 1.27 1.27)))) 87 | (number "2" (effects (font (size 1.27 1.27)))) 88 | ) 89 | ) 90 | ) 91 | (symbol "Device:R" (pin_numbers hide) (pin_names (offset 0)) (in_bom yes) (on_board yes) 92 | (property "Reference" "R" (id 0) (at 2.032 0 90) 93 | (effects (font (size 1.27 1.27))) 94 | ) 95 | (property "Value" "R" (id 1) (at 0 0 90) 96 | (effects (font (size 1.27 1.27))) 97 | ) 98 | (property "Footprint" "" (id 2) (at -1.778 0 90) 99 | (effects (font (size 1.27 1.27)) hide) 100 | ) 101 | (property "Datasheet" "~" (id 3) (at 0 0 0) 102 | (effects (font (size 1.27 1.27)) hide) 103 | ) 104 | (property "ki_keywords" "R res resistor" (id 4) (at 0 0 0) 105 | (effects (font (size 1.27 1.27)) hide) 106 | ) 107 | (property "ki_description" "Resistor" (id 5) (at 0 0 0) 108 | (effects (font (size 1.27 1.27)) hide) 109 | ) 110 | (property "ki_fp_filters" "R_*" (id 6) (at 0 0 0) 111 | (effects (font (size 1.27 1.27)) hide) 112 | ) 113 | (symbol "R_0_1" 114 | (rectangle (start -1.016 -2.54) (end 1.016 2.54) 115 | (stroke (width 0.254) (type default) (color 0 0 0 0)) 116 | (fill (type none)) 117 | ) 118 | ) 119 | (symbol "R_1_1" 120 | (pin passive line (at 0 3.81 270) (length 1.27) 121 | (name "~" (effects (font (size 1.27 1.27)))) 122 | (number "1" (effects (font (size 1.27 1.27)))) 123 | ) 124 | (pin passive line (at 0 -3.81 90) (length 1.27) 125 | (name "~" (effects (font (size 1.27 1.27)))) 126 | (number "2" (effects (font (size 1.27 1.27)))) 127 | ) 128 | ) 129 | ) 130 | (symbol "Switch:SW_SPDT" (pin_names (offset 0) hide) (in_bom yes) (on_board yes) 131 | (property "Reference" "SW" (id 0) (at 0 4.318 0) 132 | (effects (font (size 1.27 1.27))) 133 | ) 134 | (property "Value" "SW_SPDT" (id 1) (at 0 -5.08 0) 135 | (effects (font (size 1.27 1.27))) 136 | ) 137 | (property "Footprint" "" (id 2) (at 0 0 0) 138 | (effects (font (size 1.27 1.27)) hide) 139 | ) 140 | (property "Datasheet" "~" (id 3) (at 0 0 0) 141 | (effects (font (size 1.27 1.27)) hide) 142 | ) 143 | (property "ki_keywords" "switch single-pole double-throw spdt ON-ON" (id 4) (at 0 0 0) 144 | (effects (font (size 1.27 1.27)) hide) 145 | ) 146 | (property "ki_description" "Switch, single pole double throw" (id 5) (at 0 0 0) 147 | (effects (font (size 1.27 1.27)) hide) 148 | ) 149 | (symbol "SW_SPDT_0_0" 150 | (circle (center -2.032 0) (radius 0.508) 151 | (stroke (width 0) (type default) (color 0 0 0 0)) 152 | (fill (type none)) 153 | ) 154 | (circle (center 2.032 -2.54) (radius 0.508) 155 | (stroke (width 0) (type default) (color 0 0 0 0)) 156 | (fill (type none)) 157 | ) 158 | ) 159 | (symbol "SW_SPDT_0_1" 160 | (polyline 161 | (pts 162 | (xy -1.524 0.254) 163 | (xy 1.651 2.286) 164 | ) 165 | (stroke (width 0) (type default) (color 0 0 0 0)) 166 | (fill (type none)) 167 | ) 168 | (circle (center 2.032 2.54) (radius 0.508) 169 | (stroke (width 0) (type default) (color 0 0 0 0)) 170 | (fill (type none)) 171 | ) 172 | ) 173 | (symbol "SW_SPDT_1_1" 174 | (pin passive line (at 5.08 2.54 180) (length 2.54) 175 | (name "A" (effects (font (size 1.27 1.27)))) 176 | (number "1" (effects (font (size 1.27 1.27)))) 177 | ) 178 | (pin passive line (at -5.08 0 0) (length 2.54) 179 | (name "B" (effects (font (size 1.27 1.27)))) 180 | (number "2" (effects (font (size 1.27 1.27)))) 181 | ) 182 | (pin passive line (at 5.08 -2.54 180) (length 2.54) 183 | (name "C" (effects (font (size 1.27 1.27)))) 184 | (number "3" (effects (font (size 1.27 1.27)))) 185 | ) 186 | ) 187 | ) 188 | (symbol "Transistor_BJT:BC547" (pin_names (offset 0) hide) (in_bom yes) (on_board yes) 189 | (property "Reference" "Q" (id 0) (at 5.08 1.905 0) 190 | (effects (font (size 1.27 1.27)) (justify left)) 191 | ) 192 | (property "Value" "BC547" (id 1) (at 5.08 0 0) 193 | (effects (font (size 1.27 1.27)) (justify left)) 194 | ) 195 | (property "Footprint" "Package_TO_SOT_THT:TO-92_Inline" (id 2) (at 5.08 -1.905 0) 196 | (effects (font (size 1.27 1.27) italic) (justify left) hide) 197 | ) 198 | (property "Datasheet" "https://www.onsemi.com/pub/Collateral/BC550-D.pdf" (id 3) (at 0 0 0) 199 | (effects (font (size 1.27 1.27)) (justify left) hide) 200 | ) 201 | (property "ki_keywords" "NPN Transistor" (id 4) (at 0 0 0) 202 | (effects (font (size 1.27 1.27)) hide) 203 | ) 204 | (property "ki_description" "0.1A Ic, 45V Vce, Small Signal NPN Transistor, TO-92" (id 5) (at 0 0 0) 205 | (effects (font (size 1.27 1.27)) hide) 206 | ) 207 | (property "ki_fp_filters" "TO?92*" (id 6) (at 0 0 0) 208 | (effects (font (size 1.27 1.27)) hide) 209 | ) 210 | (symbol "BC547_0_1" 211 | (polyline 212 | (pts 213 | (xy 0 0) 214 | (xy 0.635 0) 215 | ) 216 | (stroke (width 0) (type default) (color 0 0 0 0)) 217 | (fill (type none)) 218 | ) 219 | (polyline 220 | (pts 221 | (xy 0.635 0.635) 222 | (xy 2.54 2.54) 223 | ) 224 | (stroke (width 0) (type default) (color 0 0 0 0)) 225 | (fill (type none)) 226 | ) 227 | (polyline 228 | (pts 229 | (xy 0.635 -0.635) 230 | (xy 2.54 -2.54) 231 | (xy 2.54 -2.54) 232 | ) 233 | (stroke (width 0) (type default) (color 0 0 0 0)) 234 | (fill (type none)) 235 | ) 236 | (polyline 237 | (pts 238 | (xy 0.635 1.905) 239 | (xy 0.635 -1.905) 240 | (xy 0.635 -1.905) 241 | ) 242 | (stroke (width 0.508) (type default) (color 0 0 0 0)) 243 | (fill (type none)) 244 | ) 245 | (polyline 246 | (pts 247 | (xy 1.27 -1.778) 248 | (xy 1.778 -1.27) 249 | (xy 2.286 -2.286) 250 | (xy 1.27 -1.778) 251 | (xy 1.27 -1.778) 252 | ) 253 | (stroke (width 0) (type default) (color 0 0 0 0)) 254 | (fill (type outline)) 255 | ) 256 | (circle (center 1.27 0) (radius 2.8194) 257 | (stroke (width 0.254) (type default) (color 0 0 0 0)) 258 | (fill (type none)) 259 | ) 260 | ) 261 | (symbol "BC547_1_1" 262 | (pin passive line (at 2.54 5.08 270) (length 2.54) 263 | (name "C" (effects (font (size 1.27 1.27)))) 264 | (number "1" (effects (font (size 1.27 1.27)))) 265 | ) 266 | (pin input line (at -5.08 0 0) (length 5.08) 267 | (name "B" (effects (font (size 1.27 1.27)))) 268 | (number "2" (effects (font (size 1.27 1.27)))) 269 | ) 270 | (pin passive line (at 2.54 -5.08 90) (length 2.54) 271 | (name "E" (effects (font (size 1.27 1.27)))) 272 | (number "3" (effects (font (size 1.27 1.27)))) 273 | ) 274 | ) 275 | ) 276 | (symbol "power:+5V" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes) 277 | (property "Reference" "#PWR" (id 0) (at 0 -3.81 0) 278 | (effects (font (size 1.27 1.27)) hide) 279 | ) 280 | (property "Value" "+5V" (id 1) (at 0 3.556 0) 281 | (effects (font (size 1.27 1.27))) 282 | ) 283 | (property "Footprint" "" (id 2) (at 0 0 0) 284 | (effects (font (size 1.27 1.27)) hide) 285 | ) 286 | (property "Datasheet" "" (id 3) (at 0 0 0) 287 | (effects (font (size 1.27 1.27)) hide) 288 | ) 289 | (property "ki_keywords" "power-flag" (id 4) (at 0 0 0) 290 | (effects (font (size 1.27 1.27)) hide) 291 | ) 292 | (property "ki_description" "Power symbol creates a global label with name \"+5V\"" (id 5) (at 0 0 0) 293 | (effects (font (size 1.27 1.27)) hide) 294 | ) 295 | (symbol "+5V_0_1" 296 | (polyline 297 | (pts 298 | (xy -0.762 1.27) 299 | (xy 0 2.54) 300 | ) 301 | (stroke (width 0) (type default) (color 0 0 0 0)) 302 | (fill (type none)) 303 | ) 304 | (polyline 305 | (pts 306 | (xy 0 0) 307 | (xy 0 2.54) 308 | ) 309 | (stroke (width 0) (type default) (color 0 0 0 0)) 310 | (fill (type none)) 311 | ) 312 | (polyline 313 | (pts 314 | (xy 0 2.54) 315 | (xy 0.762 1.27) 316 | ) 317 | (stroke (width 0) (type default) (color 0 0 0 0)) 318 | (fill (type none)) 319 | ) 320 | ) 321 | (symbol "+5V_1_1" 322 | (pin power_in line (at 0 0 90) (length 0) hide 323 | (name "+5V" (effects (font (size 1.27 1.27)))) 324 | (number "1" (effects (font (size 1.27 1.27)))) 325 | ) 326 | ) 327 | ) 328 | (symbol "power:GND" (power) (pin_names (offset 0)) (in_bom yes) (on_board yes) 329 | (property "Reference" "#PWR" (id 0) (at 0 -6.35 0) 330 | (effects (font (size 1.27 1.27)) hide) 331 | ) 332 | (property "Value" "GND" (id 1) (at 0 -3.81 0) 333 | (effects (font (size 1.27 1.27))) 334 | ) 335 | (property "Footprint" "" (id 2) (at 0 0 0) 336 | (effects (font (size 1.27 1.27)) hide) 337 | ) 338 | (property "Datasheet" "" (id 3) (at 0 0 0) 339 | (effects (font (size 1.27 1.27)) hide) 340 | ) 341 | (property "ki_keywords" "power-flag" (id 4) (at 0 0 0) 342 | (effects (font (size 1.27 1.27)) hide) 343 | ) 344 | (property "ki_description" "Power symbol creates a global label with name \"GND\" , ground" (id 5) (at 0 0 0) 345 | (effects (font (size 1.27 1.27)) hide) 346 | ) 347 | (symbol "GND_0_1" 348 | (polyline 349 | (pts 350 | (xy 0 0) 351 | (xy 0 -1.27) 352 | (xy 1.27 -1.27) 353 | (xy 0 -2.54) 354 | (xy -1.27 -1.27) 355 | (xy 0 -1.27) 356 | ) 357 | (stroke (width 0) (type default) (color 0 0 0 0)) 358 | (fill (type none)) 359 | ) 360 | ) 361 | (symbol "GND_1_1" 362 | (pin power_in line (at 0 0 270) (length 0) hide 363 | (name "GND" (effects (font (size 1.27 1.27)))) 364 | (number "1" (effects (font (size 1.27 1.27)))) 365 | ) 366 | ) 367 | ) 368 | ) 369 | 370 | (junction (at 148.59 179.07) (diameter 0) (color 0 0 0 0) 371 | (uuid 1c04948d-d021-44d7-b668-6a8a29cc55e6) 372 | ) 373 | (junction (at 95.25 179.07) (diameter 0) (color 0 0 0 0) 374 | (uuid 4621ecba-4175-4ca1-9974-ecca8eb10dcb) 375 | ) 376 | (junction (at 48.26 143.51) (diameter 0) (color 0 0 0 0) 377 | (uuid 53a465c8-da8a-43e6-a133-ce42bbf81b8f) 378 | ) 379 | (junction (at 252.73 143.51) (diameter 0) (color 0 0 0 0) 380 | (uuid 65b1acc5-c70f-4ca9-b64c-d2221734044d) 381 | ) 382 | (junction (at 148.59 143.51) (diameter 0) (color 0 0 0 0) 383 | (uuid 6ce9d2bd-7be8-48c9-bf79-acd21207775e) 384 | ) 385 | (junction (at 252.73 107.95) (diameter 0) (color 0 0 0 0) 386 | (uuid 71a38661-2f1f-4c08-8840-2d5596d2c0a8) 387 | ) 388 | (junction (at 95.25 143.51) (diameter 0) (color 0 0 0 0) 389 | (uuid 9bc1e6d4-b100-47b9-ae9f-f9442e69ceee) 390 | ) 391 | (junction (at 198.12 143.51) (diameter 0) (color 0 0 0 0) 392 | (uuid afa1e3e3-9a93-4a9d-be10-b6a15433e600) 393 | ) 394 | (junction (at 198.12 107.95) (diameter 0) (color 0 0 0 0) 395 | (uuid b919cd47-ce3f-4236-8312-16d537ac9551) 396 | ) 397 | (junction (at 48.26 179.07) (diameter 0) (color 0 0 0 0) 398 | (uuid d672ad6b-f8ff-43e7-8de8-790630db4989) 399 | ) 400 | 401 | (wire (pts (xy 66.04 179.07) (xy 95.25 179.07)) 402 | (stroke (width 0) (type default) (color 0 0 0 0)) 403 | (uuid 16614250-2016-4edc-8daf-961aaaa4a40f) 404 | ) 405 | (wire (pts (xy 179.07 125.73) (xy 181.61 125.73)) 406 | (stroke (width 0) (type default) (color 0 0 0 0)) 407 | (uuid 1bafea92-b00c-43ef-9fd5-5b2e6f76b5eb) 408 | ) 409 | (wire (pts (xy 148.59 153.67) (xy 148.59 156.21)) 410 | (stroke (width 0) (type default) (color 0 0 0 0)) 411 | (uuid 1de66ac9-1742-47b9-9179-e732006b31a5) 412 | ) 413 | (wire (pts (xy 48.26 143.51) (xy 48.26 146.05)) 414 | (stroke (width 0) (type default) (color 0 0 0 0)) 415 | (uuid 1f662620-26a8-4908-9100-de4532919888) 416 | ) 417 | (wire (pts (xy 76.2 161.29) (xy 78.74 161.29)) 418 | (stroke (width 0) (type default) (color 0 0 0 0)) 419 | (uuid 23754e2e-1284-411a-b860-780df6f0ea1a) 420 | ) 421 | (wire (pts (xy 95.25 176.53) (xy 95.25 179.07)) 422 | (stroke (width 0) (type default) (color 0 0 0 0)) 423 | (uuid 2ab7dc5b-2b02-4893-a2b3-3bcdd8127da1) 424 | ) 425 | (wire (pts (xy 119.38 163.83) (xy 119.38 179.07)) 426 | (stroke (width 0) (type default) (color 0 0 0 0)) 427 | (uuid 2c15cc39-a1ae-4a0f-9cf3-e5e25d1f362b) 428 | ) 429 | (wire (pts (xy 119.38 143.51) (xy 148.59 143.51)) 430 | (stroke (width 0) (type default) (color 0 0 0 0)) 431 | (uuid 2d304925-2439-4ed1-abec-a63a08a89c16) 432 | ) 433 | (wire (pts (xy 168.91 107.95) (xy 198.12 107.95)) 434 | (stroke (width 0) (type default) (color 0 0 0 0)) 435 | (uuid 2dadfdcf-7afa-49bb-a7fd-bb7a11943156) 436 | ) 437 | (wire (pts (xy 139.7 161.29) (xy 140.97 161.29)) 438 | (stroke (width 0) (type default) (color 0 0 0 0)) 439 | (uuid 2dafd300-e928-4cfd-af46-3ea2fbd09de2) 440 | ) 441 | (wire (pts (xy 223.52 143.51) (xy 252.73 143.51)) 442 | (stroke (width 0) (type default) (color 0 0 0 0)) 443 | (uuid 318a98c4-f871-4b2d-82ec-ad81e32c84f0) 444 | ) 445 | (wire (pts (xy 223.52 128.27) (xy 223.52 143.51)) 446 | (stroke (width 0) (type default) (color 0 0 0 0)) 447 | (uuid 3845f39a-1325-4724-a5c7-74584df9f70c) 448 | ) 449 | (wire (pts (xy 86.36 161.29) (xy 87.63 161.29)) 450 | (stroke (width 0) (type default) (color 0 0 0 0)) 451 | (uuid 39312417-4102-4b59-99c2-4c3f1033bbac) 452 | ) 453 | (wire (pts (xy 19.05 158.75) (xy 19.05 143.51)) 454 | (stroke (width 0) (type default) (color 0 0 0 0)) 455 | (uuid 3b5ef73b-c03b-476d-a32b-fe8d2e2410db) 456 | ) 457 | (wire (pts (xy 252.73 140.97) (xy 252.73 143.51)) 458 | (stroke (width 0) (type default) (color 0 0 0 0)) 459 | (uuid 3deedf83-48a4-4c7f-a205-07f645d1a6c4) 460 | ) 461 | (wire (pts (xy 168.91 143.51) (xy 198.12 143.51)) 462 | (stroke (width 0) (type default) (color 0 0 0 0)) 463 | (uuid 43d3776c-e1ca-40de-8902-77ecf8f802c0) 464 | ) 465 | (wire (pts (xy 168.91 128.27) (xy 168.91 143.51)) 466 | (stroke (width 0) (type default) (color 0 0 0 0)) 467 | (uuid 47e29d3c-3fa6-4339-bd9f-3dbe341495b3) 468 | ) 469 | (wire (pts (xy 48.26 153.67) (xy 48.26 156.21)) 470 | (stroke (width 0) (type default) (color 0 0 0 0)) 471 | (uuid 5497cfc5-f562-4511-8157-d290ace48c22) 472 | ) 473 | (wire (pts (xy 66.04 143.51) (xy 95.25 143.51)) 474 | (stroke (width 0) (type default) (color 0 0 0 0)) 475 | (uuid 55217444-e629-4b25-b9cf-f11a193bd04e) 476 | ) 477 | (wire (pts (xy 148.59 176.53) (xy 148.59 179.07)) 478 | (stroke (width 0) (type default) (color 0 0 0 0)) 479 | (uuid 56b60cc1-c31d-41c3-9a8b-4c78c616d95f) 480 | ) 481 | (wire (pts (xy 148.59 166.37) (xy 148.59 168.91)) 482 | (stroke (width 0) (type default) (color 0 0 0 0)) 483 | (uuid 586f7524-eda5-42c6-9b6b-cd9064a41fff) 484 | ) 485 | (wire (pts (xy 29.21 161.29) (xy 31.75 161.29)) 486 | (stroke (width 0) (type default) (color 0 0 0 0)) 487 | (uuid 66d18b38-4ac1-45bc-85a2-0b55a455ae90) 488 | ) 489 | (wire (pts (xy 233.68 125.73) (xy 236.22 125.73)) 490 | (stroke (width 0) (type default) (color 0 0 0 0)) 491 | (uuid 697d8c35-4e32-4244-a5cf-cbf95ce36578) 492 | ) 493 | (wire (pts (xy 119.38 158.75) (xy 119.38 143.51)) 494 | (stroke (width 0) (type default) (color 0 0 0 0)) 495 | (uuid 6c66a1ac-a1b6-46cd-9732-79461875e806) 496 | ) 497 | (wire (pts (xy 252.73 107.95) (xy 252.73 110.49)) 498 | (stroke (width 0) (type default) (color 0 0 0 0)) 499 | (uuid 6f78f18c-a16c-4e79-9a3a-d3e7e0cb6185) 500 | ) 501 | (wire (pts (xy 148.59 143.51) (xy 148.59 146.05)) 502 | (stroke (width 0) (type default) (color 0 0 0 0)) 503 | (uuid 70c904ae-617f-416a-909b-879eea2d3a11) 504 | ) 505 | (wire (pts (xy 198.12 130.81) (xy 198.12 133.35)) 506 | (stroke (width 0) (type default) (color 0 0 0 0)) 507 | (uuid 7e013bf5-4f09-49f8-b33a-e00d847bbcb6) 508 | ) 509 | (wire (pts (xy 129.54 161.29) (xy 132.08 161.29)) 510 | (stroke (width 0) (type default) (color 0 0 0 0)) 511 | (uuid 80936eed-19e9-4548-b6bb-4c17975ee468) 512 | ) 513 | (wire (pts (xy 243.84 125.73) (xy 245.11 125.73)) 514 | (stroke (width 0) (type default) (color 0 0 0 0)) 515 | (uuid 86fc3bd4-8f9e-4006-8a25-85c1a75dc525) 516 | ) 517 | (wire (pts (xy 198.12 140.97) (xy 198.12 143.51)) 518 | (stroke (width 0) (type default) (color 0 0 0 0)) 519 | (uuid 8fca96ea-0fc4-4094-a481-35d026d1c373) 520 | ) 521 | (wire (pts (xy 189.23 125.73) (xy 190.5 125.73)) 522 | (stroke (width 0) (type default) (color 0 0 0 0)) 523 | (uuid 9006b172-4c3d-415b-85a5-99635b5afe48) 524 | ) 525 | (wire (pts (xy 19.05 163.83) (xy 19.05 179.07)) 526 | (stroke (width 0) (type default) (color 0 0 0 0)) 527 | (uuid 904edaf7-0977-4e3e-8dbe-9423390a87f1) 528 | ) 529 | (wire (pts (xy 39.37 161.29) (xy 40.64 161.29)) 530 | (stroke (width 0) (type default) (color 0 0 0 0)) 531 | (uuid 91d9b9b4-8657-418b-93ca-4cddb4fdad54) 532 | ) 533 | (wire (pts (xy 223.52 123.19) (xy 223.52 107.95)) 534 | (stroke (width 0) (type default) (color 0 0 0 0)) 535 | (uuid 9546cf34-5f45-42c8-ad0b-c0bff468a3f4) 536 | ) 537 | (wire (pts (xy 19.05 143.51) (xy 48.26 143.51)) 538 | (stroke (width 0) (type default) (color 0 0 0 0)) 539 | (uuid 96f8b03d-ceee-4b39-945a-e1ad1030a89c) 540 | ) 541 | (wire (pts (xy 198.12 118.11) (xy 198.12 120.65)) 542 | (stroke (width 0) (type default) (color 0 0 0 0)) 543 | (uuid 98d8d1c1-c08e-4c50-9821-dbc5d7fb0cd3) 544 | ) 545 | (wire (pts (xy 66.04 163.83) (xy 66.04 179.07)) 546 | (stroke (width 0) (type default) (color 0 0 0 0)) 547 | (uuid b0b2d017-a444-4e91-bb0c-8eff9c992238) 548 | ) 549 | (wire (pts (xy 198.12 107.95) (xy 198.12 110.49)) 550 | (stroke (width 0) (type default) (color 0 0 0 0)) 551 | (uuid b10aacb4-0a2c-4ebd-a6bd-e875815af479) 552 | ) 553 | (wire (pts (xy 19.05 179.07) (xy 48.26 179.07)) 554 | (stroke (width 0) (type default) (color 0 0 0 0)) 555 | (uuid b39aa821-471f-47fc-aaa9-453ae13cb879) 556 | ) 557 | (wire (pts (xy 48.26 176.53) (xy 48.26 179.07)) 558 | (stroke (width 0) (type default) (color 0 0 0 0)) 559 | (uuid b92983bc-f38e-4028-bd49-d09150256997) 560 | ) 561 | (wire (pts (xy 119.38 179.07) (xy 148.59 179.07)) 562 | (stroke (width 0) (type default) (color 0 0 0 0)) 563 | (uuid bf4c04fa-6009-45df-a30f-365742d78e1a) 564 | ) 565 | (wire (pts (xy 95.25 166.37) (xy 95.25 168.91)) 566 | (stroke (width 0) (type default) (color 0 0 0 0)) 567 | (uuid c2634fdb-a410-4942-97f6-2a2170ce79c8) 568 | ) 569 | (wire (pts (xy 66.04 158.75) (xy 66.04 143.51)) 570 | (stroke (width 0) (type default) (color 0 0 0 0)) 571 | (uuid cb928740-974a-42a1-84e1-eab4ec60e4b2) 572 | ) 573 | (wire (pts (xy 95.25 143.51) (xy 95.25 146.05)) 574 | (stroke (width 0) (type default) (color 0 0 0 0)) 575 | (uuid d4c60d36-41ae-40e4-85eb-d5556137af2a) 576 | ) 577 | (wire (pts (xy 223.52 107.95) (xy 252.73 107.95)) 578 | (stroke (width 0) (type default) (color 0 0 0 0)) 579 | (uuid d87f91fa-9867-49ad-bddf-c2ac62db4d87) 580 | ) 581 | (wire (pts (xy 252.73 130.81) (xy 252.73 133.35)) 582 | (stroke (width 0) (type default) (color 0 0 0 0)) 583 | (uuid dfac9427-bb29-4a8f-9b76-e636811144eb) 584 | ) 585 | (wire (pts (xy 168.91 123.19) (xy 168.91 107.95)) 586 | (stroke (width 0) (type default) (color 0 0 0 0)) 587 | (uuid e0d426fb-5f9f-427d-a590-bfa68f224dea) 588 | ) 589 | (wire (pts (xy 95.25 153.67) (xy 95.25 156.21)) 590 | (stroke (width 0) (type default) (color 0 0 0 0)) 591 | (uuid f48d4639-918b-484c-91d9-9c4b846cc01a) 592 | ) 593 | (wire (pts (xy 48.26 166.37) (xy 48.26 168.91)) 594 | (stroke (width 0) (type default) (color 0 0 0 0)) 595 | (uuid f56930e0-c42d-434b-bac8-8b2bdd6a2104) 596 | ) 597 | (wire (pts (xy 252.73 118.11) (xy 252.73 120.65)) 598 | (stroke (width 0) (type default) (color 0 0 0 0)) 599 | (uuid fb267c1f-7834-4b8a-b45d-6e540e491d46) 600 | ) 601 | 602 | (symbol (lib_id "Device:R") (at 240.03 125.73 270) (unit 1) 603 | (in_bom yes) (on_board yes) (fields_autoplaced) 604 | (uuid 0f336111-afdf-4b4f-b1aa-17d1545ba5df) 605 | (property "Reference" "R-B-Blue" (id 0) (at 240.03 119.38 90)) 606 | (property "Value" "47k" (id 1) (at 240.03 121.92 90)) 607 | (property "Footprint" "" (id 2) (at 240.03 123.952 90) 608 | (effects (font (size 1.27 1.27)) hide) 609 | ) 610 | (property "Datasheet" "~" (id 3) (at 240.03 125.73 0) 611 | (effects (font (size 1.27 1.27)) hide) 612 | ) 613 | (pin "1" (uuid 6ba4f854-e6d2-432b-8848-f129750d18f5)) 614 | (pin "2" (uuid 8379f587-7691-4e4e-ba9e-55713f5047e4)) 615 | ) 616 | 617 | (symbol (lib_id "Switch:SW_SPDT") (at 228.6 125.73 0) (mirror y) (unit 1) 618 | (in_bom yes) (on_board yes) (fields_autoplaced) 619 | (uuid 15abdd5f-173f-4111-86bd-1471f195e4bd) 620 | (property "Reference" "GP24/Pin9" (id 0) (at 228.6 118.11 0)) 621 | (property "Value" "SW_SPDT" (id 1) (at 228.6 120.65 0)) 622 | (property "Footprint" "" (id 2) (at 228.6 125.73 0) 623 | (effects (font (size 1.27 1.27)) hide) 624 | ) 625 | (property "Datasheet" "~" (id 3) (at 228.6 125.73 0) 626 | (effects (font (size 1.27 1.27)) hide) 627 | ) 628 | (pin "1" (uuid 3ff13fa7-fc96-4b8f-b3de-3f3b228a50da)) 629 | (pin "2" (uuid 229f3825-c2aa-4638-9a5d-e0bb4c039b94)) 630 | (pin "3" (uuid 913090f4-1e4e-451f-8cb6-5020e3a558f1)) 631 | ) 632 | 633 | (symbol (lib_id "power:+5V") (at 95.25 143.51 0) (unit 1) 634 | (in_bom yes) (on_board yes) (fields_autoplaced) 635 | (uuid 1924296e-b984-4fba-96ec-15010e0097d0) 636 | (property "Reference" "#PWR?" (id 0) (at 95.25 147.32 0) 637 | (effects (font (size 1.27 1.27)) hide) 638 | ) 639 | (property "Value" "+5V" (id 1) (at 95.25 138.43 0)) 640 | (property "Footprint" "" (id 2) (at 95.25 143.51 0) 641 | (effects (font (size 1.27 1.27)) hide) 642 | ) 643 | (property "Datasheet" "" (id 3) (at 95.25 143.51 0) 644 | (effects (font (size 1.27 1.27)) hide) 645 | ) 646 | (pin "1" (uuid d8b7bbe5-429e-4b82-a7cb-fbd86a710239)) 647 | ) 648 | 649 | (symbol (lib_id "Transistor_BJT:BC547") (at 45.72 161.29 0) (unit 1) 650 | (in_bom yes) (on_board yes) (fields_autoplaced) 651 | (uuid 232ccf4f-3322-4e62-990b-290e6ff36fcd) 652 | (property "Reference" "T-Red" (id 0) (at 50.8 160.0199 0) 653 | (effects (font (size 1.27 1.27)) (justify left)) 654 | ) 655 | (property "Value" "BC547" (id 1) (at 50.8 162.5599 0) 656 | (effects (font (size 1.27 1.27)) (justify left)) 657 | ) 658 | (property "Footprint" "Package_TO_SOT_THT:TO-92_Inline" (id 2) (at 50.8 163.195 0) 659 | (effects (font (size 1.27 1.27) italic) (justify left) hide) 660 | ) 661 | (property "Datasheet" "https://www.onsemi.com/pub/Collateral/BC550-D.pdf" (id 3) (at 45.72 161.29 0) 662 | (effects (font (size 1.27 1.27)) (justify left) hide) 663 | ) 664 | (pin "1" (uuid 4160bbf7-ffff-4c5c-a647-5ee58ddecf06)) 665 | (pin "2" (uuid 7582a530-a952-46c1-b7eb-75006524ba29)) 666 | (pin "3" (uuid 722636b6-8ff0-452f-9357-23deb317d921)) 667 | ) 668 | 669 | (symbol (lib_id "Device:R") (at 148.59 172.72 180) (unit 1) 670 | (in_bom yes) (on_board yes) (fields_autoplaced) 671 | (uuid 237ed4e7-9e4b-44ae-b898-1a45e0234f0d) 672 | (property "Reference" "R-E-Green" (id 0) (at 151.13 171.4499 0) 673 | (effects (font (size 1.27 1.27)) (justify right)) 674 | ) 675 | (property "Value" "680" (id 1) (at 151.13 173.9899 0) 676 | (effects (font (size 1.27 1.27)) (justify right)) 677 | ) 678 | (property "Footprint" "" (id 2) (at 150.368 172.72 90) 679 | (effects (font (size 1.27 1.27)) hide) 680 | ) 681 | (property "Datasheet" "~" (id 3) (at 148.59 172.72 0) 682 | (effects (font (size 1.27 1.27)) hide) 683 | ) 684 | (pin "1" (uuid 838e535c-6c22-4564-905b-ca83882619e7)) 685 | (pin "2" (uuid 06f2b49e-3ddf-475e-8a0f-5000e8f0d820)) 686 | ) 687 | 688 | (symbol (lib_id "power:GND") (at 252.73 143.51 0) (unit 1) 689 | (in_bom yes) (on_board yes) (fields_autoplaced) 690 | (uuid 256e54e0-345f-4bc5-b72b-c1b71716501b) 691 | (property "Reference" "#PWR?" (id 0) (at 252.73 149.86 0) 692 | (effects (font (size 1.27 1.27)) hide) 693 | ) 694 | (property "Value" "GND" (id 1) (at 252.73 148.59 0)) 695 | (property "Footprint" "" (id 2) (at 252.73 143.51 0) 696 | (effects (font (size 1.27 1.27)) hide) 697 | ) 698 | (property "Datasheet" "" (id 3) (at 252.73 143.51 0) 699 | (effects (font (size 1.27 1.27)) hide) 700 | ) 701 | (pin "1" (uuid 2f5e6a28-cc4f-4988-ba81-28cb8fdce80d)) 702 | ) 703 | 704 | (symbol (lib_id "Device:R") (at 198.12 137.16 180) (unit 1) 705 | (in_bom yes) (on_board yes) (fields_autoplaced) 706 | (uuid 26fc542c-36a0-4549-ade2-a2b76b37b53f) 707 | (property "Reference" "R-E-White" (id 0) (at 200.66 135.8899 0) 708 | (effects (font (size 1.27 1.27)) (justify right)) 709 | ) 710 | (property "Value" "680" (id 1) (at 200.66 138.4299 0) 711 | (effects (font (size 1.27 1.27)) (justify right)) 712 | ) 713 | (property "Footprint" "" (id 2) (at 199.898 137.16 90) 714 | (effects (font (size 1.27 1.27)) hide) 715 | ) 716 | (property "Datasheet" "~" (id 3) (at 198.12 137.16 0) 717 | (effects (font (size 1.27 1.27)) hide) 718 | ) 719 | (pin "1" (uuid fafdf718-7580-4d0a-bb28-a08842133b24)) 720 | (pin "2" (uuid 95be1846-b2cd-4e8f-81f4-530ccee77bb3)) 721 | ) 722 | 723 | (symbol (lib_id "Device:R") (at 48.26 172.72 180) (unit 1) 724 | (in_bom yes) (on_board yes) (fields_autoplaced) 725 | (uuid 2c460627-3821-49f7-9468-7ae3b6ed0c7c) 726 | (property "Reference" "R-E-Red" (id 0) (at 50.8 171.4499 0) 727 | (effects (font (size 1.27 1.27)) (justify right)) 728 | ) 729 | (property "Value" "680" (id 1) (at 50.8 173.9899 0) 730 | (effects (font (size 1.27 1.27)) (justify right)) 731 | ) 732 | (property "Footprint" "" (id 2) (at 50.038 172.72 90) 733 | (effects (font (size 1.27 1.27)) hide) 734 | ) 735 | (property "Datasheet" "~" (id 3) (at 48.26 172.72 0) 736 | (effects (font (size 1.27 1.27)) hide) 737 | ) 738 | (pin "1" (uuid 45c8c8d1-7203-4e66-89e3-2a26fd425d94)) 739 | (pin "2" (uuid 3c085010-f4a5-47e1-8934-1d91bd9a53c7)) 740 | ) 741 | 742 | (symbol (lib_id "power:GND") (at 95.25 179.07 0) (unit 1) 743 | (in_bom yes) (on_board yes) (fields_autoplaced) 744 | (uuid 2d545f9f-e304-433d-8d63-6a014edd384d) 745 | (property "Reference" "#PWR?" (id 0) (at 95.25 185.42 0) 746 | (effects (font (size 1.27 1.27)) hide) 747 | ) 748 | (property "Value" "GND" (id 1) (at 95.25 184.15 0)) 749 | (property "Footprint" "" (id 2) (at 95.25 179.07 0) 750 | (effects (font (size 1.27 1.27)) hide) 751 | ) 752 | (property "Datasheet" "" (id 3) (at 95.25 179.07 0) 753 | (effects (font (size 1.27 1.27)) hide) 754 | ) 755 | (pin "1" (uuid 6ad6e023-b534-4c79-b605-90332ce14ff3)) 756 | ) 757 | 758 | (symbol (lib_id "power:+5V") (at 148.59 143.51 0) (unit 1) 759 | (in_bom yes) (on_board yes) (fields_autoplaced) 760 | (uuid 31eff2f0-0ff7-46bb-a45d-34512c906685) 761 | (property "Reference" "#PWR?" (id 0) (at 148.59 147.32 0) 762 | (effects (font (size 1.27 1.27)) hide) 763 | ) 764 | (property "Value" "+5V" (id 1) (at 148.59 138.43 0)) 765 | (property "Footprint" "" (id 2) (at 148.59 143.51 0) 766 | (effects (font (size 1.27 1.27)) hide) 767 | ) 768 | (property "Datasheet" "" (id 3) (at 148.59 143.51 0) 769 | (effects (font (size 1.27 1.27)) hide) 770 | ) 771 | (pin "1" (uuid f0274084-6263-4418-8217-05a024ae6f09)) 772 | ) 773 | 774 | (symbol (lib_id "Transistor_BJT:BC547") (at 195.58 125.73 0) (unit 1) 775 | (in_bom yes) (on_board yes) (fields_autoplaced) 776 | (uuid 34d66f95-94ed-4979-83df-962a806e9a20) 777 | (property "Reference" "T-White" (id 0) (at 200.66 124.4599 0) 778 | (effects (font (size 1.27 1.27)) (justify left)) 779 | ) 780 | (property "Value" "BC547" (id 1) (at 200.66 126.9999 0) 781 | (effects (font (size 1.27 1.27)) (justify left)) 782 | ) 783 | (property "Footprint" "Package_TO_SOT_THT:TO-92_Inline" (id 2) (at 200.66 127.635 0) 784 | (effects (font (size 1.27 1.27) italic) (justify left) hide) 785 | ) 786 | (property "Datasheet" "https://www.onsemi.com/pub/Collateral/BC550-D.pdf" (id 3) (at 195.58 125.73 0) 787 | (effects (font (size 1.27 1.27)) (justify left) hide) 788 | ) 789 | (pin "1" (uuid 922ba8ce-bd88-4896-a026-6e3e7763fc10)) 790 | (pin "2" (uuid 0c98b516-5af0-4503-a527-da464b4e95ec)) 791 | (pin "3" (uuid 1af06b61-f198-457c-b149-65c759849c4a)) 792 | ) 793 | 794 | (symbol (lib_id "Transistor_BJT:BC547") (at 146.05 161.29 0) (unit 1) 795 | (in_bom yes) (on_board yes) (fields_autoplaced) 796 | (uuid 4961f55d-d996-4efa-bc30-ea29a3870e2b) 797 | (property "Reference" "T-Green" (id 0) (at 151.13 160.0199 0) 798 | (effects (font (size 1.27 1.27)) (justify left)) 799 | ) 800 | (property "Value" "BC547" (id 1) (at 151.13 162.5599 0) 801 | (effects (font (size 1.27 1.27)) (justify left)) 802 | ) 803 | (property "Footprint" "Package_TO_SOT_THT:TO-92_Inline" (id 2) (at 151.13 163.195 0) 804 | (effects (font (size 1.27 1.27) italic) (justify left) hide) 805 | ) 806 | (property "Datasheet" "https://www.onsemi.com/pub/Collateral/BC550-D.pdf" (id 3) (at 146.05 161.29 0) 807 | (effects (font (size 1.27 1.27)) (justify left) hide) 808 | ) 809 | (pin "1" (uuid c22879d1-9be6-4d7e-b9bd-bcaa87dc934c)) 810 | (pin "2" (uuid 3e93238f-ab34-4f4e-b7d1-2a4c79a75267)) 811 | (pin "3" (uuid 6cfa1301-3e6b-4bf5-81f6-ceb2f86b75f0)) 812 | ) 813 | 814 | (symbol (lib_id "Device:R") (at 82.55 161.29 270) (unit 1) 815 | (in_bom yes) (on_board yes) (fields_autoplaced) 816 | (uuid 637bd5e8-54d4-44c4-b596-a64ee4b483f2) 817 | (property "Reference" "R-B-Amber" (id 0) (at 82.55 154.94 90)) 818 | (property "Value" "47k" (id 1) (at 82.55 157.48 90)) 819 | (property "Footprint" "" (id 2) (at 82.55 159.512 90) 820 | (effects (font (size 1.27 1.27)) hide) 821 | ) 822 | (property "Datasheet" "~" (id 3) (at 82.55 161.29 0) 823 | (effects (font (size 1.27 1.27)) hide) 824 | ) 825 | (pin "1" (uuid 73776338-3986-4adf-ac68-bb5d32d99a10)) 826 | (pin "2" (uuid 90a0f516-d0c5-40a8-a77e-69e3a6b71f7a)) 827 | ) 828 | 829 | (symbol (lib_id "Switch:SW_SPDT") (at 24.13 161.29 0) (mirror y) (unit 1) 830 | (in_bom yes) (on_board yes) (fields_autoplaced) 831 | (uuid 64e805d8-f774-4103-95dc-9d7211031c60) 832 | (property "Reference" "GP26/Pin5" (id 0) (at 24.13 153.67 0)) 833 | (property "Value" "SW_SPDT" (id 1) (at 24.13 156.21 0)) 834 | (property "Footprint" "" (id 2) (at 24.13 161.29 0) 835 | (effects (font (size 1.27 1.27)) hide) 836 | ) 837 | (property "Datasheet" "~" (id 3) (at 24.13 161.29 0) 838 | (effects (font (size 1.27 1.27)) hide) 839 | ) 840 | (pin "1" (uuid 84e10ebe-795a-49e9-bb43-5e09dc784a67)) 841 | (pin "2" (uuid 825327ac-4c75-47d8-8245-648cd57192ec)) 842 | (pin "3" (uuid 8de83d44-c65a-4252-8004-35a1e5d32cb9)) 843 | ) 844 | 845 | (symbol (lib_id "Device:R") (at 185.42 125.73 270) (unit 1) 846 | (in_bom yes) (on_board yes) (fields_autoplaced) 847 | (uuid 74f8d808-b81a-4875-b9c4-cdb1b1309ec9) 848 | (property "Reference" "R-B-White" (id 0) (at 185.42 119.38 90)) 849 | (property "Value" "47k" (id 1) (at 185.42 121.92 90)) 850 | (property "Footprint" "" (id 2) (at 185.42 123.952 90) 851 | (effects (font (size 1.27 1.27)) hide) 852 | ) 853 | (property "Datasheet" "~" (id 3) (at 185.42 125.73 0) 854 | (effects (font (size 1.27 1.27)) hide) 855 | ) 856 | (pin "1" (uuid f85ac415-6ddc-4e16-bbca-3b45c8fadc3f)) 857 | (pin "2" (uuid 2aba2170-9096-45f4-ac44-f1c5f40827f5)) 858 | ) 859 | 860 | (symbol (lib_id "power:GND") (at 148.59 179.07 0) (unit 1) 861 | (in_bom yes) (on_board yes) (fields_autoplaced) 862 | (uuid 7807e466-0a47-4fc0-9148-4fa2e4a32622) 863 | (property "Reference" "#PWR?" (id 0) (at 148.59 185.42 0) 864 | (effects (font (size 1.27 1.27)) hide) 865 | ) 866 | (property "Value" "GND" (id 1) (at 148.59 184.15 0)) 867 | (property "Footprint" "" (id 2) (at 148.59 179.07 0) 868 | (effects (font (size 1.27 1.27)) hide) 869 | ) 870 | (property "Datasheet" "" (id 3) (at 148.59 179.07 0) 871 | (effects (font (size 1.27 1.27)) hide) 872 | ) 873 | (pin "1" (uuid 30b0ad2b-bb4f-4494-a381-7f56cf6e7423)) 874 | ) 875 | 876 | (symbol (lib_id "power:+5V") (at 48.26 143.51 0) (unit 1) 877 | (in_bom yes) (on_board yes) (fields_autoplaced) 878 | (uuid 784e6613-910a-424c-bb87-622bc45a1eba) 879 | (property "Reference" "#PWR?" (id 0) (at 48.26 147.32 0) 880 | (effects (font (size 1.27 1.27)) hide) 881 | ) 882 | (property "Value" "+5V" (id 1) (at 48.26 138.43 0)) 883 | (property "Footprint" "" (id 2) (at 48.26 143.51 0) 884 | (effects (font (size 1.27 1.27)) hide) 885 | ) 886 | (property "Datasheet" "" (id 3) (at 48.26 143.51 0) 887 | (effects (font (size 1.27 1.27)) hide) 888 | ) 889 | (pin "1" (uuid ec5772c6-7cc2-4597-8ff4-1bb3ca4641ee)) 890 | ) 891 | 892 | (symbol (lib_id "power:GND") (at 48.26 179.07 0) (unit 1) 893 | (in_bom yes) (on_board yes) (fields_autoplaced) 894 | (uuid 792cda36-8703-46ff-a2a0-e7ca69a5c860) 895 | (property "Reference" "#PWR?" (id 0) (at 48.26 185.42 0) 896 | (effects (font (size 1.27 1.27)) hide) 897 | ) 898 | (property "Value" "GND" (id 1) (at 48.26 184.15 0)) 899 | (property "Footprint" "" (id 2) (at 48.26 179.07 0) 900 | (effects (font (size 1.27 1.27)) hide) 901 | ) 902 | (property "Datasheet" "" (id 3) (at 48.26 179.07 0) 903 | (effects (font (size 1.27 1.27)) hide) 904 | ) 905 | (pin "1" (uuid 12919007-aeb1-4608-a149-5353ffa2faec)) 906 | ) 907 | 908 | (symbol (lib_id "power:+5V") (at 252.73 107.95 0) (unit 1) 909 | (in_bom yes) (on_board yes) (fields_autoplaced) 910 | (uuid 7c9cf4d6-33ec-4d58-bef4-ca448fbbf52b) 911 | (property "Reference" "#PWR?" (id 0) (at 252.73 111.76 0) 912 | (effects (font (size 1.27 1.27)) hide) 913 | ) 914 | (property "Value" "+5V" (id 1) (at 252.73 102.87 0)) 915 | (property "Footprint" "" (id 2) (at 252.73 107.95 0) 916 | (effects (font (size 1.27 1.27)) hide) 917 | ) 918 | (property "Datasheet" "" (id 3) (at 252.73 107.95 0) 919 | (effects (font (size 1.27 1.27)) hide) 920 | ) 921 | (pin "1" (uuid 91b0bc97-109b-4729-abe5-6f296bd54b62)) 922 | ) 923 | 924 | (symbol (lib_id "Device:LED") (at 148.59 149.86 90) (unit 1) 925 | (in_bom yes) (on_board yes) (fields_autoplaced) 926 | (uuid 7e53766c-187c-4a04-8f90-517156beb262) 927 | (property "Reference" "D3" (id 0) (at 152.4 150.1774 90) 928 | (effects (font (size 1.27 1.27)) (justify right)) 929 | ) 930 | (property "Value" "LED-Green" (id 1) (at 152.4 152.7174 90) 931 | (effects (font (size 1.27 1.27)) (justify right)) 932 | ) 933 | (property "Footprint" "" (id 2) (at 148.59 149.86 0) 934 | (effects (font (size 1.27 1.27)) hide) 935 | ) 936 | (property "Datasheet" "~" (id 3) (at 148.59 149.86 0) 937 | (effects (font (size 1.27 1.27)) hide) 938 | ) 939 | (pin "1" (uuid 72e5afcd-2987-4e98-a702-4aa8b7d80215)) 940 | (pin "2" (uuid 1a2a38ec-48fc-4a31-9470-f52c1ccf4415)) 941 | ) 942 | 943 | (symbol (lib_id "Device:LED") (at 198.12 114.3 90) (unit 1) 944 | (in_bom yes) (on_board yes) (fields_autoplaced) 945 | (uuid 973b2bca-4484-4f54-96d8-68086640aef7) 946 | (property "Reference" "D4" (id 0) (at 201.93 114.6174 90) 947 | (effects (font (size 1.27 1.27)) (justify right)) 948 | ) 949 | (property "Value" "LED-White" (id 1) (at 201.93 117.1574 90) 950 | (effects (font (size 1.27 1.27)) (justify right)) 951 | ) 952 | (property "Footprint" "" (id 2) (at 198.12 114.3 0) 953 | (effects (font (size 1.27 1.27)) hide) 954 | ) 955 | (property "Datasheet" "~" (id 3) (at 198.12 114.3 0) 956 | (effects (font (size 1.27 1.27)) hide) 957 | ) 958 | (pin "1" (uuid 0ae2ecce-0c64-4889-9438-a538e2641f06)) 959 | (pin "2" (uuid a56382e6-1044-4e74-948b-49b5dae18843)) 960 | ) 961 | 962 | (symbol (lib_id "power:GND") (at 198.12 143.51 0) (unit 1) 963 | (in_bom yes) (on_board yes) (fields_autoplaced) 964 | (uuid 9f2210a3-36be-4fc0-8f03-16e5b791cf92) 965 | (property "Reference" "#PWR?" (id 0) (at 198.12 149.86 0) 966 | (effects (font (size 1.27 1.27)) hide) 967 | ) 968 | (property "Value" "GND" (id 1) (at 198.12 148.59 0)) 969 | (property "Footprint" "" (id 2) (at 198.12 143.51 0) 970 | (effects (font (size 1.27 1.27)) hide) 971 | ) 972 | (property "Datasheet" "" (id 3) (at 198.12 143.51 0) 973 | (effects (font (size 1.27 1.27)) hide) 974 | ) 975 | (pin "1" (uuid ed66e40e-04f2-4e23-becb-2ca13b13db78)) 976 | ) 977 | 978 | (symbol (lib_id "Device:LED") (at 95.25 149.86 90) (unit 1) 979 | (in_bom yes) (on_board yes) (fields_autoplaced) 980 | (uuid a5b2c5d5-a12c-479d-b879-6038dd562591) 981 | (property "Reference" "D2" (id 0) (at 99.06 150.1774 90) 982 | (effects (font (size 1.27 1.27)) (justify right)) 983 | ) 984 | (property "Value" "LED-Amber" (id 1) (at 99.06 152.7174 90) 985 | (effects (font (size 1.27 1.27)) (justify right)) 986 | ) 987 | (property "Footprint" "" (id 2) (at 95.25 149.86 0) 988 | (effects (font (size 1.27 1.27)) hide) 989 | ) 990 | (property "Datasheet" "~" (id 3) (at 95.25 149.86 0) 991 | (effects (font (size 1.27 1.27)) hide) 992 | ) 993 | (pin "1" (uuid 2b2a9d46-5cfa-487a-a658-538e018583f1)) 994 | (pin "2" (uuid 1ecd2432-d369-4dfa-948c-890359a25085)) 995 | ) 996 | 997 | (symbol (lib_id "Switch:SW_SPDT") (at 124.46 161.29 0) (mirror y) (unit 1) 998 | (in_bom yes) (on_board yes) (fields_autoplaced) 999 | (uuid aa127a9d-47fa-4497-bcc8-5ed2735c5d25) 1000 | (property "Reference" "GP28/Pin7" (id 0) (at 124.46 153.67 0)) 1001 | (property "Value" "SW_SPDT" (id 1) (at 124.46 156.21 0)) 1002 | (property "Footprint" "" (id 2) (at 124.46 161.29 0) 1003 | (effects (font (size 1.27 1.27)) hide) 1004 | ) 1005 | (property "Datasheet" "~" (id 3) (at 124.46 161.29 0) 1006 | (effects (font (size 1.27 1.27)) hide) 1007 | ) 1008 | (pin "1" (uuid 9ce9278f-3518-49e1-8673-225bb26c9d0b)) 1009 | (pin "2" (uuid 5ea07a90-416f-4344-b26b-9d7805c6b4ca)) 1010 | (pin "3" (uuid b16c63c5-9720-4824-bf58-890e2290deb2)) 1011 | ) 1012 | 1013 | (symbol (lib_id "Device:LED") (at 48.26 149.86 90) (unit 1) 1014 | (in_bom yes) (on_board yes) (fields_autoplaced) 1015 | (uuid b1c1658a-b5eb-4cbd-8b0a-0e4623ded71c) 1016 | (property "Reference" "D1" (id 0) (at 52.07 150.1774 90) 1017 | (effects (font (size 1.27 1.27)) (justify right)) 1018 | ) 1019 | (property "Value" "LED-Red" (id 1) (at 52.07 152.7174 90) 1020 | (effects (font (size 1.27 1.27)) (justify right)) 1021 | ) 1022 | (property "Footprint" "" (id 2) (at 48.26 149.86 0) 1023 | (effects (font (size 1.27 1.27)) hide) 1024 | ) 1025 | (property "Datasheet" "~" (id 3) (at 48.26 149.86 0) 1026 | (effects (font (size 1.27 1.27)) hide) 1027 | ) 1028 | (pin "1" (uuid dd718582-fe3d-466c-b539-4fd2ee4cec5b)) 1029 | (pin "2" (uuid 816f2134-debb-4a16-a562-2231dc5c7a98)) 1030 | ) 1031 | 1032 | (symbol (lib_id "Switch:SW_SPDT") (at 173.99 125.73 0) (mirror y) (unit 1) 1033 | (in_bom yes) (on_board yes) (fields_autoplaced) 1034 | (uuid bc71ca1c-025b-4f5c-9948-bfdddf9d8f3f) 1035 | (property "Reference" "GP29/Pin8" (id 0) (at 173.99 118.11 0)) 1036 | (property "Value" "SW_SPDT" (id 1) (at 173.99 120.65 0)) 1037 | (property "Footprint" "" (id 2) (at 173.99 125.73 0) 1038 | (effects (font (size 1.27 1.27)) hide) 1039 | ) 1040 | (property "Datasheet" "~" (id 3) (at 173.99 125.73 0) 1041 | (effects (font (size 1.27 1.27)) hide) 1042 | ) 1043 | (pin "1" (uuid 7355404f-44e9-42d5-b87f-bf00bc2e0bf9)) 1044 | (pin "2" (uuid 509a756a-633e-416e-a5a5-87fb98076f4f)) 1045 | (pin "3" (uuid ae9b6166-bdd0-47e6-9a92-8c1cf6b06dfa)) 1046 | ) 1047 | 1048 | (symbol (lib_id "Device:R") (at 95.25 172.72 180) (unit 1) 1049 | (in_bom yes) (on_board yes) (fields_autoplaced) 1050 | (uuid bdfc7309-87b1-4985-a1d4-e213a0f9eb89) 1051 | (property "Reference" "R-E-Amber" (id 0) (at 97.79 171.4499 0) 1052 | (effects (font (size 1.27 1.27)) (justify right)) 1053 | ) 1054 | (property "Value" "680" (id 1) (at 97.79 173.9899 0) 1055 | (effects (font (size 1.27 1.27)) (justify right)) 1056 | ) 1057 | (property "Footprint" "" (id 2) (at 97.028 172.72 90) 1058 | (effects (font (size 1.27 1.27)) hide) 1059 | ) 1060 | (property "Datasheet" "~" (id 3) (at 95.25 172.72 0) 1061 | (effects (font (size 1.27 1.27)) hide) 1062 | ) 1063 | (pin "1" (uuid 638cf6a0-58dd-4a3c-abec-368f8bf96636)) 1064 | (pin "2" (uuid c18f2f9c-4843-4549-aab5-e58c547e033f)) 1065 | ) 1066 | 1067 | (symbol (lib_id "Transistor_BJT:BC547") (at 92.71 161.29 0) (unit 1) 1068 | (in_bom yes) (on_board yes) (fields_autoplaced) 1069 | (uuid cb1d8c3a-57b8-48d2-bcb8-84c5de20d781) 1070 | (property "Reference" "T-Amber" (id 0) (at 97.79 160.0199 0) 1071 | (effects (font (size 1.27 1.27)) (justify left)) 1072 | ) 1073 | (property "Value" "BC547" (id 1) (at 97.79 162.5599 0) 1074 | (effects (font (size 1.27 1.27)) (justify left)) 1075 | ) 1076 | (property "Footprint" "Package_TO_SOT_THT:TO-92_Inline" (id 2) (at 97.79 163.195 0) 1077 | (effects (font (size 1.27 1.27) italic) (justify left) hide) 1078 | ) 1079 | (property "Datasheet" "https://www.onsemi.com/pub/Collateral/BC550-D.pdf" (id 3) (at 92.71 161.29 0) 1080 | (effects (font (size 1.27 1.27)) (justify left) hide) 1081 | ) 1082 | (pin "1" (uuid e7ebda85-bda6-4704-8169-99c8f5825e47)) 1083 | (pin "2" (uuid eb845c31-ccb1-4649-8adf-841672f75a1e)) 1084 | (pin "3" (uuid c414b045-c101-406b-82b5-a428010643a4)) 1085 | ) 1086 | 1087 | (symbol (lib_id "Device:R") (at 35.56 161.29 270) (unit 1) 1088 | (in_bom yes) (on_board yes) (fields_autoplaced) 1089 | (uuid cd523488-860f-4958-baa7-089c4f1ed37a) 1090 | (property "Reference" "R-B-Red" (id 0) (at 35.56 154.94 90)) 1091 | (property "Value" "47k" (id 1) (at 35.56 157.48 90)) 1092 | (property "Footprint" "" (id 2) (at 35.56 159.512 90) 1093 | (effects (font (size 1.27 1.27)) hide) 1094 | ) 1095 | (property "Datasheet" "~" (id 3) (at 35.56 161.29 0) 1096 | (effects (font (size 1.27 1.27)) hide) 1097 | ) 1098 | (pin "1" (uuid 6bf3b3a2-3f4b-4e30-8e07-5a7389336f9a)) 1099 | (pin "2" (uuid 3279f5fa-f64b-4a36-b738-9decaba8a1fb)) 1100 | ) 1101 | 1102 | (symbol (lib_id "power:+5V") (at 198.12 107.95 0) (unit 1) 1103 | (in_bom yes) (on_board yes) (fields_autoplaced) 1104 | (uuid d0fb6b4b-3dc9-4dbd-afa9-e98af1a12bc4) 1105 | (property "Reference" "#PWR?" (id 0) (at 198.12 111.76 0) 1106 | (effects (font (size 1.27 1.27)) hide) 1107 | ) 1108 | (property "Value" "+5V" (id 1) (at 198.12 102.87 0)) 1109 | (property "Footprint" "" (id 2) (at 198.12 107.95 0) 1110 | (effects (font (size 1.27 1.27)) hide) 1111 | ) 1112 | (property "Datasheet" "" (id 3) (at 198.12 107.95 0) 1113 | (effects (font (size 1.27 1.27)) hide) 1114 | ) 1115 | (pin "1" (uuid aaf4c2fc-0e42-4999-8b61-326a57678262)) 1116 | ) 1117 | 1118 | (symbol (lib_id "Device:R") (at 252.73 137.16 180) (unit 1) 1119 | (in_bom yes) (on_board yes) (fields_autoplaced) 1120 | (uuid da76e9e5-6160-4bec-ba32-92f0d30cd9d4) 1121 | (property "Reference" "R-E-Blue" (id 0) (at 255.27 135.8899 0) 1122 | (effects (font (size 1.27 1.27)) (justify right)) 1123 | ) 1124 | (property "Value" "680" (id 1) (at 255.27 138.4299 0) 1125 | (effects (font (size 1.27 1.27)) (justify right)) 1126 | ) 1127 | (property "Footprint" "" (id 2) (at 254.508 137.16 90) 1128 | (effects (font (size 1.27 1.27)) hide) 1129 | ) 1130 | (property "Datasheet" "~" (id 3) (at 252.73 137.16 0) 1131 | (effects (font (size 1.27 1.27)) hide) 1132 | ) 1133 | (pin "1" (uuid 41a669c8-d12e-4cec-96a6-72c863a922cc)) 1134 | (pin "2" (uuid fc9d6365-a0b2-4d83-beb7-408c94111231)) 1135 | ) 1136 | 1137 | (symbol (lib_id "Device:R") (at 135.89 161.29 270) (unit 1) 1138 | (in_bom yes) (on_board yes) (fields_autoplaced) 1139 | (uuid e9a2010d-8c5c-429d-8248-a0a659bd00ea) 1140 | (property "Reference" "R-B-Green" (id 0) (at 135.89 154.94 90)) 1141 | (property "Value" "47k" (id 1) (at 135.89 157.48 90)) 1142 | (property "Footprint" "" (id 2) (at 135.89 159.512 90) 1143 | (effects (font (size 1.27 1.27)) hide) 1144 | ) 1145 | (property "Datasheet" "~" (id 3) (at 135.89 161.29 0) 1146 | (effects (font (size 1.27 1.27)) hide) 1147 | ) 1148 | (pin "1" (uuid 6be2fdc1-4344-40e7-9e12-ec1bd4bd7b76)) 1149 | (pin "2" (uuid ff1a1cdc-8fd0-459c-b7d1-ddc8c0278e6f)) 1150 | ) 1151 | 1152 | (symbol (lib_id "Switch:SW_SPDT") (at 71.12 161.29 0) (mirror y) (unit 1) 1153 | (in_bom yes) (on_board yes) (fields_autoplaced) 1154 | (uuid ec396478-0c4c-4cc5-9b61-a7f996e81837) 1155 | (property "Reference" "GP27/Pin6" (id 0) (at 71.12 153.67 0)) 1156 | (property "Value" "SW_SPDT" (id 1) (at 71.12 156.21 0)) 1157 | (property "Footprint" "" (id 2) (at 71.12 161.29 0) 1158 | (effects (font (size 1.27 1.27)) hide) 1159 | ) 1160 | (property "Datasheet" "~" (id 3) (at 71.12 161.29 0) 1161 | (effects (font (size 1.27 1.27)) hide) 1162 | ) 1163 | (pin "1" (uuid 3f2d03fa-1c62-411c-9c67-0af2e6331dce)) 1164 | (pin "2" (uuid 2ce50e0f-86b7-46d4-96ab-89658534d5c1)) 1165 | (pin "3" (uuid 2edd0447-127e-4ad1-aa98-4844d1022bcf)) 1166 | ) 1167 | 1168 | (symbol (lib_id "Device:LED") (at 252.73 114.3 90) (unit 1) 1169 | (in_bom yes) (on_board yes) (fields_autoplaced) 1170 | (uuid f452636a-d2d6-4c3b-9d5f-d29722b2274c) 1171 | (property "Reference" "D5" (id 0) (at 256.54 114.6174 90) 1172 | (effects (font (size 1.27 1.27)) (justify right)) 1173 | ) 1174 | (property "Value" "LED-Blue" (id 1) (at 256.54 117.1574 90) 1175 | (effects (font (size 1.27 1.27)) (justify right)) 1176 | ) 1177 | (property "Footprint" "" (id 2) (at 252.73 114.3 0) 1178 | (effects (font (size 1.27 1.27)) hide) 1179 | ) 1180 | (property "Datasheet" "~" (id 3) (at 252.73 114.3 0) 1181 | (effects (font (size 1.27 1.27)) hide) 1182 | ) 1183 | (pin "1" (uuid abf9491b-856d-4248-9bed-aaa3c3357cd8)) 1184 | (pin "2" (uuid 52c5da8f-ed2a-4e78-8e33-2334b90b768a)) 1185 | ) 1186 | 1187 | (symbol (lib_id "Transistor_BJT:BC547") (at 250.19 125.73 0) (unit 1) 1188 | (in_bom yes) (on_board yes) (fields_autoplaced) 1189 | (uuid ff5aa58d-37fd-4f4e-a745-fbe0df67f633) 1190 | (property "Reference" "T-Blue" (id 0) (at 255.27 124.4599 0) 1191 | (effects (font (size 1.27 1.27)) (justify left)) 1192 | ) 1193 | (property "Value" "BC547" (id 1) (at 255.27 126.9999 0) 1194 | (effects (font (size 1.27 1.27)) (justify left)) 1195 | ) 1196 | (property "Footprint" "Package_TO_SOT_THT:TO-92_Inline" (id 2) (at 255.27 127.635 0) 1197 | (effects (font (size 1.27 1.27) italic) (justify left) hide) 1198 | ) 1199 | (property "Datasheet" "https://www.onsemi.com/pub/Collateral/BC550-D.pdf" (id 3) (at 250.19 125.73 0) 1200 | (effects (font (size 1.27 1.27)) (justify left) hide) 1201 | ) 1202 | (pin "1" (uuid 8f75fc96-664a-480c-9bc1-576f1a09bccd)) 1203 | (pin "2" (uuid 69d8ad91-aee0-4ec3-8e37-27e4ccc49171)) 1204 | (pin "3" (uuid babbfa27-fdbf-474d-923d-38077339206b)) 1205 | ) 1206 | 1207 | (sheet_instances 1208 | (path "/" (page "1")) 1209 | ) 1210 | 1211 | (symbol_instances 1212 | (path "/1924296e-b984-4fba-96ec-15010e0097d0" 1213 | (reference "#PWR?") (unit 1) (value "+5V") (footprint "") 1214 | ) 1215 | (path "/256e54e0-345f-4bc5-b72b-c1b71716501b" 1216 | (reference "#PWR?") (unit 1) (value "GND") (footprint "") 1217 | ) 1218 | (path "/2d545f9f-e304-433d-8d63-6a014edd384d" 1219 | (reference "#PWR?") (unit 1) (value "GND") (footprint "") 1220 | ) 1221 | (path "/31eff2f0-0ff7-46bb-a45d-34512c906685" 1222 | (reference "#PWR?") (unit 1) (value "+5V") (footprint "") 1223 | ) 1224 | (path "/7807e466-0a47-4fc0-9148-4fa2e4a32622" 1225 | (reference "#PWR?") (unit 1) (value "GND") (footprint "") 1226 | ) 1227 | (path "/784e6613-910a-424c-bb87-622bc45a1eba" 1228 | (reference "#PWR?") (unit 1) (value "+5V") (footprint "") 1229 | ) 1230 | (path "/792cda36-8703-46ff-a2a0-e7ca69a5c860" 1231 | (reference "#PWR?") (unit 1) (value "GND") (footprint "") 1232 | ) 1233 | (path "/7c9cf4d6-33ec-4d58-bef4-ca448fbbf52b" 1234 | (reference "#PWR?") (unit 1) (value "+5V") (footprint "") 1235 | ) 1236 | (path "/9f2210a3-36be-4fc0-8f03-16e5b791cf92" 1237 | (reference "#PWR?") (unit 1) (value "GND") (footprint "") 1238 | ) 1239 | (path "/d0fb6b4b-3dc9-4dbd-afa9-e98af1a12bc4" 1240 | (reference "#PWR?") (unit 1) (value "+5V") (footprint "") 1241 | ) 1242 | (path "/b1c1658a-b5eb-4cbd-8b0a-0e4623ded71c" 1243 | (reference "D1") (unit 1) (value "LED-Red") (footprint "") 1244 | ) 1245 | (path "/a5b2c5d5-a12c-479d-b879-6038dd562591" 1246 | (reference "D2") (unit 1) (value "LED-Amber") (footprint "") 1247 | ) 1248 | (path "/7e53766c-187c-4a04-8f90-517156beb262" 1249 | (reference "D3") (unit 1) (value "LED-Green") (footprint "") 1250 | ) 1251 | (path "/973b2bca-4484-4f54-96d8-68086640aef7" 1252 | (reference "D4") (unit 1) (value "LED-White") (footprint "") 1253 | ) 1254 | (path "/f452636a-d2d6-4c3b-9d5f-d29722b2274c" 1255 | (reference "D5") (unit 1) (value "LED-Blue") (footprint "") 1256 | ) 1257 | (path "/15abdd5f-173f-4111-86bd-1471f195e4bd" 1258 | (reference "GP24/Pin9") (unit 1) (value "SW_SPDT") (footprint "") 1259 | ) 1260 | (path "/64e805d8-f774-4103-95dc-9d7211031c60" 1261 | (reference "GP26/Pin5") (unit 1) (value "SW_SPDT") (footprint "") 1262 | ) 1263 | (path "/ec396478-0c4c-4cc5-9b61-a7f996e81837" 1264 | (reference "GP27/Pin6") (unit 1) (value "SW_SPDT") (footprint "") 1265 | ) 1266 | (path "/aa127a9d-47fa-4497-bcc8-5ed2735c5d25" 1267 | (reference "GP28/Pin7") (unit 1) (value "SW_SPDT") (footprint "") 1268 | ) 1269 | (path "/bc71ca1c-025b-4f5c-9948-bfdddf9d8f3f" 1270 | (reference "GP29/Pin8") (unit 1) (value "SW_SPDT") (footprint "") 1271 | ) 1272 | (path "/637bd5e8-54d4-44c4-b596-a64ee4b483f2" 1273 | (reference "R-B-Amber") (unit 1) (value "47k") (footprint "") 1274 | ) 1275 | (path "/0f336111-afdf-4b4f-b1aa-17d1545ba5df" 1276 | (reference "R-B-Blue") (unit 1) (value "47k") (footprint "") 1277 | ) 1278 | (path "/e9a2010d-8c5c-429d-8248-a0a659bd00ea" 1279 | (reference "R-B-Green") (unit 1) (value "47k") (footprint "") 1280 | ) 1281 | (path "/cd523488-860f-4958-baa7-089c4f1ed37a" 1282 | (reference "R-B-Red") (unit 1) (value "47k") (footprint "") 1283 | ) 1284 | (path "/74f8d808-b81a-4875-b9c4-cdb1b1309ec9" 1285 | (reference "R-B-White") (unit 1) (value "47k") (footprint "") 1286 | ) 1287 | (path "/bdfc7309-87b1-4985-a1d4-e213a0f9eb89" 1288 | (reference "R-E-Amber") (unit 1) (value "680") (footprint "") 1289 | ) 1290 | (path "/da76e9e5-6160-4bec-ba32-92f0d30cd9d4" 1291 | (reference "R-E-Blue") (unit 1) (value "680") (footprint "") 1292 | ) 1293 | (path "/237ed4e7-9e4b-44ae-b898-1a45e0234f0d" 1294 | (reference "R-E-Green") (unit 1) (value "680") (footprint "") 1295 | ) 1296 | (path "/2c460627-3821-49f7-9468-7ae3b6ed0c7c" 1297 | (reference "R-E-Red") (unit 1) (value "680") (footprint "") 1298 | ) 1299 | (path "/26fc542c-36a0-4549-ade2-a2b76b37b53f" 1300 | (reference "R-E-White") (unit 1) (value "680") (footprint "") 1301 | ) 1302 | (path "/cb1d8c3a-57b8-48d2-bcb8-84c5de20d781" 1303 | (reference "T-Amber") (unit 1) (value "BC547") (footprint "Package_TO_SOT_THT:TO-92_Inline") 1304 | ) 1305 | (path "/ff5aa58d-37fd-4f4e-a745-fbe0df67f633" 1306 | (reference "T-Blue") (unit 1) (value "BC547") (footprint "Package_TO_SOT_THT:TO-92_Inline") 1307 | ) 1308 | (path "/4961f55d-d996-4efa-bc30-ea29a3870e2b" 1309 | (reference "T-Green") (unit 1) (value "BC547") (footprint "Package_TO_SOT_THT:TO-92_Inline") 1310 | ) 1311 | (path "/232ccf4f-3322-4e62-990b-290e6ff36fcd" 1312 | (reference "T-Red") (unit 1) (value "BC547") (footprint "Package_TO_SOT_THT:TO-92_Inline") 1313 | ) 1314 | (path "/34d66f95-94ed-4979-83df-962a806e9a20" 1315 | (reference "T-White") (unit 1) (value "BC547") (footprint "Package_TO_SOT_THT:TO-92_Inline") 1316 | ) 1317 | ) 1318 | ) 1319 | -------------------------------------------------------------------------------- /IMG_1243.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hgrodriguez/embedded-dashboard-console/af6ac23984ede09cd8505f101e8625b6aca3742b/IMG_1243.jpg -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2021, Holger Rodriguez 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | 3. Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # embedded-dashboard-console 2 | Implementation of an embedded dashboard console offering status views using LEDs, 5x7 matrix and OLED 3 | 4 | The project uses the alr environment to manage all outside dependencies. 5 | 6 | ![Embedded Board](https://github.com/hgrodriguez/embedded-dashboard-console/blob/main/IMG_1243.jpg "Example of using the board") 7 | 8 | ## Overall idea 9 | This project offers an embedded dashabord, which can display: 10 | 1. LEDs with different colors, e.g. Red/Amber/Green/White/Blue, commanded by Off, On, Toggle 11 | 1. 5x7 Matrix displays, where 12 | * one can display two independent Byte values or 16-bit Word value 13 | * the other can display four independent Byte, two independent 16-bit Word or one 32-bit DWord value 14 | 1. OLED display: details tbd. 15 | 16 | ## Input capabilities 17 | Planned are the following input capabilities: 18 | 1. UART 19 | 1. SPI - Slave 20 | 1. I2C - Slave (not sure how to implement this, as there is no Ada code available how to do this) 21 | 22 | ## Versioning scheme 23 | Major.Minor.Patch 24 | 25 | ### Major 26 | 1 = UART; Status: **implemented** 27 | 28 | 2 = UART + SPI 29 | 30 | 3 = UART + SPI + I2C 31 | 32 | ### Minor 33 | 1 = LEDs 34 | 35 | 2 = LEDs + Matrix 16-bit Word HEX display; Status: **implemented** 36 | 37 | 3 = LEDs + Matrix 16-bit Word HEX Display + Matrix 32-bit DWord HEX Display; Status: **implemented** 38 | 39 | 4 = LEDs + Matrix 16-bit Word HEX Display + Matrix 32-bit DWord HEX Display + Character Display 40 | 41 | 5 = LEDs + Matrix 16-bit Word HEX Display + Matrix 32-bit DWord HEX Display + Character Display + Horizontal Scrolling Character Display 42 | 43 | 6 = OLED 44 | -------------------------------------------------------------------------------- /alire.toml: -------------------------------------------------------------------------------- 1 | name = "edc" 2 | description = "Shiny new project" 3 | version = "0.0.0" 4 | 5 | authors = ["Holger Rodriguez"] 6 | maintainers = ["Holger Rodriguez "] 7 | maintainers-logins = ["hgrodriguez"] 8 | 9 | executables = ["edc"] 10 | [[depends-on]] # Added by alr 11 | pico_bsp = "~0.6.0" # Added by alr 12 | -------------------------------------------------------------------------------- /edc.gpr: -------------------------------------------------------------------------------- 1 | with "config/edc_config.gpr"; 2 | with "pico_bsp.gpr"; 3 | 4 | project Edc is 5 | 6 | for Runtime ("Ada") use "zfp-cortex-m0p"; 7 | for Target use "arm-eabi"; 8 | 9 | for Source_Dirs use ("src"); 10 | for Object_Dir use "obj"; 11 | for Library_Dir use "lib"; 12 | for Library_Ali_Dir use "ali"; 13 | for Create_Missing_Dirs use "True"; 14 | for Exec_Dir use "bin"; 15 | for Main use ("edc.adb"); 16 | 17 | type Enabled_Kind is ("enabled", "disabled"); 18 | Compile_Checks : Enabled_Kind := External ("EDC_COMPILE_CHECKS", "enabled"); 19 | Runtime_Checks : Enabled_Kind := External ("EDC_RUNTIME_CHECKS", "enabled"); 20 | Style_Checks : Enabled_Kind := External ("EDC_STYLE_CHECKS", "enabled"); 21 | Contracts_Checks : Enabled_Kind := External ("EDC_CONTRACTS", "enabled"); 22 | 23 | type Build_Kind is ("debug", "optimize"); 24 | Build_Mode : Build_Kind := External ("EDC_BUILD_MODE", "debug"); 25 | 26 | Compile_Checks_Switches := (); 27 | case Compile_Checks is 28 | when "enabled" => 29 | Compile_Checks_Switches := 30 | ("-gnatwa", -- All warnings 31 | "-gnatVa", -- All validity checks 32 | -- "-gnatl", -- show lines surrounding error 33 | "-gnatwe"); -- Warnings as errors 34 | when others => null; 35 | end case; 36 | 37 | Runtime_Checks_Switches := (); 38 | case Runtime_Checks is 39 | when "enabled" => null; 40 | when others => 41 | Runtime_Checks_Switches := 42 | ("-gnatp"); -- Supress checks 43 | end case; 44 | 45 | Style_Checks_Switches := (); 46 | case Style_Checks is 47 | when "enabled" => 48 | Style_Checks_Switches := 49 | ("-gnatyg", -- GNAT Style checks 50 | "-gnaty-d", -- Disable no DOS line terminators 51 | "-gnatyM80", -- Maximum line length 52 | "-gnatyO"); -- Overriding subprograms explicitly marked as such 53 | when others => null; 54 | end case; 55 | 56 | Contracts_Switches := (); 57 | case Contracts_Checks is 58 | when "enabled" => 59 | Contracts_Switches := 60 | ("-gnata"); -- Enable assertions and contracts 61 | when others => null; 62 | end case; 63 | 64 | Build_Switches := (); 65 | case Build_Mode is 66 | when "optimize" => 67 | Build_Switches := ("-O3", -- Optimization 68 | "-gnatn"); -- Enable inlining 69 | when "debug" => 70 | Build_Switches := ("-g", -- Debug info 71 | "-Og"); -- No optimization 72 | end case; 73 | 74 | package Compiler is 75 | for Default_Switches ("Ada") use 76 | Compile_Checks_Switches & 77 | Build_Switches & 78 | Runtime_Checks_Switches & 79 | Style_Checks_Switches & 80 | Contracts_Switches & 81 | ("-gnatw.X", -- Disable warnings for No_Exception_Propagation 82 | "-gnatwae", -- All warnings 83 | "-gnatwl", -- Elaboration warnings 84 | "-gnatVa", -- Validity checks 85 | "-gnatw.X", -- Hide No_Exception_Propagation warnings 86 | "-gnatwB", -- Hide Warn_On_Bad_Fixed_Value 87 | "-fstack-usage", -- Output stack usage information 88 | "-ffunction-sections", 89 | "-fdata-sections", 90 | "-gnatQ"); -- Don't quit. Generate ALI and tree files even if illegalities 91 | for Local_Configuration_Pragmas use "gnat.adc"; 92 | end Compiler; 93 | 94 | package Binder is 95 | for Switches ("Ada") use ("-Es"); -- Symbolic traceback 96 | end Binder; 97 | 98 | package Linker is 99 | for Default_Switches ("Ada") use 100 | Pico_BSP.Linker_Switches & ( 101 | "-Wl,-gc-sections", 102 | "-Wl,-print-memory-usage", 103 | "-Wl,-Map=main.map" 104 | ); 105 | end Linker; 106 | 107 | end Edc; 108 | -------------------------------------------------------------------------------- /gnat.adc: -------------------------------------------------------------------------------- 1 | pragma Warnings (On); 2 | -- see: https://www.cs.fsu.edu/~baker/ada/gnat/html/gnat_ugn_4.html#SEC48 3 | pragma Style_Checks (ALL_CHECKS); -- switch it on 4 | pragma Style_Checks ("g-d"); -- switch it on: -d makes Windows happy 5 | pragma Style_Checks ("m"); -- max line length is 79 6 | pragma Style_Checks ("O"); -- Overriding subprograms must be explicitly marked 7 | pragma Style_Checks ("t"); -- Check token spacing 8 | pragma Style_Checks ("x"); -- Check extra parantheses 9 | -------------------------------------------------------------------------------- /src/edc.adb: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This application provides an embedded dashboard controller offering: 4 | -- - UART Interface 5 | -- - LED Area 6 | -- - 5x7 Matrix Display with two displays as one logical unit 7 | -- 8 | --=========================================================================== 9 | -- 10 | -- Copyright 2021 (C) Holger Rodriguez 11 | -- 12 | -- SPDX-License-Identifier: BSD-3-Clause 13 | -- 14 | with RP.Device; 15 | 16 | with ItsyBitsy; 17 | 18 | with Initializer; 19 | 20 | with Transport.Serial; 21 | 22 | with Evaluate.LEDs; 23 | with Evaluate.Matrices; 24 | 25 | with Execute; 26 | with Execute.LEDs; 27 | with Execute.Matrices; 28 | 29 | procedure Edc is 30 | 31 | -------------------------------------------------------------------------- 32 | -- Processes a request for the LED area 33 | -- * gets the serial command request 34 | -- * checks the input for correctness 35 | -- * if OK, then executes the command given 36 | -------------------------------------------------------------------------- 37 | procedure Process_LED (Instruction : Evaluate.LEDs.LED_Instruction); 38 | procedure Process_LED (Instruction : Evaluate.LEDs.LED_Instruction) is 39 | Error : Execute.LED_Errors; 40 | Action : Execute.LED_Actions; 41 | begin 42 | Error := Evaluate.LEDs.Check_Input (Instruction); 43 | case Error is 44 | when Execute.OK => 45 | ItsyBitsy.LED.Clear; 46 | Action := Evaluate.LEDs.Evaluate (Instruction); 47 | Execute.LEDs.Execute (Action); 48 | when others => 49 | ItsyBitsy.LED.Set; 50 | end case; 51 | end Process_LED; 52 | 53 | -------------------------------------------------------------------------- 54 | -- Processes a request for the Matrix area 55 | -- * gets the serial command request 56 | -- * checks the input for correctness 57 | -- * if OK, then executes the command given 58 | -------------------------------------------------------------------------- 59 | procedure Process_Matrix (Instruction 60 | : Evaluate.Matrices.Matrix_Instruction); 61 | procedure Process_Matrix (Instruction 62 | : Evaluate.Matrices.Matrix_Instruction) is 63 | Error : Execute.Matrix_Errors; 64 | Action : Execute.Matrix_Command; 65 | use Execute; 66 | begin 67 | Error := Evaluate.Matrices.Check_Input (Instruction); 68 | case Error is 69 | when Execute.M_OK => 70 | ItsyBitsy.LED.Clear; 71 | Action := Evaluate.Matrices.Evaluate (Instruction => Instruction); 72 | Execute.Matrices.Execute (Action); 73 | when others => 74 | ItsyBitsy.LED.Set; 75 | end case; 76 | end Process_Matrix; 77 | 78 | procedure Show_Patterns_After_Reset; 79 | procedure Show_Patterns_After_Reset is 80 | Word_Pattern_0000 : constant Execute.Matrix_Command 81 | := (Block => Execute.Block_0, 82 | Command => Execute.Word_0, 83 | Value => "00000000" 84 | ); 85 | Word_Pattern_000F : constant Execute.Matrix_Command 86 | := (Block => Execute.Block_0, 87 | Command => Execute.Word_0, 88 | Value => "000F0000" 89 | ); 90 | Word_Pattern_00F0 : constant Execute.Matrix_Command 91 | := (Block => Execute.Block_0, 92 | Command => Execute.Word_0, 93 | Value => "00F00000" 94 | ); 95 | Word_Pattern_0F00 : constant Execute.Matrix_Command 96 | := (Block => Execute.Block_0, 97 | Command => Execute.Word_0, 98 | Value => "0F000000" 99 | ); 100 | Word_Pattern_F000 : constant Execute.Matrix_Command 101 | := (Block => Execute.Block_0, 102 | Command => Execute.Word_0, 103 | Value => "F0000000" 104 | ); 105 | Word_Pattern_FFFF : constant Execute.Matrix_Command 106 | := (Block => Execute.Block_0, 107 | Command => Execute.Word_0, 108 | Value => "FFFF0000" 109 | ); 110 | 111 | Double_Word_Pattern_00000000 : constant Execute.Matrix_Command 112 | := (Block => Execute.Block_1, 113 | Command => Execute.Double_Word_0, 114 | Value => "00000000" 115 | ); 116 | Double_Word_Pattern_0000000F : constant Execute.Matrix_Command 117 | := (Block => Execute.Block_1, 118 | Command => Execute.Double_Word_0, 119 | Value => "0000000F" 120 | ); 121 | Double_Word_Pattern_000000F0 : constant Execute.Matrix_Command 122 | := (Block => Execute.Block_1, 123 | Command => Execute.Double_Word_0, 124 | Value => "000000F0" 125 | ); 126 | Double_Word_Pattern_00000F00 : constant Execute.Matrix_Command 127 | := (Block => Execute.Block_1, 128 | Command => Execute.Double_Word_0, 129 | Value => "00000F00" 130 | ); 131 | Double_Word_Pattern_0000F000 : constant Execute.Matrix_Command 132 | := (Block => Execute.Block_1, 133 | Command => Execute.Double_Word_0, 134 | Value => "0000F000" 135 | ); 136 | Double_Word_Pattern_000F0000 : constant Execute.Matrix_Command 137 | := (Block => Execute.Block_1, 138 | Command => Execute.Double_Word_0, 139 | Value => "000F0000" 140 | ); 141 | Double_Word_Pattern_00F00000 : constant Execute.Matrix_Command 142 | := (Block => Execute.Block_1, 143 | Command => Execute.Double_Word_0, 144 | Value => "00F00000" 145 | ); 146 | Double_Word_Pattern_0F000000 : constant Execute.Matrix_Command 147 | := (Block => Execute.Block_1, 148 | Command => Execute.Double_Word_0, 149 | Value => "0F000000" 150 | ); 151 | Double_Word_Pattern_F0000000 : constant Execute.Matrix_Command 152 | := (Block => Execute.Block_1, 153 | Command => Execute.Double_Word_0, 154 | Value => "F0000000" 155 | ); 156 | 157 | TIME_BETWEEN_PATTERN : constant Integer := 100; 158 | begin 159 | ----------------------------------------------------------------------- 160 | -- Pattern with LEDs ON 161 | Execute.LEDs.Execute (Cmd => Execute.Red_On); 162 | Execute.LEDs.Execute (Cmd => Execute.Amber_On); 163 | Execute.LEDs.Execute (Cmd => Execute.Green_On); 164 | Execute.LEDs.Execute (Cmd => Execute.White_On); 165 | Execute.LEDs.Execute (Cmd => Execute.Blue_On); 166 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 167 | 168 | ----------------------------------------------------------------------- 169 | -- Pattern with Matrix Word 170 | Execute.Matrices.Execute (Cmd => Word_Pattern_0000); 171 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 172 | Execute.Matrices.Execute (Cmd => Word_Pattern_000F); 173 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 174 | Execute.Matrices.Execute (Cmd => Word_Pattern_00F0); 175 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 176 | Execute.Matrices.Execute (Cmd => Word_Pattern_0F00); 177 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 178 | Execute.Matrices.Execute (Cmd => Word_Pattern_F000); 179 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 180 | 181 | ----------------------------------------------------------------------- 182 | -- Pattern with Matrix Double Word 183 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00000000); 184 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 185 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_0000000F); 186 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 187 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_000000F0); 188 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 189 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00000F00); 190 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 191 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_0000F000); 192 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 193 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_000F0000); 194 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 195 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00F00000); 196 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 197 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_0F000000); 198 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 199 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_F0000000); 200 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 201 | 202 | ----------------------------------------------------------------------- 203 | -- Pattern with Matrix Word 204 | Execute.Matrices.Execute (Cmd => Word_Pattern_0000); 205 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 206 | 207 | ----------------------------------------------------------------------- 208 | -- Pattern with Matrix Double Word 209 | Execute.Matrices.Execute (Cmd => Double_Word_Pattern_00000000); 210 | RP.Device.Timer.Delay_Milliseconds (TIME_BETWEEN_PATTERN); 211 | 212 | ----------------------------------------------------------------------- 213 | -- Pattern with LEDs OFF 214 | Execute.LEDs.Execute (Cmd => Execute.Red_Off); 215 | Execute.LEDs.Execute (Cmd => Execute.Amber_Off); 216 | Execute.LEDs.Execute (Cmd => Execute.Green_Off); 217 | Execute.LEDs.Execute (Cmd => Execute.White_Off); 218 | Execute.LEDs.Execute (Cmd => Execute.Blue_Off); 219 | 220 | end Show_Patterns_After_Reset; 221 | 222 | Area_Selector : Transport.Area_Selector; 223 | LED_Instruction : Evaluate.LEDs.LED_Instruction; 224 | Matrix_Instruction : Evaluate.Matrices.Matrix_Instruction; 225 | 226 | begin 227 | Initializer.Initialize_All; 228 | 229 | Show_Patterns_After_Reset; 230 | 231 | loop 232 | -- Check for Serial Channel input 233 | Area_Selector := Transport.Serial.Get_Area_Selector; 234 | case Area_Selector is 235 | when Transport.Led => 236 | -- something arrived on serial, handle it 237 | LED_Instruction := Transport.Serial.Get_LED_Instruction; 238 | Process_LED (LED_Instruction); 239 | when Transport.Matrix => 240 | -- something arrived on serial, handle it 241 | Matrix_Instruction := Transport.Serial.Get_Matrix_Instruction; 242 | Process_Matrix (Matrix_Instruction); 243 | when Transport.None => 244 | null; 245 | end case; 246 | end loop; 247 | 248 | end Edc; 249 | 250 | --=========================================================================== 251 | -- 252 | -- MAJOR TITLE HERE 253 | -- 254 | --=========================================================================== 255 | 256 | -------------------------------------------------------------------------- 257 | -- Minor Title Here 258 | -------------------------------------------------------------------------- 259 | 260 | --------------------- 261 | -- Subsection Header 262 | --------------------- 263 | -------------------------------------------------------------------------------- /src/evaluate-leds.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Holger Rodriguez 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | package body Evaluate.LEDs is 7 | 8 | -------------------------------------------------------------------------- 9 | -- Check functions for the input received 10 | -- Those functions set the global variables to the received value 11 | -------------------------------------------------------------------------- 12 | function Check_Block (Block_Char : Character) return Boolean; 13 | function Check_Color (Color_Char : Character) return Boolean; 14 | function Check_Operation (Operation_Char : Character) return Boolean; 15 | 16 | -------------------------------------------------------------------------- 17 | -- Those variables hold the input received and are set by the 18 | -- different Check_ functions 19 | -------------------------------------------------------------------------- 20 | Block : Blocks; pragma Warnings (Off, Block); 21 | Color : Colors; 22 | Operation : Operations; 23 | 24 | -------------------------------------------------------------------------- 25 | -- see: .ads file 26 | -------------------------------------------------------------------------- 27 | function Check_Input (Instruction : LED_Instruction) 28 | return Execute.LED_Errors is 29 | begin 30 | if not Check_Block (Instruction (1)) then 31 | return Execute.Wrong_Block; 32 | end if; 33 | 34 | if not Check_Color (Instruction (2)) then 35 | return Execute.Wrong_Color; 36 | end if; 37 | 38 | if not Check_Operation (Instruction (3)) then 39 | return Execute.Wrong_Operation; 40 | end if; 41 | 42 | return Execute.OK; 43 | end Check_Input; 44 | 45 | -------------------------------------------------------------------------- 46 | -- see: .ads file 47 | -------------------------------------------------------------------------- 48 | function Evaluate (Instruction : LED_Instruction) 49 | return Execute.LED_Commands is 50 | subtype Command is Execute.LED_Commands; 51 | type Command_Map is array (Blocks, Colors, Operations) of Command; 52 | 53 | Command_Mapper : constant Command_Map 54 | := (Zero => ( 55 | Red => ( 56 | Off => Execute.Red_Off, 57 | On => Execute.Red_On, 58 | Toggle => Execute.Red_Toggle), 59 | Amber => ( 60 | Off => Execute.Amber_Off, 61 | On => Execute.Amber_On, 62 | Toggle => Execute.Amber_Toggle), 63 | Green => ( 64 | Off => Execute.Green_Off, 65 | On => Execute.Green_On, 66 | Toggle => Execute.Green_Toggle), 67 | White => ( 68 | Off => Execute.White_Off, 69 | On => Execute.White_On, 70 | Toggle => Execute.White_Toggle), 71 | Blue => ( 72 | Off => Execute.Blue_Off, 73 | On => Execute.Blue_On, 74 | Toggle => Execute.Blue_Toggle) 75 | ) 76 | ); 77 | 78 | begin 79 | return Command_Mapper (Block, Color, Operation); 80 | end Evaluate; 81 | 82 | -------------------------------------------------------------------------- 83 | -- Checks the character for the correct block request 84 | -------------------------------------------------------------------------- 85 | function Check_Block (Block_Char : Character) return Boolean is 86 | type B_2_C_Map is array (Blocks) of Character; 87 | B_2_C : constant B_2_C_Map := (Zero => '0'); 88 | begin 89 | for B in B_2_C_Map'First .. B_2_C_Map'Last loop 90 | if Block_Char = B_2_C (B) then 91 | Block := B; 92 | return True; 93 | end if; 94 | end loop; 95 | return False; 96 | end Check_Block; 97 | 98 | -------------------------------------------------------------------------- 99 | -- Checks the character for the correct color request 100 | -------------------------------------------------------------------------- 101 | function Check_Color (Color_Char : Character) return Boolean is 102 | type C_2_C_Map is array (Colors) of Character; 103 | C_2_C : constant C_2_C_Map := (Red => 'R', 104 | Amber => 'A', 105 | Green => 'G', 106 | White => 'W', 107 | Blue => 'B' 108 | ); 109 | begin 110 | for C in C_2_C_Map'First .. C_2_C_Map'Last loop 111 | if Color_Char = C_2_C (C) then 112 | Color := C; 113 | return True; 114 | end if; 115 | end loop; 116 | return False; 117 | end Check_Color; 118 | 119 | -------------------------------------------------------------------------- 120 | -- Checks the character for the correct operation request 121 | -------------------------------------------------------------------------- 122 | function Check_Operation (Operation_Char : Character) return Boolean is 123 | type O_2_C_Map is array (Operations) of Character; 124 | O_2_C : constant O_2_C_Map 125 | := (Off => '0', 126 | On => '1', 127 | Toggle => '2'); 128 | begin 129 | for O in 130 | O_2_C_Map'First .. O_2_C_Map'Last loop 131 | if Operation_Char = O_2_C (O) then 132 | Operation := O; 133 | return True; 134 | end if; 135 | end loop; 136 | return False; 137 | end Check_Operation; 138 | 139 | end Evaluate.LEDs; 140 | -------------------------------------------------------------------------------- /src/evaluate-leds.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package checks and evaluates the input received from the serial 4 | -- line for commanding the LEDs 5 | -- 6 | --=========================================================================== 7 | -- 8 | -- Copyright 2021 (C) Holger Rodriguez 9 | -- 10 | -- SPDX-License-Identifier: BSD-3-Clause 11 | -- 12 | with Execute; 13 | 14 | package Evaluate.LEDs is 15 | 16 | -------------------------------------------------------------------------- 17 | -- LED section 18 | -- The complete instruction is built as (all elements are Character): 19 | -- 20 | -- LED_Prefix := L 21 | -- This LED_Instruction is the part *after* the LED_Prefix 22 | -- Block Code := (0) -- only one block available at the moment 23 | -- Color of LED := (R, A, G, W, B) 24 | -- State of LED := (0, 1, 2) 25 | subtype LED_Instruction is String (1 .. 3); 26 | 27 | -------------------------------------------------------------------------- 28 | -- Blocks of LEDs defined. At the moment there is only one block 29 | -------------------------------------------------------------------------- 30 | type Blocks is (Zero); 31 | 32 | -------------------------------------------------------------------------- 33 | -- Colors of the LEDs available 34 | -------------------------------------------------------------------------- 35 | type Colors is (Red, Amber, Green, White, Blue); 36 | 37 | -------------------------------------------------------------------------- 38 | -- Operations possible for the LEDs 39 | -------------------------------------------------------------------------- 40 | type Operations is (Off, On, Toggle); 41 | 42 | -------------------------------------------------------------------------- 43 | -- Checks the input received against the rules defined above 44 | -------------------------------------------------------------------------- 45 | function Check_Input (Instruction : LED_Instruction) 46 | return Execute.LED_Errors; 47 | 48 | -------------------------------------------------------------------------- 49 | -- Evaluates the input received and returns the equivalent LED Command 50 | -------------------------------------------------------------------------- 51 | function Evaluate (Instruction : LED_Instruction) 52 | return Execute.LED_Commands; 53 | 54 | end Evaluate.LEDs; 55 | -------------------------------------------------------------------------------- /src/evaluate-matrices.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Holger Rodriguez 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | package body Evaluate.Matrices is 7 | 8 | -------------------------------------------------------------------------- 9 | -- Check functions for the input received 10 | -- Those functions set the global variables to the received value 11 | -- as a side effect 12 | -------------------------------------------------------------------------- 13 | function Check_Block (Block_Char : Character) return Boolean; 14 | function Check_Size (Size_Char : Character) return Boolean; 15 | function Check_Position (Position_Char : Character) return Boolean; 16 | function Check_Value (Value_String : Execute.Matrix_Value_Type) 17 | return Boolean; 18 | 19 | -------------------------------------------------------------------------- 20 | -- Those variables hold the input received and are set by the 21 | -- different Check_ functions 22 | -------------------------------------------------------------------------- 23 | Block : Blocks; 24 | Size : Sizes; 25 | Position : Positions; 26 | Value : Execute.Matrix_Value_Type; 27 | 28 | -------------------------------------------------------------------------- 29 | -- see .ads 30 | -------------------------------------------------------------------------- 31 | function Check_Input (Instruction : Matrix_Instruction) 32 | return Execute.Matrix_Errors is 33 | begin 34 | if not Check_Block (Instruction (1)) then 35 | return Execute.M_Wrong_Block; 36 | end if; 37 | 38 | if not Check_Size (Instruction (2)) then 39 | return Execute.M_Wrong_Size; 40 | end if; 41 | if Block = Zero then 42 | -- only supports Byte/Word_0 43 | if Size /= Byte and Size /= Word then 44 | return Execute.M_Wrong_Size; 45 | end if; 46 | end if; 47 | 48 | if not Check_Position (Instruction (3)) then 49 | return Execute.M_Wrong_Position; 50 | end if; 51 | if Block = Zero then 52 | -- We only allow: 53 | -- Byte: 0/1 54 | -- Word: 0 55 | if Size = Byte then 56 | -- only supports Zero, One 57 | if Position /= Zero and Position /= One then 58 | return Execute.M_Wrong_Position; 59 | end if; 60 | else 61 | -- if Word, then only Zero 62 | if Position /= Zero then 63 | return Execute.M_Wrong_Position; 64 | end if; 65 | end if; 66 | else 67 | -- Block 1: Double Word we only support Zero 68 | if Size = Double_Word then 69 | if Position /= Zero then 70 | return Execute.M_Wrong_Position; 71 | end if; 72 | end if; 73 | end if; 74 | 75 | if not Check_Value (Instruction (4 .. Matrix_Instruction'Last)) then 76 | return Execute.M_Wrong_Value; 77 | end if; 78 | 79 | return Execute.M_OK; 80 | end Check_Input; 81 | 82 | -------------------------------------------------------------------------- 83 | -- see .ads 84 | -------------------------------------------------------------------------- 85 | function Evaluate (Instruction : Matrix_Instruction) 86 | return Execute.Matrix_Command is 87 | RetVal : Execute.Matrix_Command; 88 | begin 89 | RetVal.Value := Value; 90 | if Block = Zero then 91 | RetVal.Block := Execute.Block_0; 92 | else 93 | RetVal.Block := Execute.Block_1; 94 | end if; 95 | case Size is 96 | when Byte => 97 | if Position = Zero then 98 | RetVal.Command := Execute.Byte_0; 99 | elsif Position = One then 100 | RetVal.Command := Execute.Byte_1; 101 | elsif Position = Two then 102 | RetVal.Command := Execute.Byte_2; 103 | elsif Position = Three then 104 | RetVal.Command := Execute.Byte_3; 105 | end if; 106 | when Word => 107 | if Position = Zero then 108 | RetVal.Command := Execute.Word_0; 109 | elsif Position = One then 110 | RetVal.Command := Execute.Word_1; 111 | end if; 112 | when Double_Word => 113 | RetVal.Command := Execute.Double_Word_0; 114 | end case; 115 | return RetVal; 116 | end Evaluate; 117 | 118 | -------------------------------------------------------------------------- 119 | -- Checks the character for the correct block request 120 | -------------------------------------------------------------------------- 121 | function Check_Block (Block_Char : Character) return Boolean is 122 | type B_2_C_Map is array (Blocks) of Character; 123 | B_2_C : constant B_2_C_Map := (Zero => '0', 124 | One => '1'); 125 | begin 126 | for B in B_2_C_Map'First .. B_2_C_Map'Last loop 127 | if Block_Char = B_2_C (B) then 128 | Block := B; 129 | return True; 130 | end if; 131 | end loop; 132 | return False; 133 | end Check_Block; 134 | 135 | -------------------------------------------------------------------------- 136 | -- Checks the character for the correct size request 137 | -------------------------------------------------------------------------- 138 | function Check_Size (Size_Char : Character) return Boolean is 139 | type S_2_C_Map is array (Sizes) of Character; 140 | S_2_C : constant S_2_C_Map := (Byte => 'B', 141 | Word => 'W', 142 | Double_Word => 'D' 143 | ); 144 | begin 145 | for S in S_2_C_Map'First .. S_2_C_Map'Last loop 146 | if Size_Char = S_2_C (S) then 147 | Size := S; 148 | return True; 149 | end if; 150 | end loop; 151 | return False; 152 | end Check_Size; 153 | 154 | -------------------------------------------------------------------------- 155 | -- Checks the character for the correct position request 156 | -------------------------------------------------------------------------- 157 | function Check_Position (Position_Char : Character) return Boolean is 158 | type P_2_C_Map is array (Positions) of Character; 159 | P_2_C : constant P_2_C_Map 160 | := (Zero => '0', 161 | One => '1', 162 | Two => '2', 163 | Three => '3'); 164 | begin 165 | for P in 166 | P_2_C_Map'First .. P_2_C_Map'Last loop 167 | if Position_Char = P_2_C (P) then 168 | Position := P; 169 | return True; 170 | end if; 171 | end loop; 172 | return False; 173 | end Check_Position; 174 | 175 | -------------------------------------------------------------------------- 176 | -- Checks the characters for the correct value request 177 | -------------------------------------------------------------------------- 178 | function Check_Value (Value_String : Execute.Matrix_Value_Type) 179 | return Boolean is 180 | Last : Integer; 181 | begin 182 | case Size is 183 | when Byte => Last := 2; 184 | when Word => Last := 4; 185 | when Double_Word => Last := 8; 186 | end case; 187 | for I in 1 .. Last loop 188 | case Value_String (I) is 189 | when '0' .. 'F' => Value (I) := Value_String (I); 190 | when others => return False; 191 | end case; 192 | end loop; 193 | 194 | return True; 195 | end Check_Value; 196 | 197 | end Evaluate.Matrices; 198 | -------------------------------------------------------------------------------- /src/evaluate-matrices.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package checks and evaluates the input received from the serial 4 | -- line for commanding the LEDs 5 | -- 6 | --=========================================================================== 7 | -- 8 | -- Copyright 2021 (C) Holger Rodriguez 9 | -- 10 | -- SPDX-License-Identifier: BSD-3-Clause 11 | -- 12 | with Execute; 13 | 14 | package Evaluate.Matrices is 15 | 16 | -------------------------------------------------------------------------- 17 | -- Matrix section 18 | -- The complete instruction is built as (all elements are Character): 19 | -- 20 | -- Matrix_Prefix := M 21 | -- This Matrix_Instruction is the part *after* the Matrix_Prefix 22 | -- Block Code := (0) -- only one block available at the moment 23 | -- Size Code := B=Byte, W=Word 24 | -- Position := 0/1 (counting from the right) 25 | -- Value := 26 | -- If Size Code = B then 27 | -- '00' .. 'FF' 28 | -- elseif Size_Code = W then 29 | -- '0000'.. 'FFFF' 30 | -- end if; 31 | subtype Matrix_Instruction is String (1 .. 11); 32 | 33 | -------------------------------------------------------------------------- 34 | -- Blocks of Matrices defined. 35 | -------------------------------------------------------------------------- 36 | type Blocks is (Zero, One); 37 | 38 | -------------------------------------------------------------------------- 39 | -- Sizes of Matrix available 40 | -------------------------------------------------------------------------- 41 | type Sizes is (Byte, Word, Double_Word); 42 | 43 | -------------------------------------------------------------------------- 44 | -- Positions of Value in the Matrix 45 | -------------------------------------------------------------------------- 46 | type Positions is (Zero, One, Two, Three); 47 | 48 | -------------------------------------------------------------------------- 49 | -- Checks the input received against the rules defined above 50 | -------------------------------------------------------------------------- 51 | function Check_Input (Instruction : Matrix_Instruction) 52 | return Execute.Matrix_Errors; 53 | 54 | -------------------------------------------------------------------------- 55 | -- Evaluates the input received and returns the equivalent LED Command 56 | -------------------------------------------------------------------------- 57 | function Evaluate (Instruction : Matrix_Instruction) 58 | return Execute.Matrix_Command; 59 | 60 | end Evaluate.Matrices; 61 | -------------------------------------------------------------------------------- /src/evaluate.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This is the root package for the different evaluations for the different 4 | -- available dashboard elements. 5 | -- 6 | --=========================================================================== 7 | -- 8 | -- Copyright 2021 (C) Holger Rodriguez 9 | -- 10 | -- SPDX-License-Identifier: BSD-3-Clause 11 | -- 12 | with Transport; 13 | 14 | package Evaluate is 15 | 16 | -------------------------------------------------------------------------- 17 | -- Definitions of area selectors for the different areas available 18 | -------------------------------------------------------------------------- 19 | LED_Prefix : constant Transport.Area_Selector := Transport.Led; 20 | Matrix_Prefix : constant Transport.Area_Selector := Transport.Matrix; 21 | 22 | end Evaluate; 23 | -------------------------------------------------------------------------------- /src/execute-leds.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Holger Rodriguez 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | with LED_Control; 7 | 8 | package body Execute.LEDs is 9 | 10 | -------------------------------------------------------------------------- 11 | -- definition of the look up table for the procedures to execute 12 | -- based on the command given 13 | -------------------------------------------------------------------------- 14 | type LED_Execute is access procedure; 15 | type LED_Execute_Map is array (LED_Commands) of LED_Execute; 16 | 17 | LED_Execute_Mapper : constant LED_Execute_Map 18 | := ( 19 | ------------------------------ 20 | -- Red LED operation mappings 21 | ------------------------------ 22 | Red_Off => LED_Control.LED_0_Red_Off'Access, 23 | Red_On => LED_Control.LED_0_Red_On'Access, 24 | Red_Toggle => LED_Control.LED_0_Red_Toggle'Access, 25 | 26 | -------------------------------- 27 | -- Amber LED operation mappings 28 | -------------------------------- 29 | Amber_Off => LED_Control.LED_0_Amber_Off'Access, 30 | Amber_On => LED_Control.LED_0_Amber_On'Access, 31 | Amber_Toggle => LED_Control.LED_0_Amber_Toggle'Access, 32 | 33 | -------------------------------- 34 | -- Green LED operation mappings 35 | -------------------------------- 36 | Green_Off => LED_Control.LED_0_Green_Off'Access, 37 | Green_On => LED_Control.LED_0_Green_On'Access, 38 | Green_Toggle => LED_Control.LED_0_Green_Toggle'Access, 39 | 40 | -------------------------------- 41 | -- White LED operation mappings 42 | -------------------------------- 43 | White_Off => LED_Control.LED_0_White_Off'Access, 44 | White_On => LED_Control.LED_0_White_On'Access, 45 | White_Toggle => LED_Control.LED_0_White_Toggle'Access, 46 | 47 | -------------------------------- 48 | -- Blue LED operation mappings 49 | -------------------------------- 50 | Blue_Off => LED_Control.LED_0_Blue_Off'Access, 51 | Blue_On => LED_Control.LED_0_Blue_On'Access, 52 | Blue_Toggle => LED_Control.LED_0_Blue_Toggle'Access 53 | ); 54 | 55 | -------------------------------------------------------------------------- 56 | -- see .ads 57 | -------------------------------------------------------------------------- 58 | procedure Execute (Cmd : LED_Commands) is 59 | begin 60 | LED_Execute_Mapper (Cmd).all; 61 | end Execute; 62 | 63 | end Execute.LEDs; 64 | -------------------------------------------------------------------------------- /src/execute-leds.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This is the execution package for the LED area on the dashboard. 4 | -- 5 | --=========================================================================== 6 | -- 7 | -- Copyright 2021 (C) Holger Rodriguez 8 | -- 9 | -- SPDX-License-Identifier: BSD-3-Clause 10 | -- 11 | package Execute.LEDs is 12 | 13 | -------------------------------------------------------------------------- 14 | -- Executes the command for the LED ares 15 | -------------------------------------------------------------------------- 16 | procedure Execute (Cmd : LED_Commands); 17 | 18 | end Execute.LEDs; 19 | -------------------------------------------------------------------------------- /src/execute-matrices.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Holger Rodriguez 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | with Interfaces; 7 | 8 | with HAL; 9 | 10 | with Matrix_Area_Word; 11 | with Matrix_Area_Double_Word; 12 | 13 | package body Execute.Matrices is 14 | 15 | -------------------------------------------------------------------------- 16 | -- Conversion functions from Character/String to UInt? 17 | -------------------------------------------------------------------------- 18 | function Convert_To_UInt4 (Value : Character) return HAL.UInt4; 19 | 20 | subtype Byte_Input_String is String (1 .. 2); 21 | function Convert_To_UInt8 (Value : Byte_Input_String) return HAL.UInt8; 22 | 23 | function Convert_To_UInt16 (Value : Standard.Execute.Matrix_Value_Type) 24 | return HAL.UInt16; 25 | 26 | -------------------------------------------------------------------------- 27 | -- see .ads 28 | -------------------------------------------------------------------------- 29 | procedure Execute (Cmd : Matrix_Command) is 30 | Value : constant Standard.Execute.Matrix_Value_Type := Cmd.Value; 31 | Byte_Num : HAL.UInt8; 32 | begin 33 | if Cmd.Block = Block_0 then 34 | case Cmd.Command is 35 | when Byte_0 => 36 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 37 | Matrix_Area_Word.Byte_0.Show (Number => Byte_Num); 38 | when Byte_1 => 39 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 40 | Matrix_Area_Word.Byte_1.Show (Number => Byte_Num); 41 | when Word_0 => 42 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 43 | Matrix_Area_Word.Byte_1.Show (Number => Byte_Num); 44 | 45 | Byte_Num := Convert_To_UInt8 (Value (3 .. 4)); 46 | Matrix_Area_Word.Byte_0.Show (Number => Byte_Num); 47 | when others => 48 | null; 49 | end case; 50 | else 51 | case Cmd.Command is 52 | when Byte_0 => 53 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 54 | Matrix_Area_Double_Word.Byte_0.Show (Number => Byte_Num); 55 | when Byte_1 => 56 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 57 | Matrix_Area_Double_Word.Byte_1.Show (Number => Byte_Num); 58 | when Byte_2 => 59 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 60 | Matrix_Area_Double_Word.Byte_2.Show (Number => Byte_Num); 61 | when Byte_3 => 62 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 63 | Matrix_Area_Double_Word.Byte_3.Show (Number => Byte_Num); 64 | 65 | when Word_0 => 66 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 67 | Matrix_Area_Double_Word.Byte_1.Show (Number => Byte_Num); 68 | 69 | Byte_Num := Convert_To_UInt8 (Value (3 .. 4)); 70 | Matrix_Area_Double_Word.Byte_0.Show (Number => Byte_Num); 71 | 72 | when Word_1 => 73 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 74 | Matrix_Area_Double_Word.Byte_3.Show (Number => Byte_Num); 75 | 76 | Byte_Num := Convert_To_UInt8 (Value (3 .. 4)); 77 | Matrix_Area_Double_Word.Byte_2.Show (Number => Byte_Num); 78 | 79 | when Double_Word_0 => 80 | Byte_Num := Convert_To_UInt8 (Value (1 .. 2)); 81 | Matrix_Area_Double_Word.Byte_3.Show (Number => Byte_Num); 82 | 83 | Byte_Num := Convert_To_UInt8 (Value (3 .. 4)); 84 | Matrix_Area_Double_Word.Byte_2.Show (Number => Byte_Num); 85 | 86 | Byte_Num := Convert_To_UInt8 (Value (5 .. 6)); 87 | Matrix_Area_Double_Word.Byte_1.Show (Number => Byte_Num); 88 | 89 | Byte_Num := Convert_To_UInt8 (Value (7 .. 8)); 90 | Matrix_Area_Double_Word.Byte_0.Show (Number => Byte_Num); 91 | end case; 92 | end if; 93 | end Execute; 94 | 95 | -------------------------------------------------------------------------- 96 | -- Convert one character representing 97 | -- a hex digit into an UInt4 value (Nibble) 98 | -------------------------------------------------------------------------- 99 | function Convert_To_UInt4 (Value : Character) return HAL.UInt4 is 100 | RetVal : HAL.UInt4; 101 | begin 102 | if Value = '0' then 103 | RetVal := 0; 104 | elsif Value = '1' then 105 | RetVal := 1; 106 | elsif Value = '2' then 107 | RetVal := 2; 108 | elsif Value = '3' then 109 | RetVal := 3; 110 | elsif Value = '4' then 111 | RetVal := 4; 112 | elsif Value = '5' then 113 | RetVal := 5; 114 | elsif Value = '6' then 115 | RetVal := 6; 116 | elsif Value = '7' then 117 | RetVal := 7; 118 | elsif Value = '8' then 119 | RetVal := 8; 120 | elsif Value = '9' then 121 | RetVal := 9; 122 | elsif Value = 'A' then 123 | RetVal := 10; 124 | elsif Value = 'B' then 125 | RetVal := 11; 126 | elsif Value = 'C' then 127 | RetVal := 12; 128 | elsif Value = 'D' then 129 | RetVal := 13; 130 | elsif Value = 'E' then 131 | RetVal := 14; 132 | elsif Value = 'F' then 133 | RetVal := 15; 134 | end if; 135 | return RetVal; 136 | end Convert_To_UInt4; 137 | 138 | -------------------------------------------------------------------------- 139 | -- Convert two characters representing 140 | -- a two hex digit number into an UInt8 value (Byte) 141 | -------------------------------------------------------------------------- 142 | function Convert_To_UInt8 (Value : Byte_Input_String) return HAL.UInt8 is 143 | LSB_U : constant Interfaces.Unsigned_8 144 | := Interfaces.Unsigned_8 (Convert_To_UInt4 (Value (2))); 145 | MSB_U : constant Interfaces.Unsigned_8 146 | := Interfaces.Unsigned_8 (Convert_To_UInt4 (Value (1))); 147 | RetVal : HAL.UInt8; 148 | 149 | use Interfaces; 150 | begin 151 | RetVal := HAL.UInt8 (Interfaces.Shift_Left (MSB_U, 4) + LSB_U); 152 | return RetVal; 153 | end Convert_To_UInt8; 154 | 155 | -------------------------------------------------------------------------- 156 | -- Convert four characters representing 157 | -- a four hex digit number into an UInt16 value (Word) 158 | -------------------------------------------------------------------------- 159 | function Convert_To_UInt16 (Value : Standard.Execute.Matrix_Value_Type) 160 | return HAL.UInt16 is 161 | use Interfaces; 162 | 163 | MSB_S : constant Byte_Input_String := Value (1 .. 2); 164 | MSB_U : constant Unsigned_8 := Unsigned_8 (Convert_To_UInt8 (MSB_S)); 165 | LSB_S : constant Byte_Input_String := Value (3 .. 4); 166 | LSB_U : constant Unsigned_8 := Unsigned_8 (Convert_To_UInt8 (LSB_S)); 167 | RetVal : HAL.UInt16; 168 | begin 169 | RetVal := HAL.UInt16 (Interfaces.Shift_Left (MSB_U, 8) + LSB_U); 170 | return RetVal; 171 | end Convert_To_UInt16; 172 | 173 | end Execute.Matrices; 174 | -------------------------------------------------------------------------------- /src/execute-matrices.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This is the execution package for the Matrix area on the dashboard. 4 | -- 5 | --=========================================================================== 6 | -- 7 | -- Copyright 2021 (C) Holger Rodriguez 8 | -- 9 | -- SPDX-License-Identifier: BSD-3-Clause 10 | -- 11 | package Execute.Matrices is 12 | 13 | -------------------------------------------------------------------------- 14 | -- Executes the command for the Matrix ares 15 | -------------------------------------------------------------------------- 16 | procedure Execute (Cmd : Matrix_Command); 17 | 18 | end Execute.Matrices; 19 | -------------------------------------------------------------------------------- /src/execute.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This is the root package for the different execution possibilities 4 | -- for the different areas available on the dashboard. 5 | -- 6 | --=========================================================================== 7 | -- 8 | -- Copyright 2021 (C) Holger Rodriguez 9 | -- 10 | -- SPDX-License-Identifier: BSD-3-Clause 11 | -- 12 | package Execute is 13 | 14 | -------------------------------------------------------------------------- 15 | -- LED: all LED related actions 16 | -- to simplify the interface, the possible error codes and 17 | -- actual commands are mixed into one enum 18 | -- [maybe not the best thing to do?] 19 | -------------------------------------------------------------------------- 20 | type LED_Actions is ( 21 | -- Error Codes 22 | OK, 23 | Wrong_Block, 24 | Wrong_Color, 25 | Wrong_Operation, 26 | 27 | -- Commands to execute 28 | Red_Off, Red_On, Red_Toggle, 29 | Amber_Off, Amber_On, Amber_Toggle, 30 | Green_Off, Green_On, Green_Toggle, 31 | White_Off, White_On, White_Toggle, 32 | Blue_Off, Blue_On, Blue_Toggle 33 | ); 34 | subtype LED_Errors is LED_Actions range OK .. Wrong_Operation; 35 | subtype LED_Commands is LED_Actions range Red_Off .. Blue_Toggle; 36 | 37 | -------------------------------------------------------------------------- 38 | -- Matrix: all Matrix related actions 39 | -- to simplify the interface, the possible error codes and 40 | -- actual commands are mixed into one enum 41 | -- [maybe not the best thing to do?] 42 | -------------------------------------------------------------------------- 43 | type Matrix_Actions is ( 44 | -- Error Codes 45 | M_OK, 46 | M_Wrong_Block, 47 | M_Wrong_Size, 48 | M_Wrong_Position, 49 | M_Wrong_Value, 50 | -- Blocks available 51 | Block_0, Block_1, 52 | -- Commands to execute 53 | Byte_0, Byte_1, 54 | Byte_2, Byte_3, 55 | Word_0, Word_1, 56 | Double_Word_0 57 | ); 58 | subtype Matrix_Errors is Matrix_Actions range M_OK .. M_Wrong_Value; 59 | subtype Matrix_Blocks is Matrix_Actions range Block_0 .. Block_1; 60 | subtype Matrix_Commands is Matrix_Actions range Byte_0 .. Double_Word_0; 61 | 62 | -------------------------------------------------------------------------- 63 | -- Represents the value given to display 64 | subtype Matrix_Value_Type is String (1 .. 8); 65 | 66 | -------------------------------------------------------------------------- 67 | -- Represents the command and value given to display 68 | type Matrix_Command is record 69 | Block : Matrix_Blocks; 70 | Command : Matrix_Commands; 71 | Value : Matrix_Value_Type; 72 | end record; 73 | 74 | end Execute; 75 | -------------------------------------------------------------------------------- /src/font.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Jeremy Grosser 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | package body Font is 7 | function Get 8 | (Ch : Wide_Wide_Character) 9 | return UInt8_Array 10 | is 11 | begin 12 | for MC of Characters loop 13 | if MC.Code = Wide_Wide_Character'Pos (Ch) then 14 | return MC.Bytes; 15 | end if; 16 | end loop; 17 | return (16#7F#, 16#7F#, 16#7F#, 16#7F#, 16#7F#); 18 | end Get; 19 | end Font; 20 | -------------------------------------------------------------------------------- /src/font.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Jeremy Grosser 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | with HAL; use HAL; 7 | 8 | package Font is 9 | subtype Matrix_Array is UInt8_Array (1 .. 5); 10 | type Matrix_Character is record 11 | Code : Integer; 12 | Bytes : Matrix_Array; 13 | end record; 14 | 15 | Characters : constant array (Positive range <>) of Matrix_Character := ( 16 | (32, (16#00#, 16#00#, 16#00#, 16#00#, 16#00#)), -- (space) 17 | (33, (16#00#, 16#00#, 16#5f#, 16#00#, 16#00#)), -- ! 18 | (34, (16#00#, 16#07#, 16#00#, 16#07#, 16#00#)), -- " 19 | (35, (16#14#, 16#7f#, 16#14#, 16#7f#, 16#14#)), -- # 20 | (36, (16#24#, 16#2a#, 16#7f#, 16#2a#, 16#12#)), -- $ 21 | (37, (16#23#, 16#13#, 16#08#, 16#64#, 16#62#)), -- % 22 | (38, (16#36#, 16#49#, 16#55#, 16#22#, 16#50#)), -- & 23 | (39, (16#00#, 16#05#, 16#03#, 16#00#, 16#00#)), -- ' 24 | (40, (16#00#, 16#1c#, 16#22#, 16#41#, 16#00#)), -- ( 25 | (41, (16#00#, 16#41#, 16#22#, 16#1c#, 16#00#)), -- ) 26 | (42, (16#08#, 16#2a#, 16#1c#, 16#2a#, 16#08#)), -- * 27 | (43, (16#08#, 16#08#, 16#3e#, 16#08#, 16#08#)), -- + 28 | (44, (16#00#, 16#50#, 16#30#, 16#00#, 16#00#)), -- , 29 | (45, (16#08#, 16#08#, 16#08#, 16#08#, 16#08#)), -- - 30 | (46, (16#00#, 16#60#, 16#60#, 16#00#, 16#00#)), -- . 31 | (47, (16#20#, 16#10#, 16#08#, 16#04#, 16#02#)), -- / 32 | (48, (16#3e#, 16#51#, 16#49#, 16#45#, 16#3e#)), -- 0 33 | (49, (16#00#, 16#42#, 16#7f#, 16#40#, 16#00#)), -- 1 34 | (50, (16#42#, 16#61#, 16#51#, 16#49#, 16#46#)), -- 2 35 | (51, (16#21#, 16#41#, 16#45#, 16#4b#, 16#31#)), -- 3 36 | (52, (16#18#, 16#14#, 16#12#, 16#7f#, 16#10#)), -- 4 37 | (53, (16#27#, 16#45#, 16#45#, 16#45#, 16#39#)), -- 5 38 | (54, (16#3c#, 16#4a#, 16#49#, 16#49#, 16#30#)), -- 6 39 | (55, (16#01#, 16#71#, 16#09#, 16#05#, 16#03#)), -- 7 40 | (56, (16#36#, 16#49#, 16#49#, 16#49#, 16#36#)), -- 8 41 | (57, (16#06#, 16#49#, 16#49#, 16#29#, 16#1e#)), -- 9 42 | (58, (16#00#, 16#36#, 16#36#, 16#00#, 16#00#)), -- : 43 | (59, (16#00#, 16#56#, 16#36#, 16#00#, 16#00#)), -- ; 44 | (60, (16#00#, 16#08#, 16#14#, 16#22#, 16#41#)), -- < 45 | (61, (16#14#, 16#14#, 16#14#, 16#14#, 16#14#)), -- = 46 | (62, (16#41#, 16#22#, 16#14#, 16#08#, 16#00#)), -- > 47 | (63, (16#02#, 16#01#, 16#51#, 16#09#, 16#06#)), -- ? 48 | (64, (16#32#, 16#49#, 16#79#, 16#41#, 16#3e#)), -- @ 49 | (65, (16#7e#, 16#11#, 16#11#, 16#11#, 16#7e#)), -- A 50 | (66, (16#7f#, 16#49#, 16#49#, 16#49#, 16#36#)), -- B 51 | (67, (16#3e#, 16#41#, 16#41#, 16#41#, 16#22#)), -- C 52 | (68, (16#7f#, 16#41#, 16#41#, 16#22#, 16#1c#)), -- D 53 | (69, (16#7f#, 16#49#, 16#49#, 16#49#, 16#41#)), -- E 54 | (70, (16#7f#, 16#09#, 16#09#, 16#01#, 16#01#)), -- F 55 | (71, (16#3e#, 16#41#, 16#41#, 16#51#, 16#32#)), -- G 56 | (72, (16#7f#, 16#08#, 16#08#, 16#08#, 16#7f#)), -- H 57 | (73, (16#00#, 16#41#, 16#7f#, 16#41#, 16#00#)), -- I 58 | (74, (16#20#, 16#40#, 16#41#, 16#3f#, 16#01#)), -- J 59 | (75, (16#7f#, 16#08#, 16#14#, 16#22#, 16#41#)), -- K 60 | (76, (16#7f#, 16#40#, 16#40#, 16#40#, 16#40#)), -- L 61 | (77, (16#7f#, 16#02#, 16#04#, 16#02#, 16#7f#)), -- M 62 | (78, (16#7f#, 16#04#, 16#08#, 16#10#, 16#7f#)), -- N 63 | (79, (16#3e#, 16#41#, 16#41#, 16#41#, 16#3e#)), -- O 64 | (80, (16#7f#, 16#09#, 16#09#, 16#09#, 16#06#)), -- P 65 | (81, (16#3e#, 16#41#, 16#51#, 16#21#, 16#5e#)), -- Q 66 | (82, (16#7f#, 16#09#, 16#19#, 16#29#, 16#46#)), -- R 67 | (83, (16#46#, 16#49#, 16#49#, 16#49#, 16#31#)), -- S 68 | (84, (16#01#, 16#01#, 16#7f#, 16#01#, 16#01#)), -- T 69 | (85, (16#3f#, 16#40#, 16#40#, 16#40#, 16#3f#)), -- U 70 | (86, (16#1f#, 16#20#, 16#40#, 16#20#, 16#1f#)), -- V 71 | (87, (16#7f#, 16#20#, 16#18#, 16#20#, 16#7f#)), -- W 72 | (88, (16#63#, 16#14#, 16#08#, 16#14#, 16#63#)), -- X 73 | (89, (16#03#, 16#04#, 16#78#, 16#04#, 16#03#)), -- Y 74 | (90, (16#61#, 16#51#, 16#49#, 16#45#, 16#43#)), -- Z 75 | (91, (16#00#, 16#00#, 16#7f#, 16#41#, 16#41#)), -- [ 76 | (92, (16#02#, 16#04#, 16#08#, 16#10#, 16#20#)), -- "\" 77 | (93, (16#41#, 16#41#, 16#7f#, 16#00#, 16#00#)), -- ] 78 | (94, (16#04#, 16#02#, 16#01#, 16#02#, 16#04#)), -- ^ 79 | (95, (16#40#, 16#40#, 16#40#, 16#40#, 16#40#)), -- _ 80 | (96, (16#00#, 16#01#, 16#02#, 16#04#, 16#00#)), -- ` 81 | (97, (16#20#, 16#54#, 16#54#, 16#54#, 16#78#)), -- a 82 | (98, (16#7f#, 16#48#, 16#44#, 16#44#, 16#38#)), -- b 83 | (99, (16#38#, 16#44#, 16#44#, 16#44#, 16#20#)), -- c 84 | (100, (16#38#, 16#44#, 16#44#, 16#48#, 16#7f#)), -- d 85 | (101, (16#38#, 16#54#, 16#54#, 16#54#, 16#18#)), -- e 86 | (102, (16#08#, 16#7e#, 16#09#, 16#01#, 16#02#)), -- f 87 | (103, (16#08#, 16#14#, 16#54#, 16#54#, 16#3c#)), -- g 88 | (104, (16#7f#, 16#08#, 16#04#, 16#04#, 16#78#)), -- h 89 | (105, (16#00#, 16#44#, 16#7d#, 16#40#, 16#00#)), -- i 90 | (106, (16#20#, 16#40#, 16#44#, 16#3d#, 16#00#)), -- j 91 | (107, (16#00#, 16#7f#, 16#10#, 16#28#, 16#44#)), -- k 92 | (108, (16#00#, 16#41#, 16#7f#, 16#40#, 16#00#)), -- l 93 | (109, (16#7c#, 16#04#, 16#18#, 16#04#, 16#78#)), -- m 94 | (110, (16#7c#, 16#08#, 16#04#, 16#04#, 16#78#)), -- n 95 | (111, (16#38#, 16#44#, 16#44#, 16#44#, 16#38#)), -- o 96 | (112, (16#7c#, 16#14#, 16#14#, 16#14#, 16#08#)), -- p 97 | (113, (16#08#, 16#14#, 16#14#, 16#18#, 16#7c#)), -- q 98 | (114, (16#7c#, 16#08#, 16#04#, 16#04#, 16#08#)), -- r 99 | (115, (16#48#, 16#54#, 16#54#, 16#54#, 16#20#)), -- s 100 | (116, (16#04#, 16#3f#, 16#44#, 16#40#, 16#20#)), -- t 101 | (117, (16#3c#, 16#40#, 16#40#, 16#20#, 16#7c#)), -- u 102 | (118, (16#1c#, 16#20#, 16#40#, 16#20#, 16#1c#)), -- v 103 | (119, (16#3c#, 16#40#, 16#30#, 16#40#, 16#3c#)), -- w 104 | (120, (16#44#, 16#28#, 16#10#, 16#28#, 16#44#)), -- x 105 | (121, (16#0c#, 16#50#, 16#50#, 16#50#, 16#3c#)), -- y 106 | (122, (16#44#, 16#64#, 16#54#, 16#4c#, 16#44#)), -- z 107 | (123, (16#00#, 16#08#, 16#36#, 16#41#, 16#00#)), -- { 108 | (124, (16#00#, 16#00#, 16#7f#, 16#00#, 16#00#)), -- | 109 | (125, (16#00#, 16#41#, 16#36#, 16#08#, 16#00#)), -- } 110 | (126, (16#08#, 16#08#, 16#2a#, 16#1c#, 16#08#)), -- ~ 111 | 112 | (8221, (16#00#, 16#07#, 16#00#, 16#07#, 16#00#)), -- ” 113 | (8592, (16#08#, 16#1C#, 16#2A#, 16#08#, 16#08#)), -- ← 114 | (8593, (16#08#, 16#04#, 16#7E#, 16#04#, 16#08#)), -- ↑ 115 | (8594, (16#08#, 16#08#, 16#2A#, 16#1C#, 16#08#)), -- → 116 | (8595, (16#08#, 16#10#, 16#3F#, 16#10#, 16#08#)), -- ↓ 117 | (9472, (16#08#, 16#08#, 16#08#, 16#08#, 16#08#)), -- ─ 118 | (9474, (16#00#, 16#00#, 16#7F#, 16#00#, 16#00#)), -- │ 119 | (9484, (16#00#, 16#00#, 16#78#, 16#08#, 16#08#)), -- ┌ 120 | (9488, (16#08#, 16#08#, 16#78#, 16#00#, 16#00#)), -- ┐ 121 | (9492, (16#00#, 16#00#, 16#0F#, 16#08#, 16#08#)), -- └ 122 | (9496, (16#08#, 16#08#, 16#0F#, 16#00#, 16#00#)), -- ┘ 123 | (9500, (16#00#, 16#00#, 16#7F#, 16#08#, 16#08#)), -- ├ 124 | (9508, (16#08#, 16#08#, 16#7F#, 16#00#, 16#00#)), -- ┤ 125 | (9516, (16#08#, 16#08#, 16#78#, 16#08#, 16#08#)), -- ┬ 126 | (9524, (16#08#, 16#08#, 16#0F#, 16#08#, 16#08#)), -- ┴ 127 | (9532, (16#08#, 16#08#, 16#7F#, 16#08#, 16#08#)), -- ┼ 128 | (9632, (16#7F#, 16#7F#, 16#7F#, 16#7F#, 16#7F#)), -- ■ 129 | (9633, (16#7F#, 16#41#, 16#41#, 16#41#, 16#7F#)), -- □ 130 | (9650, (16#10#, 16#1C#, 16#1E#, 16#1C#, 16#10#)), -- ▲ 131 | (9651, (16#10#, 16#1C#, 16#12#, 16#1C#, 16#10#)), -- △ 132 | (9660, (16#04#, 16#1C#, 16#3C#, 16#1C#, 16#04#)), -- ▼ 133 | (9661, (16#04#, 16#1C#, 16#24#, 16#1C#, 16#04#)), -- ▽ 134 | (9670, (16#08#, 16#1C#, 16#3E#, 16#1C#, 16#08#)), -- ◆ 135 | (9675, (16#1C#, 16#22#, 16#22#, 16#22#, 16#1C#)), -- ○ 136 | (9679, (16#1C#, 16#3E#, 16#3E#, 16#3E#, 16#1C#)), -- ● 137 | (9733, (16#64#, 16#3E#, 16#1F#, 16#3E#, 16#64#)), -- ★ 138 | (12288, (16#00#, 16#00#, 16#00#, 16#00#, 16#00#)), -- 139 | (12289, (16#10#, 16#20#, 16#40#, 16#00#, 16#00#)), -- 、 140 | (12290, (16#70#, 16#50#, 16#70#, 16#00#, 16#00#)), -- 。 141 | (12300, (16#00#, 16#0F#, 16#01#, 16#01#, 16#01#)), -- 「 142 | (12301, (16#40#, 16#40#, 16#40#, 16#78#, 16#00#)), -- 」 143 | (12316, (16#02#, 16#01#, 16#02#, 16#04#, 16#02#)), -- 〜 144 | (12353, (16#28#, 16#58#, 16#3C#, 16#68#, 16#00#)), -- ぁ 145 | (12354, (16#32#, 16#7A#, 16#2F#, 16#1A#, 16#72#)), -- あ 146 | (12355, (16#38#, 16#40#, 16#08#, 16#30#, 16#00#)), -- ぃ 147 | (12356, (16#3E#, 16#40#, 16#20#, 16#00#, 16#1C#)), -- い 148 | (12357, (16#10#, 16#0C#, 16#4C#, 16#30#, 16#00#)), -- ぅ 149 | (12358, (16#04#, 16#05#, 16#45#, 16#25#, 16#18#)), -- う 150 | (12359, (16#48#, 16#2C#, 16#5C#, 16#48#, 16#00#)), -- ぇ 151 | (12360, (16#44#, 16#24#, 16#35#, 16#4D#, 16#44#)), -- え 152 | (12361, (16#68#, 16#7C#, 16#10#, 16#64#, 16#00#)), -- ぉ 153 | (12362, (16#32#, 16#7F#, 16#0A#, 16#48#, 16#32#)), -- お 154 | (12363, (16#34#, 16#0F#, 16#44#, 16#38#, 16#06#)), -- か 155 | (12365, (16#22#, 16#4A#, 16#4F#, 16#5A#, 16#08#)), -- き 156 | (12367, (16#00#, 16#18#, 16#24#, 16#43#, 16#00#)), -- く 157 | (12369, (16#3E#, 16#00#, 16#44#, 16#3F#, 16#04#)), -- け 158 | (12371, (16#22#, 16#52#, 16#42#, 16#42#, 16#44#)), -- こ 159 | (12373, (16#24#, 16#44#, 16#47#, 16#5C#, 16#12#)), -- さ 160 | (12375, (16#3F#, 16#40#, 16#40#, 16#20#, 16#10#)), -- し 161 | (12377, (16#02#, 16#0A#, 16#56#, 16#3F#, 16#02#)), -- す 162 | (12379, (16#04#, 16#3E#, 16#44#, 16#5F#, 16#44#)), -- せ 163 | (12381, (16#08#, 16#2D#, 16#5B#, 16#45#, 16#44#)), -- そ 164 | (12383, (16#72#, 16#0F#, 16#22#, 16#4A#, 16#48#)), -- た 165 | (12385, (16#0A#, 16#0E#, 16#4B#, 16#4A#, 16#32#)), -- ち 166 | (12387, (16#08#, 16#48#, 16#48#, 16#30#, 16#00#)), -- っ 167 | (12388, (16#02#, 16#02#, 16#42#, 16#22#, 16#1C#)), -- つ 168 | (12390, (16#02#, 16#32#, 16#4A#, 16#46#, 16#42#)), -- て 169 | (12392, (16#30#, 16#4B#, 16#44#, 16#44#, 16#42#)), -- と 170 | (12394, (16#0A#, 16#27#, 16#52#, 16#38#, 16#26#)), -- な 171 | (12395, (16#3E#, 16#00#, 16#22#, 16#42#, 16#42#)), -- に 172 | (12396, (16#38#, 16#6F#, 16#1C#, 16#67#, 16#78#)), -- ぬ 173 | (12397, (16#12#, 16#7F#, 16#0A#, 16#64#, 16#78#)), -- ね 174 | (12398, (16#3C#, 16#62#, 16#1E#, 16#44#, 16#38#)), -- の 175 | (12399, (16#3E#, 16#00#, 16#32#, 16#7F#, 16#22#)), -- は 176 | (12402, (16#04#, 16#3E#, 16#40#, 16#47#, 16#3C#)), -- ひ 177 | (12405, (16#30#, 16#05#, 16#7A#, 16#00#, 16#38#)), -- ふ 178 | (12411, (16#3E#, 16#00#, 16#35#, 16#7F#, 16#25#)), -- ほ 179 | (12414, (16#2A#, 16#5A#, 16#7F#, 16#2A#, 16#4A#)), -- ま 180 | (12415, (16#71#, 16#3F#, 16#08#, 16#7E#, 16#08#)), -- み 181 | (12416, (16#1A#, 16#3F#, 16#42#, 16#40#, 16#26#)), -- む 182 | (12417, (16#38#, 16#4E#, 16#34#, 16#1F#, 16#78#)), -- め 183 | (12418, (16#14#, 16#3F#, 16#54#, 16#40#, 16#20#)), -- も 184 | (12419, (16#1C#, 16#68#, 16#0C#, 16#30#, 16#00#)), -- ゃ 185 | (12420, (16#04#, 16#7F#, 16#04#, 16#2E#, 16#18#)), -- や 186 | (12421, (16#18#, 16#50#, 16#3C#, 16#18#, 16#00#)), -- ゅ 187 | (12422, (16#1E#, 16#44#, 16#3F#, 16#12#, 16#0C#)), -- ゆ 188 | (12423, (16#60#, 16#7C#, 16#28#, 16#40#, 16#00#)), -- ょ 189 | (12424, (16#20#, 16#50#, 16#3F#, 16#24#, 16#44#)), -- よ 190 | (12425, (16#10#, 16#0D#, 16#49#, 16#4A#, 16#30#)), -- ら 191 | (12426, (16#0E#, 16#00#, 16#40#, 16#21#, 16#1E#)), -- り 192 | (12427, (16#20#, 16#55#, 16#65#, 16#4B#, 16#30#)), -- る 193 | (12428, (16#34#, 16#7F#, 16#04#, 16#3E#, 16#40#)), -- れ 194 | (12429, (16#10#, 16#49#, 16#4D#, 16#4B#, 16#30#)), -- ろ 195 | (12431, (16#24#, 16#7F#, 16#0A#, 16#44#, 16#38#)), -- わ 196 | (12434, (16#22#, 16#5F#, 16#4A#, 16#56#, 16#42#)), -- を 197 | (12435, (16#70#, 16#0F#, 16#30#, 16#40#, 16#20#)), -- ん 198 | (12443, (16#02#, 16#04#, 16#01#, 16#02#, 16#00#)), -- ゛ 199 | (12444, (16#07#, 16#05#, 16#07#, 16#00#, 16#00#)), -- ゜ 200 | (12449, (16#44#, 16#44#, 16#3C#, 16#14#, 16#0C#)), -- ァ 201 | (12450, (16#42#, 16#42#, 16#3A#, 16#12#, 16#0E#)), -- ア 202 | (12451, (16#20#, 16#10#, 16#78#, 16#04#, 16#00#)), -- ィ 203 | (12452, (16#10#, 16#08#, 16#04#, 16#7E#, 16#01#)), -- イ 204 | (12453, (16#18#, 16#08#, 16#4C#, 16#48#, 16#38#)), -- ゥ 205 | (12454, (16#0E#, 16#42#, 16#43#, 16#22#, 16#1E#)), -- ウ 206 | (12455, (16#48#, 16#48#, 16#78#, 16#48#, 16#48#)), -- ェ 207 | (12456, (16#42#, 16#42#, 16#7E#, 16#42#, 16#42#)), -- エ 208 | (12457, (16#48#, 16#38#, 16#08#, 16#7C#, 16#08#)), -- ォ 209 | (12458, (16#22#, 16#12#, 16#0A#, 16#7F#, 16#02#)), -- オ 210 | (12459, (16#42#, 16#3F#, 16#02#, 16#02#, 16#7E#)), -- カ 211 | (12461, (16#0A#, 16#0A#, 16#7F#, 16#0A#, 16#0A#)), -- キ 212 | (12463, (16#08#, 16#06#, 16#42#, 16#22#, 16#1E#)), -- ク 213 | (12465, (16#0F#, 16#42#, 16#42#, 16#3E#, 16#02#)), -- ケ 214 | (12467, (16#42#, 16#42#, 16#42#, 16#42#, 16#7E#)), -- コ 215 | (12469, (16#02#, 16#4F#, 16#42#, 16#3F#, 16#02#)), -- サ 216 | (12471, (16#4A#, 16#4A#, 16#40#, 16#20#, 16#1C#)), -- シ 217 | (12473, (16#42#, 16#22#, 16#12#, 16#2A#, 16#46#)), -- ス 218 | (12475, (16#02#, 16#3F#, 16#42#, 16#42#, 16#4E#)), -- セ 219 | (12477, (16#06#, 16#48#, 16#40#, 16#30#, 16#0E#)), -- ソ 220 | (12479, (16#08#, 16#4E#, 16#52#, 16#32#, 16#0E#)), -- タ 221 | (12481, (16#08#, 16#4A#, 16#4A#, 16#3F#, 16#09#)), -- チ 222 | (12483, (16#18#, 16#40#, 16#58#, 16#40#, 16#30#)), -- ッ 223 | (12484, (16#0E#, 16#40#, 16#4E#, 16#20#, 16#1E#)), -- ツ 224 | (12486, (16#04#, 16#45#, 16#45#, 16#3D#, 16#04#)), -- テ 225 | (12488, (16#00#, 16#7F#, 16#08#, 16#10#, 16#10#)), -- ト 226 | (12490, (16#44#, 16#44#, 16#44#, 16#3F#, 16#04#)), -- ナ 227 | (12491, (16#40#, 16#42#, 16#42#, 16#42#, 16#40#)), -- ニ 228 | (12492, (16#42#, 16#4A#, 16#2A#, 16#12#, 16#2E#)), -- ヌ 229 | (12493, (16#22#, 16#12#, 16#73#, 16#0A#, 16#16#)), -- ネ 230 | (12494, (16#40#, 16#40#, 16#20#, 16#10#, 16#0E#)), -- ノ 231 | (12495, (16#70#, 16#0E#, 16#00#, 16#07#, 16#78#)), -- ハ 232 | (12498, (16#3F#, 16#44#, 16#44#, 16#44#, 16#44#)), -- ヒ 233 | (12501, (16#02#, 16#42#, 16#42#, 16#22#, 16#1E#)), -- フ 234 | (12504, (16#08#, 16#04#, 16#02#, 16#0C#, 16#30#)), -- ヘ 235 | (12507, (16#32#, 16#02#, 16#7F#, 16#02#, 16#32#)), -- ホ 236 | (12510, (16#02#, 16#12#, 16#22#, 16#52#, 16#0E#)), -- マ 237 | (12511, (16#20#, 16#2A#, 16#2A#, 16#2A#, 16#40#)), -- ミ 238 | (12512, (16#30#, 16#2C#, 16#22#, 16#28#, 16#70#)), -- ム 239 | (12513, (16#40#, 16#44#, 16#28#, 16#10#, 16#2E#)), -- メ 240 | (12514, (16#0A#, 16#0A#, 16#3E#, 16#4A#, 16#4A#)), -- モ 241 | (12515, (16#08#, 16#7C#, 16#08#, 16#28#, 16#18#)), -- ャ 242 | (12516, (16#04#, 16#7F#, 16#04#, 16#14#, 16#0C#)), -- ヤ 243 | (12517, (16#48#, 16#48#, 16#48#, 16#78#, 16#40#)), -- ュ 244 | (12518, (16#42#, 16#42#, 16#42#, 16#7E#, 16#40#)), -- ユ 245 | (12519, (16#54#, 16#54#, 16#54#, 16#7C#, 16#00#)), -- ョ 246 | (12520, (16#4A#, 16#4A#, 16#4A#, 16#4A#, 16#7E#)), -- ヨ 247 | (12521, (16#04#, 16#45#, 16#45#, 16#25#, 16#1C#)), -- ラ 248 | (12522, (16#0E#, 16#40#, 16#40#, 16#20#, 16#1E#)), -- リ 249 | (12523, (16#7E#, 16#00#, 16#7E#, 16#40#, 16#38#)), -- ル 250 | (12524, (16#7E#, 16#40#, 16#40#, 16#20#, 16#10#)), -- レ 251 | (12525, (16#7E#, 16#42#, 16#42#, 16#42#, 16#7E#)), -- ロ 252 | (12527, (16#0E#, 16#42#, 16#42#, 16#22#, 16#1E#)), -- ワ 253 | (12530, (16#0A#, 16#4A#, 16#4A#, 16#2A#, 16#1E#)), -- ヲ 254 | (12531, (16#42#, 16#42#, 16#40#, 16#20#, 16#1C#)), -- ン 255 | (12539, (16#00#, 16#00#, 16#08#, 16#00#, 16#00#)), -- ・ 256 | (12540, (16#04#, 16#08#, 16#08#, 16#08#, 16#08#)), -- ー 257 | (65281, (16#00#, 16#00#, 16#5F#, 16#00#, 16#00#)), -- ! 258 | (65283, (16#14#, 16#7F#, 16#14#, 16#7F#, 16#14#)), -- # 259 | (65284, (16#24#, 16#2A#, 16#7F#, 16#2A#, 16#12#)), -- $ 260 | (65285, (16#23#, 16#13#, 16#08#, 16#64#, 16#62#)), -- % 261 | (65286, (16#36#, 16#49#, 16#56#, 16#20#, 16#50#)), -- & 262 | (65288, (16#00#, 16#1C#, 16#22#, 16#41#, 16#00#)), -- ( 263 | (65289, (16#00#, 16#41#, 16#22#, 16#1C#, 16#00#)), -- ) 264 | (65290, (16#2A#, 16#1C#, 16#3E#, 16#1C#, 16#2A#)), -- * 265 | (65291, (16#08#, 16#08#, 16#3E#, 16#08#, 16#08#)), -- + 266 | (65292, (16#00#, 16#10#, 16#30#, 16#00#, 16#00#)), -- , 267 | (65294, (16#00#, 16#60#, 16#60#, 16#00#, 16#00#)), -- . 268 | (65295, (16#20#, 16#10#, 16#08#, 16#04#, 16#02#)), -- / 269 | (65296, (16#3E#, 16#51#, 16#49#, 16#45#, 16#3E#)), -- 0 270 | (65297, (16#42#, 16#42#, 16#7F#, 16#40#, 16#40#)), -- 1 271 | (65298, (16#42#, 16#61#, 16#51#, 16#49#, 16#46#)), -- 2 272 | (65299, (16#22#, 16#41#, 16#49#, 16#49#, 16#36#)), -- 3 273 | (65300, (16#38#, 16#24#, 16#22#, 16#7F#, 16#20#)), -- 4 274 | (65301, (16#2F#, 16#45#, 16#45#, 16#45#, 16#39#)), -- 5 275 | (65302, (16#3C#, 16#4A#, 16#49#, 16#49#, 16#30#)), -- 6 276 | (65303, (16#03#, 16#01#, 16#79#, 16#05#, 16#03#)), -- 7 277 | (65304, (16#36#, 16#49#, 16#49#, 16#49#, 16#36#)), -- 8 278 | (65305, (16#06#, 16#49#, 16#49#, 16#49#, 16#3E#)), -- 9 279 | (65306, (16#00#, 16#00#, 16#12#, 16#00#, 16#00#)), -- : 280 | (65307, (16#00#, 16#40#, 16#32#, 16#00#, 16#00#)), -- ; 281 | (65308, (16#08#, 16#14#, 16#22#, 16#41#, 16#00#)), -- < 282 | (65309, (16#14#, 16#14#, 16#14#, 16#14#, 16#14#)), -- = 283 | (65310, (16#00#, 16#41#, 16#22#, 16#14#, 16#08#)), -- > 284 | (65311, (16#02#, 16#01#, 16#51#, 16#09#, 16#06#)), -- ? 285 | (65312, (16#1C#, 16#22#, 16#49#, 16#55#, 16#4E#)), -- @ 286 | (65313, (16#7C#, 16#12#, 16#11#, 16#12#, 16#7C#)), -- A 287 | (65314, (16#7F#, 16#49#, 16#49#, 16#49#, 16#36#)), -- B 288 | (65315, (16#3E#, 16#41#, 16#41#, 16#41#, 16#22#)), -- C 289 | (65316, (16#7F#, 16#41#, 16#41#, 16#22#, 16#1C#)), -- D 290 | (65317, (16#7F#, 16#49#, 16#49#, 16#49#, 16#41#)), -- E 291 | (65318, (16#7F#, 16#09#, 16#09#, 16#09#, 16#01#)), -- F 292 | (65319, (16#3E#, 16#41#, 16#49#, 16#49#, 16#79#)), -- G 293 | (65320, (16#7F#, 16#08#, 16#08#, 16#08#, 16#7F#)), -- H 294 | (65321, (16#00#, 16#41#, 16#7F#, 16#41#, 16#00#)), -- I 295 | (65322, (16#20#, 16#40#, 16#41#, 16#3F#, 16#01#)), -- J 296 | (65323, (16#7F#, 16#08#, 16#14#, 16#22#, 16#41#)), -- K 297 | (65324, (16#7F#, 16#40#, 16#40#, 16#40#, 16#40#)), -- L 298 | (65325, (16#7F#, 16#02#, 16#04#, 16#02#, 16#7F#)), -- M 299 | (65326, (16#7F#, 16#02#, 16#04#, 16#08#, 16#7F#)), -- N 300 | (65327, (16#3E#, 16#41#, 16#41#, 16#41#, 16#3E#)), -- O 301 | (65328, (16#7F#, 16#09#, 16#09#, 16#09#, 16#06#)), -- P 302 | (65329, (16#3E#, 16#41#, 16#51#, 16#21#, 16#5E#)), -- Q 303 | (65330, (16#7F#, 16#09#, 16#19#, 16#29#, 16#46#)), -- R 304 | (65331, (16#26#, 16#49#, 16#49#, 16#49#, 16#32#)), -- S 305 | (65332, (16#01#, 16#01#, 16#7F#, 16#01#, 16#01#)), -- T 306 | (65333, (16#3F#, 16#40#, 16#40#, 16#40#, 16#3F#)), -- U 307 | (65334, (16#07#, 16#18#, 16#60#, 16#18#, 16#07#)), -- V 308 | (65335, (16#7F#, 16#20#, 16#10#, 16#20#, 16#7F#)), -- W 309 | (65336, (16#63#, 16#14#, 16#08#, 16#14#, 16#63#)), -- X 310 | (65337, (16#03#, 16#04#, 16#78#, 16#04#, 16#03#)), -- Y 311 | (65338, (16#61#, 16#51#, 16#49#, 16#45#, 16#43#)), -- Z 312 | (65339, (16#00#, 16#7F#, 16#41#, 16#41#, 16#00#)), -- [ 313 | (65340, (16#02#, 16#04#, 16#08#, 16#10#, 16#20#)), -- \ 314 | (65341, (16#00#, 16#41#, 16#41#, 16#7F#, 16#00#)), -- ] 315 | (65342, (16#04#, 16#02#, 16#01#, 16#02#, 16#04#)), -- ^ 316 | (65343, (16#40#, 16#40#, 16#40#, 16#40#, 16#40#)), -- _ 317 | (65344, (16#00#, 16#01#, 16#02#, 16#00#, 16#00#)), -- ` 318 | (65345, (16#24#, 16#54#, 16#54#, 16#54#, 16#78#)), -- a 319 | (65346, (16#7F#, 16#44#, 16#44#, 16#44#, 16#38#)), -- b 320 | (65347, (16#38#, 16#44#, 16#44#, 16#44#, 16#44#)), -- c 321 | (65348, (16#38#, 16#44#, 16#44#, 16#44#, 16#7F#)), -- d 322 | (65349, (16#38#, 16#54#, 16#54#, 16#54#, 16#18#)), -- e 323 | (65350, (16#08#, 16#08#, 16#7E#, 16#09#, 16#09#)), -- f 324 | (65351, (16#0C#, 16#52#, 16#52#, 16#52#, 16#3E#)), -- g 325 | (65352, (16#7F#, 16#08#, 16#04#, 16#04#, 16#78#)), -- h 326 | (65353, (16#00#, 16#44#, 16#7D#, 16#40#, 16#00#)), -- i 327 | (65354, (16#20#, 16#40#, 16#40#, 16#44#, 16#3D#)), -- j 328 | (65355, (16#7F#, 16#20#, 16#10#, 16#28#, 16#44#)), -- k 329 | (65356, (16#00#, 16#41#, 16#7F#, 16#40#, 16#00#)), -- l 330 | (65357, (16#7C#, 16#04#, 16#7C#, 16#04#, 16#78#)), -- m 331 | (65358, (16#7C#, 16#04#, 16#04#, 16#04#, 16#78#)), -- n 332 | (65359, (16#38#, 16#44#, 16#44#, 16#44#, 16#38#)), -- o 333 | (65360, (16#7E#, 16#12#, 16#12#, 16#12#, 16#0C#)), -- p 334 | (65361, (16#0C#, 16#12#, 16#12#, 16#12#, 16#7E#)), -- q 335 | (65362, (16#7C#, 16#08#, 16#04#, 16#04#, 16#08#)), -- r 336 | (65363, (16#48#, 16#54#, 16#54#, 16#54#, 16#24#)), -- s 337 | (65364, (16#04#, 16#04#, 16#3F#, 16#44#, 16#44#)), -- t 338 | (65365, (16#3C#, 16#40#, 16#40#, 16#40#, 16#7C#)), -- u 339 | (65366, (16#1C#, 16#20#, 16#40#, 16#20#, 16#1C#)), -- v 340 | (65367, (16#3C#, 16#40#, 16#38#, 16#40#, 16#3C#)), -- w 341 | (65368, (16#44#, 16#28#, 16#10#, 16#28#, 16#44#)), -- x 342 | (65369, (16#0E#, 16#50#, 16#50#, 16#50#, 16#3E#)), -- y 343 | (65370, (16#44#, 16#64#, 16#54#, 16#4C#, 16#44#)), -- z 344 | (65371, (16#00#, 16#08#, 16#36#, 16#41#, 16#41#)), -- { 345 | (65372, (16#00#, 16#00#, 16#77#, 16#00#, 16#00#)), -- | 346 | (65373, (16#41#, 16#41#, 16#36#, 16#08#, 16#00#)), -- } 347 | (65374, (16#08#, 16#04#, 16#08#, 16#10#, 16#08#)), -- ~ 348 | (65383, (16#44#, 16#44#, 16#3C#, 16#14#, 16#0C#)), -- ァ 349 | (65384, (16#42#, 16#42#, 16#3A#, 16#12#, 16#0E#)), -- ィ 350 | (65385, (16#20#, 16#10#, 16#78#, 16#04#, 16#00#)), -- ゥ 351 | (65386, (16#10#, 16#08#, 16#04#, 16#7E#, 16#01#)), -- ェ 352 | (65387, (16#18#, 16#08#, 16#4C#, 16#48#, 16#38#)), -- ォ 353 | (65388, (16#0E#, 16#42#, 16#43#, 16#22#, 16#1E#)), -- ャ 354 | (65389, (16#48#, 16#48#, 16#78#, 16#48#, 16#48#)), -- ュ 355 | (65390, (16#42#, 16#42#, 16#7E#, 16#42#, 16#42#)), -- ョ 356 | (65391, (16#48#, 16#38#, 16#08#, 16#7C#, 16#08#)), -- ッ 357 | (65392, (16#22#, 16#12#, 16#0A#, 16#7F#, 16#02#)), -- ー 358 | (65393, (16#42#, 16#3F#, 16#02#, 16#02#, 16#7E#)), -- ア 359 | (65394, (16#0A#, 16#0A#, 16#7F#, 16#0A#, 16#0A#)), -- イ 360 | (65395, (16#08#, 16#06#, 16#42#, 16#22#, 16#1E#)), -- ウ 361 | (65396, (16#0F#, 16#42#, 16#42#, 16#3E#, 16#02#)), -- エ 362 | (65397, (16#42#, 16#42#, 16#42#, 16#42#, 16#7E#)), -- オ 363 | (65398, (16#02#, 16#4F#, 16#42#, 16#3F#, 16#02#)), -- カ 364 | (65399, (16#4A#, 16#4A#, 16#40#, 16#20#, 16#1C#)), -- キ 365 | (65400, (16#42#, 16#22#, 16#12#, 16#2A#, 16#46#)), -- ク 366 | (65401, (16#02#, 16#3F#, 16#42#, 16#42#, 16#4E#)), -- ケ 367 | (65402, (16#06#, 16#48#, 16#40#, 16#30#, 16#0E#)), -- コ 368 | (65403, (16#08#, 16#4E#, 16#52#, 16#32#, 16#0E#)), -- サ 369 | (65404, (16#08#, 16#4A#, 16#4A#, 16#3F#, 16#09#)), -- シ 370 | (65405, (16#18#, 16#40#, 16#58#, 16#40#, 16#30#)), -- ス 371 | (65406, (16#0E#, 16#40#, 16#4E#, 16#20#, 16#1E#)), -- セ 372 | (65407, (16#04#, 16#45#, 16#45#, 16#3D#, 16#04#)), -- ソ 373 | (65408, (16#00#, 16#7F#, 16#08#, 16#10#, 16#10#)), -- タ 374 | (65409, (16#44#, 16#44#, 16#44#, 16#3F#, 16#04#)), -- チ 375 | (65410, (16#40#, 16#42#, 16#42#, 16#42#, 16#40#)), -- ツ 376 | (65411, (16#42#, 16#4A#, 16#2A#, 16#12#, 16#2E#)), -- テ 377 | (65412, (16#22#, 16#12#, 16#73#, 16#0A#, 16#16#)), -- ト 378 | (65413, (16#40#, 16#40#, 16#20#, 16#10#, 16#0E#)), -- ナ 379 | (65414, (16#70#, 16#0E#, 16#00#, 16#07#, 16#78#)), -- ニ 380 | (65415, (16#3F#, 16#44#, 16#44#, 16#44#, 16#44#)), -- ヌ 381 | (65416, (16#02#, 16#42#, 16#42#, 16#22#, 16#1E#)), -- ネ 382 | (65417, (16#08#, 16#04#, 16#02#, 16#0C#, 16#30#)), -- ノ 383 | (65418, (16#32#, 16#02#, 16#7F#, 16#02#, 16#32#)), -- ハ 384 | (65419, (16#02#, 16#12#, 16#22#, 16#52#, 16#0E#)), -- ヒ 385 | (65420, (16#20#, 16#2A#, 16#2A#, 16#2A#, 16#40#)), -- フ 386 | (65421, (16#30#, 16#2C#, 16#22#, 16#28#, 16#70#)), -- ヘ 387 | (65422, (16#40#, 16#44#, 16#28#, 16#10#, 16#2E#)), -- ホ 388 | (65423, (16#0A#, 16#0A#, 16#3E#, 16#4A#, 16#4A#)), -- マ 389 | (65424, (16#08#, 16#7C#, 16#08#, 16#28#, 16#18#)), -- ミ 390 | (65425, (16#04#, 16#7F#, 16#04#, 16#14#, 16#0C#)), -- ム 391 | (65426, (16#48#, 16#48#, 16#48#, 16#78#, 16#40#)), -- メ 392 | (65427, (16#42#, 16#42#, 16#42#, 16#7E#, 16#40#)), -- モ 393 | (65428, (16#54#, 16#54#, 16#54#, 16#7C#, 16#00#)), -- ヤ 394 | (65429, (16#4A#, 16#4A#, 16#4A#, 16#4A#, 16#7E#)), -- ユ 395 | (65430, (16#04#, 16#45#, 16#45#, 16#25#, 16#1C#)), -- ヨ 396 | (65431, (16#0E#, 16#40#, 16#40#, 16#20#, 16#1E#)), -- ラ 397 | (65432, (16#7E#, 16#00#, 16#7E#, 16#40#, 16#38#)), -- リ 398 | (65433, (16#7E#, 16#40#, 16#40#, 16#20#, 16#10#)), -- ル 399 | (65434, (16#7E#, 16#42#, 16#42#, 16#42#, 16#7E#)), -- レ 400 | (65435, (16#0E#, 16#42#, 16#42#, 16#22#, 16#1E#)), -- ロ 401 | (65436, (16#0A#, 16#4A#, 16#4A#, 16#2A#, 16#1E#)), -- ワ 402 | (65437, (16#42#, 16#42#, 16#40#, 16#20#, 16#1C#)), -- ン 403 | (65438, (16#02#, 16#04#, 16#01#, 16#02#, 16#00#)), -- ゙ 404 | (65439, (16#07#, 16#05#, 16#07#, 16#00#, 16#00#))); -- ゚ 405 | 406 | function Get 407 | (Ch : Wide_Wide_Character) 408 | return UInt8_Array; 409 | end Font; 410 | -------------------------------------------------------------------------------- /src/hex_2digits_display.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Holger Rodriguez 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | with Font; 7 | with Pimoroni_LED_Dot_Matrix; 8 | 9 | package body Hex_2Digits_Display is 10 | 11 | ----------------------------------------------------------------------- 12 | -- represents the hardware piece to use for display 13 | ----------------------------------------------------------------------- 14 | package PLDM is new Pimoroni_LED_Dot_Matrix (I2C, Address); 15 | 16 | ----------------------------------------------------------------------- 17 | -- references the font defintions, so we have easier indexing 18 | All_Letters : constant array (HAL.UInt4 range <>) of Font.Matrix_Array 19 | := ((Font.Characters (17).Bytes), -- 0 20 | (Font.Characters (18).Bytes), -- 1 21 | (Font.Characters (19).Bytes), -- 2 22 | (Font.Characters (20).Bytes), -- 3 23 | (Font.Characters (21).Bytes), -- 4 24 | (Font.Characters (22).Bytes), -- 5 25 | (Font.Characters (23).Bytes), -- 6 26 | (Font.Characters (24).Bytes), -- 7 27 | (Font.Characters (25).Bytes), -- 8 28 | (Font.Characters (26).Bytes), -- 9 29 | (Font.Characters (34).Bytes), -- A 30 | (Font.Characters (35).Bytes), -- B 31 | (Font.Characters (36).Bytes), -- C 32 | (Font.Characters (37).Bytes), -- D 33 | (Font.Characters (38).Bytes), -- E 34 | (Font.Characters (39).Bytes) -- F 35 | ); 36 | 37 | ----------------------------------------------------------------------- 38 | -- shows the value on the left display 39 | ----------------------------------------------------------------------- 40 | procedure Show_Left (Number : HAL.UInt4); 41 | 42 | ----------------------------------------------------------------------- 43 | -- shows the value on the right display 44 | ----------------------------------------------------------------------- 45 | procedure Show_Right (Number : HAL.UInt4); 46 | 47 | ----------------------------------------------------------------------- 48 | -- see .ads 49 | ----------------------------------------------------------------------- 50 | procedure Show (Number : HAL.UInt8) is 51 | use HAL; 52 | 53 | Right_Block_Value : HAL.UInt4; 54 | Left_Block_Value : HAL.UInt4; 55 | 56 | begin 57 | Left_Block_Value := HAL.UInt4 (Shift_Right (Number, 4)); 58 | Show_Left (Number => Left_Block_Value); 59 | 60 | Right_Block_Value := HAL.UInt4 (Number and 16#0F#); 61 | Show_Right (Number => Right_Block_Value); 62 | PLDM. 63 | Write_Byte_Data ( 64 | PLDM.Update, 1); 65 | end Show; 66 | 67 | ----------------------------------------------------------------------- 68 | -- converts the 69 | -- Font.Matrix_Array into the required PLDM.Display_Matrix format 70 | ----------------------------------------------------------------------- 71 | function Convert (FMA : Font.Matrix_Array) 72 | return PLDM.Display_Matrix; 73 | 74 | ----------------------------------------------------------------------- 75 | -- shows the value on the left display 76 | ----------------------------------------------------------------------- 77 | procedure Show_Left (Number : HAL.UInt4) is 78 | Letter_Array : Font.Matrix_Array; 79 | DM : PLDM.Display_Matrix; 80 | begin 81 | -- left letter 82 | Letter_Array := All_Letters (Number); 83 | DM := Convert (Letter_Array); 84 | PLDM.Write_Block_Data (PLDM.Matrix_L, PLDM.To_Left_Matrix (DM)); 85 | end Show_Left; 86 | 87 | ----------------------------------------------------------------------- 88 | -- shows the value on the right display 89 | ----------------------------------------------------------------------- 90 | procedure Show_Right (Number : HAL.UInt4) is 91 | Letter_Array : Font.Matrix_Array; 92 | DM : PLDM.Display_Matrix; 93 | begin 94 | -- right letter 95 | Letter_Array := All_Letters (Number); 96 | DM := Convert (Letter_Array); 97 | PLDM.Write_Block_Data (PLDM.Matrix_R, PLDM.To_Right_Matrix (DM)); 98 | end Show_Right; 99 | 100 | ----------------------------------------------------------------------- 101 | -- converts the 102 | -- Font.Matrix_Array into the required PLDM.Display_Matrix format 103 | ----------------------------------------------------------------------- 104 | function Convert (FMA : Font.Matrix_Array) return PLDM.Display_Matrix is 105 | Mask : HAL.UInt8; 106 | Column : Integer; 107 | Result : PLDM.Display_Matrix := (others => (others => False)); 108 | use HAL; 109 | begin 110 | Mask := 1; 111 | for Row in PLDM.Display_Matrix'First (2) 112 | .. 113 | PLDM.Display_Matrix'Last (2) loop 114 | Column := PLDM.Display_Matrix'First (1); 115 | for FMA_Column in FMA'First .. FMA'Last loop 116 | Result (Column, Row) := (FMA (FMA_Column) and Mask) /= 0; 117 | Column := Column + 1; 118 | end loop; 119 | Mask := Shift_Left (Mask, 1); 120 | end loop; 121 | return Result; 122 | end Convert; 123 | 124 | end Hex_2Digits_Display; 125 | -------------------------------------------------------------------------------- /src/hex_2digits_display.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- Represents an 5x7 Matrix Pimoroni display. 4 | -- This package can only display a hex number on such a 5x7 matrix. 5 | -- 6 | --=========================================================================== 7 | -- 8 | -- Copyright 2021 (C) Holger Rodriguez 9 | -- 10 | -- SPDX-License-Identifier: BSD-3-Clause 11 | -- 12 | with HAL.I2C; 13 | 14 | generic 15 | ------------------------------------------------------ 16 | -- Define the port, where the display is connected to 17 | ------------------------------------------------------ 18 | I2C : HAL.I2C.Any_I2C_Port; 19 | ---------------------------------------------------- 20 | -- Define the address of the display on the I2C bus 21 | ---------------------------------------------------- 22 | Address : HAL.I2C.I2C_Address; 23 | 24 | package Hex_2Digits_Display is 25 | 26 | ----------------------------------------------------------------------- 27 | -- Shows the 28 | -- Number 29 | -- on the display having the 30 | -- Address 31 | -- on the 32 | -- I2C 33 | -- bus 34 | -- as defined above 35 | procedure Show (Number : HAL.UInt8); 36 | 37 | end Hex_2Digits_Display; 38 | -------------------------------------------------------------------------------- /src/initializer.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Holger Rodriguez 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | with RP.Device; 7 | with RP.Clock; 8 | with RP.GPIO; 9 | with RP.I2C_Master; 10 | 11 | with ItsyBitsy; 12 | 13 | with Transport.Serial; 14 | 15 | with Matrix_Area_Word; 16 | with Matrix_Area_Double_Word; 17 | 18 | package body Initializer is 19 | 20 | -------------------------------------------------------------------------- 21 | -- Initializes the device 22 | -------------------------------------------------------------------------- 23 | procedure Initialize_Device; 24 | -------------------------------------------------------------------------- 25 | -- Initializes I2C Bus 0 26 | -------------------------------------------------------------------------- 27 | procedure Initialize_I2C_0; 28 | -------------------------------------------------------------------------- 29 | -- Initializes I2C Bus 1 30 | -------------------------------------------------------------------------- 31 | procedure Initialize_I2C_1; 32 | 33 | -------------------------------------------------------------------------- 34 | -- see .ads 35 | -------------------------------------------------------------------------- 36 | procedure Initialize_All is 37 | begin 38 | Initialize_Device; 39 | 40 | ItsyBitsy.LED.Configure (RP.GPIO.Output); 41 | 42 | Initialize_I2C_0; 43 | Initialize_I2C_1; 44 | 45 | Matrix_Area_Word.Initialize; 46 | Matrix_Area_Double_Word.Initialize; 47 | 48 | Transport.Serial.Initialize; 49 | end Initialize_All; 50 | 51 | -------------------------------------------------------------------------- 52 | -- see above 53 | -------------------------------------------------------------------------- 54 | procedure Initialize_Device is 55 | begin 56 | RP.Clock.Initialize (ItsyBitsy.XOSC_Frequency); 57 | RP.Clock.Enable (RP.Clock.PERI); 58 | RP.Device.Timer.Enable; 59 | end Initialize_Device; 60 | 61 | -------------------------------------------------------------------------- 62 | -- see above 63 | -------------------------------------------------------------------------- 64 | procedure Initialize_I2C_0 is 65 | SDA : RP.GPIO.GPIO_Point renames ItsyBitsy.D10; 66 | SCL : RP.GPIO.GPIO_Point renames ItsyBitsy.D11; 67 | I2C_0_0 : RP.I2C_Master.I2C_Master_Port renames RP.Device.I2C_0; 68 | begin 69 | SDA.Configure (RP.GPIO.Output, RP.GPIO.Pull_Up, RP.GPIO.I2C); 70 | SCL.Configure (RP.GPIO.Output, RP.GPIO.Pull_Up, RP.GPIO.I2C); 71 | I2C_0_0.Enable (100_000); 72 | end Initialize_I2C_0; 73 | 74 | -------------------------------------------------------------------------- 75 | -- see above 76 | -------------------------------------------------------------------------- 77 | procedure Initialize_I2C_1 is 78 | SDA : RP.GPIO.GPIO_Point renames ItsyBitsy.SDA; 79 | SCL : RP.GPIO.GPIO_Point renames ItsyBitsy.SCL; 80 | I2C_1 : RP.I2C_Master.I2C_Master_Port renames ItsyBitsy.I2C; 81 | begin 82 | SDA.Configure (RP.GPIO.Output, RP.GPIO.Pull_Up, RP.GPIO.I2C); 83 | SCL.Configure (RP.GPIO.Output, RP.GPIO.Pull_Up, RP.GPIO.I2C); 84 | I2C_1.Enable (100_000); 85 | end Initialize_I2C_1; 86 | 87 | end Initializer; 88 | -------------------------------------------------------------------------------- /src/initializer.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package ensures, that all necessary initialization takes place 4 | -- 5 | --=========================================================================== 6 | -- 7 | -- Copyright 2021 (C) Holger Rodriguez 8 | -- 9 | -- SPDX-License-Identifier: BSD-3-Clause 10 | -- 11 | package Initializer is 12 | 13 | -------------------------------------------------------------------------- 14 | -- Initialize the whole system 15 | -------------------------------------------------------------------------- 16 | procedure Initialize_All; 17 | 18 | end Initializer; 19 | -------------------------------------------------------------------------------- /src/itsybitsy.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package represents the definitions for 4 | -- all ports 5 | -- all standard definitions 6 | -- for the ItstyBitsy board 7 | -- 8 | --=========================================================================== 9 | -- 10 | -- Copyright 2021 (C) Holger Rodriguez 11 | -- 12 | -- SPDX-License-Identifier: BSD-3-Clause 13 | -- 14 | with RP.GPIO; 15 | with RP.I2C_Master; 16 | with RP.Device; 17 | with RP.Clock; 18 | with RP.UART; 19 | with RP.SPI; 20 | 21 | package ItsyBitsy is 22 | 23 | ------------------------------------------------------ 24 | -- Just the list of all GPIO pins for the RP2040 chip 25 | -- The commented lines do not have a board connection 26 | ------------------------------------------------------ 27 | GP0 : aliased RP.GPIO.GPIO_Point := (Pin => 0); 28 | GP1 : aliased RP.GPIO.GPIO_Point := (Pin => 1); 29 | GP2 : aliased RP.GPIO.GPIO_Point := (Pin => 2); 30 | GP3 : aliased RP.GPIO.GPIO_Point := (Pin => 3); 31 | GP4 : aliased RP.GPIO.GPIO_Point := (Pin => 4); 32 | GP5 : aliased RP.GPIO.GPIO_Point := (Pin => 5); 33 | GP6 : aliased RP.GPIO.GPIO_Point := (Pin => 6); 34 | GP7 : aliased RP.GPIO.GPIO_Point := (Pin => 7); 35 | GP8 : aliased RP.GPIO.GPIO_Point := (Pin => 8); 36 | GP9 : aliased RP.GPIO.GPIO_Point := (Pin => 9); 37 | GP10 : aliased RP.GPIO.GPIO_Point := (Pin => 10); 38 | GP11 : aliased RP.GPIO.GPIO_Point := (Pin => 11); 39 | GP12 : aliased RP.GPIO.GPIO_Point := (Pin => 12); 40 | GP13 : aliased RP.GPIO.GPIO_Point := (Pin => 13); 41 | GP14 : aliased RP.GPIO.GPIO_Point := (Pin => 14); 42 | -- GP15 : aliased RP.GPIO.GPIO_Point := (Pin => 15); 43 | GP16 : aliased RP.GPIO.GPIO_Point := (Pin => 16); 44 | GP17 : aliased RP.GPIO.GPIO_Point := (Pin => 17); 45 | GP18 : aliased RP.GPIO.GPIO_Point := (Pin => 18); 46 | GP19 : aliased RP.GPIO.GPIO_Point := (Pin => 19); 47 | GP20 : aliased RP.GPIO.GPIO_Point := (Pin => 20); 48 | -- GP21 : aliased RP.GPIO.GPIO_Point := (Pin => 21); 49 | -- GP22 : aliased RP.GPIO.GPIO_Point := (Pin => 22); 50 | -- GP23 : aliased RP.GPIO.GPIO_Point := (Pin => 23); 51 | GP24 : aliased RP.GPIO.GPIO_Point := (Pin => 24); 52 | GP25 : aliased RP.GPIO.GPIO_Point := (Pin => 25); 53 | GP26 : aliased RP.GPIO.GPIO_Point := (Pin => 26); 54 | GP27 : aliased RP.GPIO.GPIO_Point := (Pin => 27); 55 | GP28 : aliased RP.GPIO.GPIO_Point := (Pin => 28); 56 | GP29 : aliased RP.GPIO.GPIO_Point := (Pin => 29); 57 | 58 | ----------------------------------------------- 59 | -- Order is counter clockwise around the chip, 60 | -- if you look at it holding the USB port top 61 | -- the identifiers are the ones on the board 62 | ----------------------------------------------- 63 | 64 | -------------------- 65 | -- Left row of pins 66 | -------------------- 67 | A0 : aliased RP.GPIO.GPIO_Point := GP26; 68 | A1 : aliased RP.GPIO.GPIO_Point := GP27; 69 | A2 : aliased RP.GPIO.GPIO_Point := GP28; 70 | A3 : aliased RP.GPIO.GPIO_Point := GP29; 71 | D24 : aliased RP.GPIO.GPIO_Point := GP24; 72 | D25 : aliased RP.GPIO.GPIO_Point := GP25; 73 | SCK : aliased RP.GPIO.GPIO_Point := GP18; 74 | MOSI : aliased RP.GPIO.GPIO_Point := GP19; 75 | MISO : aliased RP.GPIO.GPIO_Point := GP20; 76 | D2 : aliased RP.GPIO.GPIO_Point := GP12; 77 | 78 | ---------------------- 79 | -- Bottom row of pins 80 | ---------------------- 81 | D4 : aliased RP.GPIO.GPIO_Point := GP4; 82 | D3 : aliased RP.GPIO.GPIO_Point := GP5; 83 | 84 | --------------------- 85 | -- Right row of pins 86 | --------------------- 87 | RX : aliased RP.GPIO.GPIO_Point := GP1; 88 | TX : aliased RP.GPIO.GPIO_Point := GP0; 89 | SDA : aliased RP.GPIO.GPIO_Point := GP2; 90 | SCL : aliased RP.GPIO.GPIO_Point := GP3; 91 | D5 : aliased RP.GPIO.GPIO_Point := GP14; 92 | D7 : aliased RP.GPIO.GPIO_Point := GP6; 93 | D9 : aliased RP.GPIO.GPIO_Point := GP7; 94 | D10 : aliased RP.GPIO.GPIO_Point := GP8; 95 | D11 : aliased RP.GPIO.GPIO_Point := GP9; 96 | D12 : aliased RP.GPIO.GPIO_Point := GP10; 97 | D13 : aliased RP.GPIO.GPIO_Point := GP11; 98 | 99 | NEOPIXEL : aliased RP.GPIO.GPIO_Point := GP16; 100 | 101 | XOSC_Frequency : RP.Clock.XOSC_Hertz := 12_000_000; 102 | 103 | LED : RP.GPIO.GPIO_Point renames D13; 104 | 105 | SPI : RP.SPI.SPI_Port renames RP.Device.SPI_0; 106 | I2C : RP.I2C_Master.I2C_Master_Port renames RP.Device.I2C_1; 107 | UART : RP.UART.UART_Port renames RP.Device.UART_0; 108 | 109 | end ItsyBitsy; 110 | -------------------------------------------------------------------------------- /src/led_control.adb: -------------------------------------------------------------------------------- 1 | .-- Copyright 2021 (C) Holger Rodriguez 2 | -- 3 | -- SPDX-License-Identifier: BSD-3-Clause 4 | -- 5 | with RP.Device; 6 | with RP.GPIO; 7 | with ItsyBitsy; 8 | 9 | package body LED_Control is 10 | subtype LED_Type is RP.GPIO.GPIO_Point; 11 | 12 | ----------------------------------------------------------------------- 13 | -- All Red LED related definitions 14 | ----------------------------------------------------------------------- 15 | LED_0_Red : LED_Type renames ItsyBitsy.GP26; 16 | procedure LED_0_Red_Off is 17 | begin 18 | LED_0_Red.Clear; 19 | end LED_0_Red_Off; 20 | 21 | procedure LED_0_Red_On is 22 | begin 23 | LED_0_Red.Set; 24 | end LED_0_Red_On; 25 | 26 | procedure LED_0_Red_Toggle is 27 | begin 28 | LED_0_Red.Toggle; 29 | end LED_0_Red_Toggle; 30 | 31 | ----------------------------------------------------------------------- 32 | -- All Amber LED related definitions 33 | ----------------------------------------------------------------------- 34 | LED_0_Amber : LED_Type renames ItsyBitsy.GP27; 35 | procedure LED_0_Amber_Off is 36 | begin 37 | LED_0_Amber.Clear; 38 | end LED_0_Amber_Off; 39 | 40 | procedure LED_0_Amber_On is 41 | begin 42 | LED_0_Amber.Set; 43 | end LED_0_Amber_On; 44 | 45 | procedure LED_0_Amber_Toggle is 46 | begin 47 | LED_0_Amber.Toggle; 48 | end LED_0_Amber_Toggle; 49 | 50 | ----------------------------------------------------------------------- 51 | -- All Green LED related definitions 52 | ----------------------------------------------------------------------- 53 | LED_0_Green : LED_Type renames ItsyBitsy.GP28; 54 | procedure LED_0_Green_Off is 55 | begin 56 | LED_0_Green.Clear; 57 | end LED_0_Green_Off; 58 | 59 | procedure LED_0_Green_On is 60 | begin 61 | LED_0_Green.Set; 62 | end LED_0_Green_On; 63 | 64 | procedure LED_0_Green_Toggle is 65 | begin 66 | LED_0_Green.Toggle; 67 | end LED_0_Green_Toggle; 68 | 69 | ----------------------------------------------------------------------- 70 | -- All White LED related definitions 71 | ----------------------------------------------------------------------- 72 | LED_0_White : LED_Type renames ItsyBitsy.GP29; 73 | procedure LED_0_White_Off is 74 | begin 75 | LED_0_White.Clear; 76 | end LED_0_White_Off; 77 | 78 | procedure LED_0_White_On is 79 | begin 80 | LED_0_White.Set; 81 | end LED_0_White_On; 82 | 83 | procedure LED_0_White_Toggle is 84 | begin 85 | LED_0_White.Toggle; 86 | end LED_0_White_Toggle; 87 | 88 | ----------------------------------------------------------------------- 89 | -- All Blue LED related definitions 90 | ----------------------------------------------------------------------- 91 | LED_0_Blue : LED_Type renames ItsyBitsy.GP24; 92 | procedure LED_0_Blue_Off is 93 | begin 94 | LED_0_Blue.Clear; 95 | end LED_0_Blue_Off; 96 | 97 | procedure LED_0_Blue_On is 98 | begin 99 | LED_0_Blue.Set; 100 | end LED_0_Blue_On; 101 | 102 | procedure LED_0_Blue_Toggle is 103 | begin 104 | LED_0_Blue.Toggle; 105 | end LED_0_Blue_Toggle; 106 | 107 | ----------------------------------------------------------------------- 108 | -- see .ads 109 | ----------------------------------------------------------------------- 110 | procedure Toggle_All_LEDs (Delay_Between_In_Milliseconds : Integer 111 | := WAIT_FOR_NEXT_LED) is 112 | begin 113 | LED_0_Red_Toggle; 114 | RP.Device.Timer.Delay_Milliseconds (Delay_Between_In_Milliseconds); 115 | LED_0_Amber_Toggle; 116 | RP.Device.Timer.Delay_Milliseconds (Delay_Between_In_Milliseconds); 117 | LED_0_Green_Toggle; 118 | RP.Device.Timer.Delay_Milliseconds (Delay_Between_In_Milliseconds); 119 | LED_0_White_Toggle; 120 | RP.Device.Timer.Delay_Milliseconds (Delay_Between_In_Milliseconds); 121 | LED_0_Blue_Toggle; 122 | RP.Device.Timer.Delay_Milliseconds (Delay_Between_In_Milliseconds); 123 | end Toggle_All_LEDs; 124 | 125 | begin 126 | LED_0_Red.Configure (RP.GPIO.Output); 127 | LED_0_Amber.Configure (RP.GPIO.Output); 128 | LED_0_Green.Configure (RP.GPIO.Output); 129 | LED_0_White.Configure (RP.GPIO.Output); 130 | LED_0_Blue.Configure (RP.GPIO.Output); 131 | end LED_Control; 132 | -------------------------------------------------------------------------------- /src/led_control.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package offers the control for the LEDs 4 | -- 5 | --=========================================================================== 6 | -- Copyright 2021 (C) Holger Rodriguez 7 | -- 8 | -- SPDX-License-Identifier: BSD-3-Clause 9 | -- 10 | package LED_Control is 11 | 12 | -------------------------------------------------------------------------- 13 | -- All Red LED related controls 14 | -------------------------------------------------------------------------- 15 | procedure LED_0_Red_Off; 16 | procedure LED_0_Red_On; 17 | procedure LED_0_Red_Toggle; 18 | 19 | -------------------------------------------------------------------------- 20 | -- All Amber LED related controls 21 | -------------------------------------------------------------------------- 22 | procedure LED_0_Amber_Off; 23 | procedure LED_0_Amber_On; 24 | procedure LED_0_Amber_Toggle; 25 | 26 | -------------------------------------------------------------------------- 27 | -- All Green LED related controls 28 | -------------------------------------------------------------------------- 29 | procedure LED_0_Green_Off; 30 | procedure LED_0_Green_On; 31 | procedure LED_0_Green_Toggle; 32 | 33 | -------------------------------------------------------------------------- 34 | -- All White LED related controls 35 | -------------------------------------------------------------------------- 36 | procedure LED_0_White_Off; 37 | procedure LED_0_White_On; 38 | procedure LED_0_White_Toggle; 39 | 40 | -------------------------------------------------------------------------- 41 | -- All Blue LED related controls 42 | -------------------------------------------------------------------------- 43 | procedure LED_0_Blue_Off; 44 | procedure LED_0_Blue_On; 45 | procedure LED_0_Blue_Toggle; 46 | 47 | -------------------------------------------------------------------------- 48 | -- This is just here for the sole reason, that all LEDs can be toggled 49 | -- for a quick visual check 50 | -------------------------------------------------------------------------- 51 | WAIT_FOR_NEXT_LED : constant Integer := 25; 52 | procedure Toggle_All_LEDs (Delay_Between_In_Milliseconds : Integer 53 | := WAIT_FOR_NEXT_LED); 54 | 55 | end LED_Control; 56 | -------------------------------------------------------------------------------- /src/matrix_area_double_word.adb: -------------------------------------------------------------------------------- 1 | with Pimoroni_LED_Dot_Matrix; 2 | 3 | package body Matrix_Area_Double_Word is 4 | 5 | procedure Initialize is 6 | package PLDM_0 is new Pimoroni_LED_Dot_Matrix (Byte_0_I2C, 7 | Byte_0_Address); 8 | package PLDM_1 is new Pimoroni_LED_Dot_Matrix (Byte_1_I2C, 9 | Byte_1_Address); 10 | package PLDM_2 is new Pimoroni_LED_Dot_Matrix (Byte_2_I2C, 11 | Byte_2_Address); 12 | package PLDM_3 is new Pimoroni_LED_Dot_Matrix (Byte_3_I2C, 13 | Byte_3_Address); 14 | 15 | begin 16 | PLDM_0.Initialize; 17 | PLDM_1.Initialize; 18 | PLDM_2.Initialize; 19 | PLDM_3.Initialize; 20 | end Initialize; 21 | 22 | end Matrix_Area_Double_Word; 23 | -------------------------------------------------------------------------------- /src/matrix_area_double_word.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package defines the four 5x7 matrix elements used for the 4 | -- DOUBLE WORD sized display capability 5 | -- 6 | --=========================================================================== 7 | -- Copyright 2021 (C) Holger Rodriguez 8 | -- 9 | -- SPDX-License-Identifier: BSD-3-Clause 10 | -- 11 | with HAL; use HAL; 12 | with HAL.I2C; 13 | 14 | with RP.I2C_Master; 15 | with RP.Device; 16 | 17 | with ItsyBitsy; 18 | 19 | with Hex_2Digits_Display; 20 | 21 | package Matrix_Area_Double_Word is 22 | 23 | I2C_1 : RP.I2C_Master.I2C_Master_Port renames ItsyBitsy.I2C; 24 | 25 | -------------------------------------------------------------------------- 26 | -- Byte 1: this display is in the right side of the two displays 27 | -- represents the higher byte of the lower word 28 | -------------------------------------------------------------------------- 29 | Byte_0_I2C : HAL.I2C.Any_I2C_Port := I2C_1'Access; 30 | Byte_0_Address : HAL.I2C.I2C_Address := 16#63# * 2; 31 | package Byte_0 is new 32 | Hex_2Digits_Display (Byte_0_I2C, Byte_0_Address); 33 | 34 | I2C_0 : RP.I2C_Master.I2C_Master_Port renames RP.Device.I2C_0; 35 | 36 | -------------------------------------------------------------------------- 37 | -- Byte 1: this display is in the right side of the two displays 38 | -- represents the higher byte of the lower word 39 | -------------------------------------------------------------------------- 40 | Byte_1_I2C : HAL.I2C.Any_I2C_Port := I2C_0'Access; 41 | Byte_1_Address : HAL.I2C.I2C_Address := 16#61# * 2; 42 | package Byte_1 is new 43 | Hex_2Digits_Display (Byte_1_I2C, Byte_1_Address); 44 | 45 | -------------------------------------------------------------------------- 46 | -- Byte 2: this display is in the right side of the two displays 47 | -- represents the lower byte of the higher word 48 | -------------------------------------------------------------------------- 49 | Byte_2_I2C : HAL.I2C.Any_I2C_Port := I2C_0'Access; 50 | Byte_2_Address : HAL.I2C.I2C_Address := 16#62# * 2; 51 | package Byte_2 is new 52 | Hex_2Digits_Display (Byte_2_I2C, Byte_2_Address); 53 | 54 | -------------------------------------------------------------------------- 55 | -- Byte 3: this display is in the left side of the two displays 56 | -- represents the higher byte of the higher word 57 | -------------------------------------------------------------------------- 58 | Byte_3_I2C : HAL.I2C.Any_I2C_Port := I2C_0'Access; 59 | Byte_3_Address : HAL.I2C.I2C_Address := 16#63# * 2; 60 | package Byte_3 is new 61 | Hex_2Digits_Display (Byte_3_I2C, Byte_3_Address); 62 | 63 | -------------------------------------------------------------------------- 64 | -- Initializes the Double Word Matrix Block 65 | -- Must be called before anything else regarding the matrix. 66 | -------------------------------------------------------------------------- 67 | procedure Initialize; 68 | 69 | end Matrix_Area_Double_Word; 70 | -------------------------------------------------------------------------------- /src/matrix_area_word.adb: -------------------------------------------------------------------------------- 1 | with RP.GPIO; 2 | with RP.I2C_Master; 3 | 4 | with Pimoroni_LED_Dot_Matrix; 5 | 6 | package body Matrix_Area_Word is 7 | 8 | procedure Initialize is 9 | package PLDM_0 is new Pimoroni_LED_Dot_Matrix (Byte_0_I2C, 10 | Byte_0_Address); 11 | package PLDM_1 is new Pimoroni_LED_Dot_Matrix (Byte_1_I2C, 12 | Byte_1_Address); 13 | begin 14 | PLDM_0.Initialize; 15 | PLDM_1.Initialize; 16 | end Initialize; 17 | 18 | end Matrix_Area_Word; 19 | -------------------------------------------------------------------------------- /src/matrix_area_word.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package defines the two 5x7 matrix elements used for the WORD 4 | -- sized display capability 5 | -- 6 | --=========================================================================== 7 | -- Copyright 2021 (C) Holger Rodriguez 8 | -- 9 | -- SPDX-License-Identifier: BSD-3-Clause 10 | -- 11 | with HAL; use HAL; 12 | with HAL.I2C; 13 | 14 | with ItsyBitsy; 15 | 16 | with Hex_2Digits_Display; 17 | 18 | package Matrix_Area_Word is 19 | 20 | -------------------------------------------------------------------------- 21 | -- Byte 0: this display is in the right side of the two displays 22 | -- represents the lower byte of the word 23 | -------------------------------------------------------------------------- 24 | Byte_0_I2C : HAL.I2C.Any_I2C_Port := ItsyBitsy.I2C'Access; 25 | Byte_0_Address : HAL.I2C.I2C_Address := 16#61# * 2; 26 | package Byte_0 is new 27 | Hex_2Digits_Display (Byte_0_I2C, Byte_0_Address); 28 | 29 | -------------------------------------------------------------------------- 30 | -- Byte 1: this display is in the left side of the two displays 31 | -- represents the higher byte of the word 32 | -------------------------------------------------------------------------- 33 | Byte_1_I2C : HAL.I2C.Any_I2C_Port := ItsyBitsy.I2C'Access; 34 | Byte_1_Address : HAL.I2C.I2C_Address := 16#62# * 2; 35 | package Byte_1 is new 36 | Hex_2Digits_Display (Byte_1_I2C, Byte_1_Address); 37 | 38 | -------------------------------------------------------------------------- 39 | -- Initializes the Word Matrix Block 40 | -- Must be called before anything else regarding the matrix. 41 | -------------------------------------------------------------------------- 42 | procedure Initialize; 43 | 44 | end Matrix_Area_Word; 45 | -------------------------------------------------------------------------------- /src/pimoroni_led_dot_matrix.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Jeremy Grosser 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | with RP.Device; 7 | 8 | package body Pimoroni_LED_Dot_Matrix is 9 | 10 | procedure Initialize is 11 | Init_Options : constant HAL.UInt8 := 2#00001110#; 12 | -- 1110 = 35 mA; 0000 = 40 mA 13 | Init_Mode : constant HAL.UInt8 := 2#00011000#; 14 | begin 15 | Write_Byte_Data (Reset, 16#FF#); 16 | Write_Byte_Data (Mode, Init_Mode); 17 | Write_Byte_Data (Options, Init_Options); 18 | Write_Byte_Data (Brightness, 255); 19 | end Initialize; 20 | 21 | procedure Write_Byte_Data (Cmd : Command; 22 | B : HAL.UInt8) is 23 | use HAL.I2C; 24 | Data : constant I2C_Data (1 .. 2) := (Command'Enum_Rep (Cmd), B); 25 | Status : I2C_Status; 26 | begin 27 | Matrix_I2CPort.Master_Transmit (Matrix_Address, Data, Status); 28 | RP.Device.Timer.Delay_Milliseconds (10); 29 | end Write_Byte_Data; 30 | 31 | procedure Write_Block_Data (Cmd : Command; 32 | Data : HAL.UInt8_Array) is 33 | use HAL.I2C; 34 | D : I2C_Data (1 .. Data'Length + 1) 35 | := (1 => Command'Enum_Rep (Cmd), others => 0); 36 | Status : I2C_Status; 37 | begin 38 | D (2 .. D'Last) := Data; 39 | Matrix_I2CPort.Master_Transmit (Matrix_Address, D, Status); 40 | RP.Device.Timer.Delay_Milliseconds (10); 41 | end Write_Block_Data; 42 | 43 | function To_Left_Matrix (DM : Display_Matrix; 44 | DP : Boolean := False) return Matrix_Array is 45 | U : Matrix_Bits := 0; 46 | begin 47 | for Row in DM'Range (1) loop 48 | for Column in DM'Range (2) loop 49 | if DM (Row, Column) then 50 | U := U or Shift_Left (1, (Row * 8) + Column); 51 | end if; 52 | end loop; 53 | end loop; 54 | if DP then 55 | U := U or Shift_Left (1, 62); 56 | end if; 57 | return Convert (U); 58 | end To_Left_Matrix; 59 | 60 | function To_Right_Matrix (DM : Display_Matrix; 61 | DP : Boolean := False) return Matrix_Array is 62 | U : Matrix_Bits := 0; 63 | begin 64 | for Row in DM'Range (1) loop 65 | for Column in DM'Range (2) loop 66 | if DM (Row, Column) then 67 | U := U or Shift_Left (1, (Column * 8) + Row); 68 | end if; 69 | end loop; 70 | end loop; 71 | if DP then 72 | U := U or Shift_Left (1, 55); 73 | end if; 74 | return Convert (U); 75 | end To_Right_Matrix; 76 | 77 | end Pimoroni_LED_Dot_Matrix; 78 | -------------------------------------------------------------------------------- /src/pimoroni_led_dot_matrix.ads: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Jeremy Grosser 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | -- This is a driver for the Pimoroni PIM526 LED Dot Matrix Breakout using an 7 | -- IS31FL3730 I2C LED matrix driver to control two LTP-305 5x7 matrices. 8 | -- https://shop.pimoroni.com/products/led-dot-matrix-breakout 9 | -- 10 | -- The breakout board includes pullups on the SDA and SCL pins, internal 11 | -- pullups are unnecessary. 12 | -- 13 | with Ada.Unchecked_Conversion; 14 | with Interfaces; 15 | with HAL.I2C; 16 | 17 | generic 18 | Matrix_I2CPort : HAL.I2C.Any_I2C_Port; 19 | Matrix_Address : HAL.I2C.I2C_Address; 20 | 21 | package Pimoroni_LED_Dot_Matrix is 22 | 23 | Default_Address : constant HAL.I2C.I2C_Address := 16#61#; 24 | 25 | subtype Display_Column is Integer range 0 .. 4; 26 | subtype Display_Row is Integer range 0 .. 6; 27 | type Display_Matrix is array (Display_Column, Display_Row) of Boolean; 28 | 29 | type Matrix_Bits is new Interfaces.Unsigned_64; 30 | subtype Matrix_Array is HAL.UInt8_Array (1 .. 8); 31 | 32 | type Command is (Mode, 33 | Matrix_R, 34 | Update, 35 | Options, 36 | Matrix_L, 37 | Brightness, 38 | Reset) 39 | with Size => 8; 40 | 41 | for Command use ( 42 | Mode => 16#00#, 43 | Matrix_R => 16#01#, 44 | Update => 16#0C#, 45 | Options => 16#0D#, 46 | Matrix_L => 16#0E#, 47 | Brightness => 16#19#, 48 | Reset => 16#FF# 49 | ); 50 | 51 | type Outputs is (Matrix_1, Matrix_2, Both) 52 | with Size => 2; 53 | 54 | for Outputs use 55 | (Matrix_1 => 2#00#, 56 | Matrix_2 => 2#01#, 57 | Both => 2#11#); 58 | 59 | type Matrix_Modes is (Matrix_8x8, Matrix_7x9, Matrix_6x10, Matrix_5x11) 60 | with Size => 2; 61 | 62 | for Matrix_Modes use 63 | (Matrix_8x8 => 2#00#, 64 | Matrix_7x9 => 2#01#, 65 | Matrix_6x10 => 2#10#, 66 | Matrix_5x11 => 2#11#); 67 | 68 | type Config_Register is record 69 | Shutdown : Boolean := False; 70 | Reserved : Boolean := False; 71 | Output : Outputs := Both; 72 | Audio_In : Boolean := False; 73 | Matrix_Mode : Matrix_Modes := Matrix_8x8; 74 | end record 75 | with Size => 8; 76 | 77 | for Config_Register use record 78 | Shutdown at 0 range 7 .. 7; 79 | Reserved at 0 range 5 .. 6; 80 | Output at 0 range 3 .. 4; 81 | Audio_In at 0 range 2 .. 2; 82 | Matrix_Mode at 0 range 0 .. 1; 83 | end record; 84 | 85 | procedure Initialize; 86 | 87 | function Convert is new Ada.Unchecked_Conversion 88 | (Source => Matrix_Bits, 89 | Target => Matrix_Array); 90 | 91 | function Convert is new Ada.Unchecked_Conversion 92 | (Source => Config_Register, 93 | Target => HAL.UInt8); 94 | 95 | procedure Write_Byte_Data (Cmd : Command; 96 | B : HAL.UInt8); 97 | 98 | procedure Write_Block_Data (Cmd : Command; 99 | Data : HAL.UInt8_Array); 100 | 101 | function To_Left_Matrix (DM : Display_Matrix; 102 | DP : Boolean := False) return Matrix_Array; 103 | 104 | function To_Right_Matrix (DM : Display_Matrix; 105 | DP : Boolean := False) return Matrix_Array; 106 | 107 | end Pimoroni_LED_Dot_Matrix; 108 | -------------------------------------------------------------------------------- /src/transport-serial.adb: -------------------------------------------------------------------------------- 1 | -- 2 | -- Copyright 2021 (C) Holger Rodriguez 3 | -- 4 | -- SPDX-License-Identifier: BSD-3-Clause 5 | -- 6 | with HAL.UART; 7 | 8 | with RP.GPIO; 9 | with RP.UART; 10 | with ItsyBitsy; 11 | 12 | package body Transport.Serial is 13 | 14 | UART_TX : RP.GPIO.GPIO_Point renames ItsyBitsy.TX; 15 | UART_RX : RP.GPIO.GPIO_Point renames ItsyBitsy.RX; 16 | 17 | Port : RP.UART.UART_Port renames ItsyBitsy.UART; 18 | 19 | Initialized : Boolean := False; 20 | 21 | -------------------------------------------------------------------------- 22 | -- Gets a character from the serial line. 23 | -- If the timeout is > 0, and no character received inside the 24 | -- time range defined, it will return 25 | -- ASCII.NUL 26 | -- This enables the caller to not being blocked 27 | -------------------------------------------------------------------------- 28 | function Get (Timeout : Natural := 0) return Character; 29 | 30 | procedure Initialize is 31 | Console_Config : constant RP.UART.UART_Configuration 32 | := (Baud => 115_200, others => <>); 33 | begin 34 | if Initialized then 35 | return; 36 | end if; 37 | 38 | UART_TX.Configure (Mode => RP.GPIO.Output, 39 | Pull => RP.GPIO.Pull_Up, 40 | Func => RP.GPIO.UART); 41 | UART_RX.Configure (Mode => RP.GPIO.Input, 42 | Pull => RP.GPIO.Floating, 43 | Func => RP.GPIO.UART); 44 | Port.Configure (Config => Console_Config); 45 | Initialized := True; 46 | end Initialize; 47 | 48 | function Get_Area_Selector return Area_Selector is 49 | Selector : constant Character := Get (100); 50 | begin 51 | if Selector = 'L' then 52 | return Transport.Led; 53 | elsif Selector = 'M' then 54 | return Transport.Matrix; 55 | else 56 | return Transport.None; 57 | end if; 58 | end Get_Area_Selector; 59 | 60 | function Get_LED_Instruction return Evaluate.LEDs.LED_Instruction is 61 | RetVal : Evaluate.LEDs.LED_Instruction; 62 | begin 63 | for I in RetVal'First .. RetVal'Last loop 64 | RetVal (I) := Get; 65 | end loop; 66 | return RetVal; 67 | end Get_LED_Instruction; 68 | 69 | function Get_Matrix_Instruction 70 | return Evaluate.Matrices.Matrix_Instruction is 71 | RetVal : Evaluate.Matrices.Matrix_Instruction; 72 | begin 73 | -- Get Block 74 | RetVal (1) := Get; 75 | 76 | -- Get Size 77 | RetVal (2) := Get; 78 | 79 | -- Get Position 80 | RetVal (3) := Get; 81 | 82 | -- Get the first two chars representing a byte 83 | RetVal (4) := Get; 84 | RetVal (5) := Get; 85 | 86 | -- Check for Word/Double Word Size 87 | if RetVal (2) = 'W' or RetVal (2) = 'D' then 88 | -- Get the next two chars representing the last byte of the word 89 | RetVal (6) := Get; 90 | RetVal (7) := Get; 91 | if RetVal (2) = 'D' then 92 | -- Check for Double Word Size 93 | -- Get the next four chars representing the 94 | -- least significant word of the double word 95 | RetVal (8) := Get; 96 | RetVal (9) := Get; 97 | RetVal (10) := Get; 98 | RetVal (11) := Get; 99 | end if; 100 | end if; 101 | 102 | return RetVal; 103 | end Get_Matrix_Instruction; 104 | 105 | function Get (Timeout : Natural := 0) return Character is 106 | use HAL.UART; 107 | Data : UART_Data_8b (1 .. 1); 108 | Status : UART_Status; 109 | begin 110 | Port.Receive (Data, Status, Timeout => Timeout); 111 | case Status is 112 | when Ok => 113 | return Character'Val (Data (1)); 114 | when Err_Error | Err_Timeout | Busy => 115 | return ASCII.NUL; 116 | end case; 117 | end Get; 118 | 119 | end Transport.Serial; 120 | -------------------------------------------------------------------------------- /src/transport-serial.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This package provides the serial specific procedures for input requests 4 | -- 5 | --=========================================================================== 6 | -- 7 | -- Copyright 2021 (C) Holger Rodriguez 8 | -- 9 | -- SPDX-License-Identifier: BSD-3-Clause 10 | -- 11 | with Evaluate.LEDs; 12 | with Evaluate.Matrices; 13 | 14 | package Transport.Serial is 15 | 16 | -------------------------------------------------------------------------- 17 | -- Initalize the UART for operation 18 | -------------------------------------------------------------------------- 19 | procedure Initialize; 20 | 21 | -------------------------------------------------------------------------- 22 | -- Get the first character in the communication to determine the area 23 | -- It will return Area_Selector'(None), in case there was a timeout 24 | -- without receiving any input 25 | -------------------------------------------------------------------------- 26 | function Get_Area_Selector return Area_Selector; 27 | 28 | -------------------------------------------------------------------------- 29 | -- Case Get_Area_Selector: 30 | -- when 'L' == LED => Reads the full instruction for LED control 31 | -------------------------------------------------------------------------- 32 | function Get_LED_Instruction return Evaluate.LEDs.LED_Instruction; 33 | 34 | -------------------------------------------------------------------------- 35 | -- Case Get_Area_Selector: 36 | -- when 'M' == LED => Reads the full instruction for Matrix control 37 | -------------------------------------------------------------------------- 38 | function Get_Matrix_Instruction return Evaluate.Matrices.Matrix_Instruction; 39 | 40 | end Transport.Serial; 41 | -------------------------------------------------------------------------------- /src/transport.ads: -------------------------------------------------------------------------------- 1 | --=========================================================================== 2 | -- 3 | -- This is the root package for all transport capabilities available 4 | -- Every transport capability shall offer the same functionality, 5 | -- independent of any channel used. 6 | -- 7 | --=========================================================================== 8 | -- 9 | -- Copyright 2021 (C) Holger Rodriguez 10 | -- 11 | -- SPDX-License-Identifier: BSD-3-Clause 12 | -- 13 | package Transport is 14 | 15 | -------------------------------------------------------------------------- 16 | -- Available areas for the dashboard 17 | -------------------------------------------------------------------------- 18 | type Area_Selector is (None, Led, Matrix); 19 | 20 | end Transport; 21 | --------------------------------------------------------------------------------