mirror of
https://github.com/qmk/qmk_firmware.git
synced 2025-06-14 12:54:15 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
c69f2734e8
@ -27,7 +27,7 @@ addons:
|
|||||||
- diffutils
|
- diffutils
|
||||||
- dos2unix
|
- dos2unix
|
||||||
- doxygen
|
- doxygen
|
||||||
after_success:
|
after_script:
|
||||||
bash util/travis_compiled_push.sh
|
bash util/travis_compiled_push.sh
|
||||||
notifications:
|
notifications:
|
||||||
webhooks:
|
webhooks:
|
||||||
|
7
.vscode/extensions.json
vendored
7
.vscode/extensions.json
vendored
@ -1,6 +1,11 @@
|
|||||||
// Suggested extensions
|
// Suggested extensions
|
||||||
{
|
{
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"EditorConfig.EditorConfig"
|
"EditorConfig.EditorConfig",
|
||||||
|
"xaver.clang-format",
|
||||||
|
"ms-vscode.cpptools",
|
||||||
|
"bierner.github-markdown-preview",
|
||||||
|
"donjayamanne.git-extension-pack",
|
||||||
|
"CoenraadS.bracket-pair-colorizer-2"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -8,8 +8,17 @@ Our users, contributors, and collaborators are expected to treat each other with
|
|||||||
|
|
||||||
* The use of sexualized language or imagery
|
* The use of sexualized language or imagery
|
||||||
* Unwelcome advances, sexual or otherwise
|
* Unwelcome advances, sexual or otherwise
|
||||||
|
* Deliberate intimidation, stalking, or following
|
||||||
* Insults or derogatory comments, or personal or political attacks
|
* Insults or derogatory comments, or personal or political attacks
|
||||||
* Publishing others’ private information without explicit permission
|
* Publishing others’ private information without explicit permission
|
||||||
|
* Sustained disruption of talks or other events
|
||||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||||
|
* Advocating for, or encouraging, any of the above behaviour
|
||||||
|
|
||||||
If someone is violating this Code of Conduct you may email hello@qmk.fm to bring your concern to the Members. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident.
|
# Reporting
|
||||||
|
|
||||||
|
If someone is violating this Code of Conduct, please email hello@qmk.fm or reach out to one of the Collaborators to bring it to our attention. All complaints will be reviewed and investigated.
|
||||||
|
|
||||||
|
QMK will seek to use the least punitive means available to resolve an issue. If the circumstances require asking an offender to leave, we will do that.
|
||||||
|
|
||||||
|
Reports will be taken and kept in strict confidence. You will not be required to confront an offender directly.
|
||||||
|
8
Makefile
8
Makefile
@ -20,7 +20,10 @@ endif
|
|||||||
override SILENT := false
|
override SILENT := false
|
||||||
|
|
||||||
ifndef SUB_IS_SILENT
|
ifndef SUB_IS_SILENT
|
||||||
|
ifndef SKIP_GIT
|
||||||
QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null)
|
QMK_VERSION := $(shell git describe --abbrev=0 --tags 2>/dev/null)
|
||||||
|
endif
|
||||||
|
|
||||||
ifneq ($(QMK_VERSION),)
|
ifneq ($(QMK_VERSION),)
|
||||||
$(info QMK Firmware $(QMK_VERSION))
|
$(info QMK Firmware $(QMK_VERSION))
|
||||||
endif
|
endif
|
||||||
@ -94,6 +97,7 @@ $(eval $(call NEXT_PATH_ELEMENT))
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
define GET_KEYBOARDS
|
define GET_KEYBOARDS
|
||||||
|
ifndef ALT_GET_KEYBOARDS
|
||||||
All_RULES_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/rules.mk))
|
All_RULES_MK := $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/rules.mk))
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
|
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/rules.mk))
|
||||||
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/rules.mk))
|
All_RULES_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/rules.mk))
|
||||||
@ -105,6 +109,9 @@ define GET_KEYBOARDS
|
|||||||
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/keymaps/*/rules.mk))
|
KEYMAPS_MK += $$(patsubst $(ROOT_DIR)/keyboards/%/rules.mk,%,$$(wildcard $(ROOT_DIR)/keyboards/*/*/*/*/keymaps/*/rules.mk))
|
||||||
|
|
||||||
KEYBOARDS := $$(sort $$(filter-out $$(KEYMAPS_MK), $$(All_RULES_MK)))
|
KEYBOARDS := $$(sort $$(filter-out $$(KEYMAPS_MK), $$(All_RULES_MK)))
|
||||||
|
else
|
||||||
|
KEYBOARDS := $(shell find keyboards/ -type f -iname "rules.mk" | grep -v keymaps | sed 's!keyboards/\(.*\)/rules.mk!\1!' | sort | uniq)
|
||||||
|
endif
|
||||||
endef
|
endef
|
||||||
|
|
||||||
$(eval $(call GET_KEYBOARDS))
|
$(eval $(call GET_KEYBOARDS))
|
||||||
@ -541,6 +548,7 @@ ifndef SKIP_GIT
|
|||||||
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi
|
if [ ! -e lib/chibios ]; then git submodule sync lib/chibios && git submodule update --depth 1 --init lib/chibios; fi
|
||||||
if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 1 --init lib/chibios-contrib; fi
|
if [ ! -e lib/chibios-contrib ]; then git submodule sync lib/chibios-contrib && git submodule update --depth 1 --init lib/chibios-contrib; fi
|
||||||
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 1 --init lib/ugfx; fi
|
if [ ! -e lib/ugfx ]; then git submodule sync lib/ugfx && git submodule update --depth 1 --init lib/ugfx; fi
|
||||||
|
if [ ! -e lib/lufa ]; then git submodule sync lib/lufa && git submodule update --depth 1 --init lib/lufa; fi
|
||||||
git submodule status --recursive 2>/dev/null | \
|
git submodule status --recursive 2>/dev/null | \
|
||||||
while IFS= read -r x; do \
|
while IFS= read -r x; do \
|
||||||
case "$$x" in \
|
case "$$x" in \
|
||||||
|
12
bin/qmk
12
bin/qmk
@ -38,7 +38,7 @@ with open('requirements.txt', 'r') as fd:
|
|||||||
|
|
||||||
# Figure out our version
|
# Figure out our version
|
||||||
command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags']
|
command = ['git', 'describe', '--abbrev=6', '--dirty', '--always', '--tags']
|
||||||
result = subprocess.run(command, universal_newlines=True, capture_output=True)
|
result = subprocess.run(command, universal_newlines=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
|
|
||||||
if result.returncode == 0:
|
if result.returncode == 0:
|
||||||
os.environ['QMK_VERSION'] = 'QMK ' + result.stdout.strip()
|
os.environ['QMK_VERSION'] = 'QMK ' + result.stdout.strip()
|
||||||
@ -47,7 +47,7 @@ else:
|
|||||||
|
|
||||||
# Setup the CLI
|
# Setup the CLI
|
||||||
import milc
|
import milc
|
||||||
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}ψ{style_reset_all}'
|
milc.EMOJI_LOGLEVELS['INFO'] = '{fg_blue}Ψ{style_reset_all}'
|
||||||
|
|
||||||
# If we were invoked as `qmk <cmd>` massage sys.argv into `qmk-<cmd>`.
|
# If we were invoked as `qmk <cmd>` massage sys.argv into `qmk-<cmd>`.
|
||||||
# This means we can't accept arguments to the qmk script itself.
|
# This means we can't accept arguments to the qmk script itself.
|
||||||
@ -94,4 +94,10 @@ else:
|
|||||||
exit(1)
|
exit(1)
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
milc.cli()
|
return_code = milc.cli()
|
||||||
|
if return_code is False:
|
||||||
|
exit(1)
|
||||||
|
elif return_code is not True and isinstance(return_code, int) and return_code < 256:
|
||||||
|
exit(return_code)
|
||||||
|
else:
|
||||||
|
exit(0)
|
||||||
|
@ -267,20 +267,21 @@ ifeq ($(strip $(ENCODER_ENABLE)), yes)
|
|||||||
OPT_DEFS += -DENCODER_ENABLE
|
OPT_DEFS += -DENCODER_ENABLE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(HAPTIC_ENABLE)), DRV2605L)
|
HAPTIC_ENABLE ?= no
|
||||||
|
ifneq ($(strip $(HAPTIC_ENABLE)),no)
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/haptic
|
COMMON_VPATH += $(DRIVER_PATH)/haptic
|
||||||
SRC += haptic.c
|
SRC += haptic.c
|
||||||
|
OPT_DEFS += -DHAPTIC_ENABLE
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(filter DRV2605L, $(HAPTIC_ENABLE)), )
|
||||||
SRC += DRV2605L.c
|
SRC += DRV2605L.c
|
||||||
QUANTUM_LIB_SRC += i2c_master.c
|
QUANTUM_LIB_SRC += i2c_master.c
|
||||||
OPT_DEFS += -DHAPTIC_ENABLE
|
|
||||||
OPT_DEFS += -DDRV2605L
|
OPT_DEFS += -DDRV2605L
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(strip $(HAPTIC_ENABLE)), SOLENOID)
|
ifneq ($(filter SOLENOID, $(HAPTIC_ENABLE)), )
|
||||||
COMMON_VPATH += $(DRIVER_PATH)/haptic
|
|
||||||
SRC += haptic.c
|
|
||||||
SRC += solenoid.c
|
SRC += solenoid.c
|
||||||
OPT_DEFS += -DHAPTIC_ENABLE
|
|
||||||
OPT_DEFS += -DSOLENOID_ENABLE
|
OPT_DEFS += -DSOLENOID_ENABLE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -358,3 +359,9 @@ ifeq ($(strip $(SPACE_CADET_ENABLE)), yes)
|
|||||||
SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
|
SRC += $(QUANTUM_DIR)/process_keycode/process_space_cadet.c
|
||||||
OPT_DEFS += -DSPACE_CADET_ENABLE
|
OPT_DEFS += -DSPACE_CADET_ENABLE
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
ifeq ($(strip $(DIP_SWITCH_ENABLE)), yes)
|
||||||
|
SRC += $(QUANTUM_DIR)/dip_switch.c
|
||||||
|
OPT_DEFS += -DDIP_SWITCH_ENABLE
|
||||||
|
endif
|
||||||
|
53
docs/ChangeLog/20190830.md
Normal file
53
docs/ChangeLog/20190830.md
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
# QMK Breaking Change - 2019 Aug 30
|
||||||
|
|
||||||
|
Four times a year QMK runs a process for merging Breaking Changes. A Breaking Change is any change which modifies how QMK behaves in a way that is incompatible or potentially dangerous. We limit these changes to 4 times per year so that users can have confidence that updating their QMK tree will not break their keymaps.
|
||||||
|
|
||||||
|
This document marks the inaugural Breaking Change merge. A list of changes follows.
|
||||||
|
|
||||||
|
## Core code formatting with clang-format
|
||||||
|
|
||||||
|
* All core files (`drivers/`, `quantum/`, `tests/`, and `tmk_core/`) have been formatted with clang-format
|
||||||
|
* A travis process to reformat PR's on merge has been instituted
|
||||||
|
* You can use the new CLI command `qmk cformat` to format before submitting your PR if you wish.
|
||||||
|
|
||||||
|
## LUFA USB descriptor cleanup
|
||||||
|
|
||||||
|
* Some code cleanups related to the USB HID descriptors on AVR keyboards, to make them easier to read and understand
|
||||||
|
* More information: see https://github.com/qmk/qmk_firmware/pull/4871
|
||||||
|
* No behaviour changes anticipated and no keymaps modified
|
||||||
|
|
||||||
|
## Migrating `ACTION_LAYER_MOMENTARY()` entries in `fn_actions` to `MO()` keycodes
|
||||||
|
|
||||||
|
* `fn_actions` is deprecated, and its functionality has been superseded by direct keycodes and `process_record_user()`
|
||||||
|
* The end result of removing this obsolete feature should result in a decent reduction in firmware size and code complexity
|
||||||
|
* All keymaps affected are recommended to switch away from `fn_actions` in favour of the [custom keycode](https://docs.qmk.fm/#/custom_quantum_functions) and [macro](https://docs.qmk.fm/#/feature_macros) features
|
||||||
|
|
||||||
|
## Update Atreus to current code conventions
|
||||||
|
|
||||||
|
* Duplicate include guards have bypassed the expected header processing behavior
|
||||||
|
* All keymaps affected are recommended to remove duplication of `<keyboard>/config.h` to `<keyboard>/keymaps/<user>/config.h` and only provide overrides at the keymap level
|
||||||
|
|
||||||
|
## Backport changes to keymap language files from ZSA fork
|
||||||
|
|
||||||
|
* Fixes an issue in the `keymap_br_abnt2.h` file that includes the wrong source (`keymap_common.h` instead of `keymap.h`)
|
||||||
|
* Updates the `keymap_swedish.h` file to be specific to swedish, and not just "nordic" in general.
|
||||||
|
* Any keymaps using this will need to remove `NO_*` and replace it with `SE_*`.
|
||||||
|
|
||||||
|
## Update repo to use LUFA as a git submodule
|
||||||
|
|
||||||
|
* `/lib/LUFA` removed from the repo
|
||||||
|
* LUFA set as a submodule, pointing to qmk/lufa
|
||||||
|
* This should allow more flexibility with LUFA, and allow us to keep the sub-module up to date, a lot more easily. It was ~2 years out of date with no easy path to fix that. This prevents that from being an issue in the future
|
||||||
|
|
||||||
|
## Migrating `ACTION_BACKLIGHT_*()` entries in `fn_actions` to `BL_` keycodes
|
||||||
|
|
||||||
|
* `fn_actions` is deprecated, and its functionality has been superseded by direct keycodes and `process_record_user()`
|
||||||
|
* All keymaps using these actions have had the relevant `KC_FN*` keys replaced with the equivalent `BL_*` keys
|
||||||
|
* If you currently use `KC_FN*` you will need to replace `fn_actions` with the [custom keycode](https://docs.qmk.fm/#/custom_quantum_functions) and [macro](https://docs.qmk.fm/#/feature_macros) features
|
||||||
|
|
||||||
|
## Remove `KC_DELT` alias in favor of `KC_DEL`
|
||||||
|
|
||||||
|
* `KC_DELT` was a redundant, undocumented alias for `KC_DELETE`
|
||||||
|
* It has been removed and all its uses replaced with the more common `KC_DEL` alias
|
||||||
|
* Around 90 keymaps (mostly for ErgoDox boards) have been modified as a result
|
||||||
|
|
@ -13,11 +13,15 @@
|
|||||||
* [How to Use Github](getting_started_github.md)
|
* [How to Use Github](getting_started_github.md)
|
||||||
* [Getting Help](getting_started_getting_help.md)
|
* [Getting Help](getting_started_getting_help.md)
|
||||||
|
|
||||||
|
* [Breaking Changes](breaking_changes.md)
|
||||||
|
* [2019 Aug 30](ChangeLog/20190830.md)
|
||||||
|
|
||||||
* [FAQ](faq.md)
|
* [FAQ](faq.md)
|
||||||
* [General FAQ](faq_general.md)
|
* [General FAQ](faq_general.md)
|
||||||
* [Build/Compile QMK](faq_build.md)
|
* [Build/Compile QMK](faq_build.md)
|
||||||
* [Debugging/Troubleshooting QMK](faq_debug.md)
|
* [Debugging/Troubleshooting QMK](faq_debug.md)
|
||||||
* [Keymap](faq_keymap.md)
|
* [Keymap](faq_keymap.md)
|
||||||
|
* [Driver Installation with Zadig](driver_installation_zadig.md)
|
||||||
|
|
||||||
* Detailed Guides
|
* Detailed Guides
|
||||||
* [Install Build Tools](getting_started_build_tools.md)
|
* [Install Build Tools](getting_started_build_tools.md)
|
||||||
@ -59,6 +63,7 @@
|
|||||||
* [Combos](feature_combo.md)
|
* [Combos](feature_combo.md)
|
||||||
* [Command](feature_command.md)
|
* [Command](feature_command.md)
|
||||||
* [Debounce API](feature_debounce_type.md)
|
* [Debounce API](feature_debounce_type.md)
|
||||||
|
* [DIP Switch](feature_dip_switch.md)
|
||||||
* [Dynamic Macros](feature_dynamic_macros.md)
|
* [Dynamic Macros](feature_dynamic_macros.md)
|
||||||
* [Encoders](feature_encoders.md)
|
* [Encoders](feature_encoders.md)
|
||||||
* [Grave Escape](feature_grave_esc.md)
|
* [Grave Escape](feature_grave_esc.md)
|
||||||
|
108
docs/breaking_changes.md
Normal file
108
docs/breaking_changes.md
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
# Breaking Changes
|
||||||
|
|
||||||
|
This document describes QMK's Breaking Change process. A Breaking Change is any change which modifies how QMK behaves in a way that in incompatible or potentially dangerous. We limit these changes so that users can have confidence that updating their QMK tree will not break their keymaps.
|
||||||
|
|
||||||
|
The breaking change period is when we will merge PR's that change QMK in dangerous or unexpected ways. There is a built-in period of testing so we are confident that any problems caused are rare or unable to be predicted.
|
||||||
|
|
||||||
|
## What has been included in past Breaking Changes?
|
||||||
|
|
||||||
|
* [2019 Aug 30](ChangeLog/20190830.md)
|
||||||
|
|
||||||
|
## When is the next Breaking Change?
|
||||||
|
|
||||||
|
The next Breaking Change is scheduled for Nov 29.
|
||||||
|
|
||||||
|
### Important Dates
|
||||||
|
|
||||||
|
* [ ] 2019 Oct 04 - `future` is created. It will be rebased weekly.
|
||||||
|
* [ ] 2019 Nov 01 - `future` closed to new PR's.
|
||||||
|
* [ ] 2019 Nov 01 - Call for testers.
|
||||||
|
* [ ] 2019 Nov 27 - `master` is locked, no PR's merged.
|
||||||
|
* [ ] 2019 Nov 29 - Merge `future` to `master`.
|
||||||
|
* [ ] 2019 Nov 30 - `master` is unlocked. PR's can be merged again.
|
||||||
|
|
||||||
|
## What changes will be included?
|
||||||
|
|
||||||
|
To see a list of breaking change candidates you can look at the [`breaking_change` label](https://github.com/qmk/qmk_firmware/pulls?q=is%3Aopen+label%3Abreaking_change+is%3Apr). New changes might be added between now and when `future` is closed, and a PR with that label applied is not guaranteed to be merged.
|
||||||
|
|
||||||
|
If you want your breaking change to be included in this round you need to create a PR with the `breaking_change` label and have it accepted before `future` closes. After `future` closes no new breaking changes will be accepted.
|
||||||
|
|
||||||
|
Criteria for acceptance:
|
||||||
|
|
||||||
|
* PR is complete and ready to merge
|
||||||
|
* PR has a ChangeLog
|
||||||
|
|
||||||
|
# Checklists
|
||||||
|
|
||||||
|
This section documents various processes we use when running the Breaking Changes process.
|
||||||
|
|
||||||
|
## Rebase `future` from `master`
|
||||||
|
|
||||||
|
This is run every Friday while `future` is open.
|
||||||
|
|
||||||
|
Process:
|
||||||
|
|
||||||
|
```
|
||||||
|
cd qmk_firmware
|
||||||
|
git checkout master
|
||||||
|
git pull --ff-only
|
||||||
|
git checkout future
|
||||||
|
git rebase master
|
||||||
|
git push --force
|
||||||
|
```
|
||||||
|
|
||||||
|
## 8 Weeks Before Merge
|
||||||
|
|
||||||
|
* `qmk_firmware` git commands
|
||||||
|
* [ ] `git checkout master`
|
||||||
|
* [ ] `git pull --ff-only`
|
||||||
|
* [ ] `git checkout -b future`
|
||||||
|
* [ ] Edit `readme.md`
|
||||||
|
* [ ] Add a big notice at the top that this is a testing branch.
|
||||||
|
* [ ] Include a link to this document
|
||||||
|
* [ ] `git commit -m 'Branch point for <DATE> Breaking Change'`
|
||||||
|
* [ ] `git tag breakpoint_<YYYY>_<MM>_<DD>`
|
||||||
|
* [ ] `git tag <next_version>` # Prevent the breakpoint tag from confusing version incrementing
|
||||||
|
* [ ] `git push origin future`
|
||||||
|
* [ ] `git push --tags`
|
||||||
|
* GitHub Actions
|
||||||
|
* [ ] Switch all [breaking_change PR's](https://github.com/qmk/qmk_firmware/pulls?utf8=%E2%9C%93&q=is%3Apr+is%3Aopen+label%3Abreaking_change) to `future`
|
||||||
|
* [ ] Any that have a ChangeLog entry may be merged immediately.
|
||||||
|
|
||||||
|
## 4 Weeks Before Merge
|
||||||
|
|
||||||
|
* `future` is now closed to new PR's, only fixes for current PR's may be merged
|
||||||
|
* Post call for testers
|
||||||
|
* [ ] Discord
|
||||||
|
* [ ] GitHub PR
|
||||||
|
* [ ] https://reddit.com/r/olkb
|
||||||
|
|
||||||
|
## 1 Week Before Merge
|
||||||
|
|
||||||
|
* Announce that master will be closed from <2 Days Before> to <Day of Merge>
|
||||||
|
* [ ] Discord
|
||||||
|
* [ ] GitHub PR
|
||||||
|
* [ ] https://reddit.com/r/olkb
|
||||||
|
|
||||||
|
## 2 Days Before Merge
|
||||||
|
|
||||||
|
* Announce that master is closed for 2 days
|
||||||
|
* [ ] Discord
|
||||||
|
* [ ] GitHub PR
|
||||||
|
* [ ] https://reddit.com/r/olkb
|
||||||
|
|
||||||
|
## Day Of Merge
|
||||||
|
|
||||||
|
* `qmk_firmware` git commands
|
||||||
|
* [ ] `git checkout future`
|
||||||
|
* [ ] `git pull --ff-only`
|
||||||
|
* [ ] `git rebase origin/master`
|
||||||
|
* [ ] Edit `readme.md`
|
||||||
|
* [ ] Remove the notes about `future`
|
||||||
|
* [ ] Roll up the ChangeLog into one file.
|
||||||
|
* [ ] `git commit -m 'Merge point for <DATE> Breaking Change'`
|
||||||
|
* [ ] `git push origin future`
|
||||||
|
* Github Actions
|
||||||
|
* [ ] Create a PR for `future`
|
||||||
|
* [ ] Make sure travis comes back clean
|
||||||
|
* [ ] Merge `future` PR
|
25
docs/cli.md
25
docs/cli.md
@ -6,7 +6,8 @@ This page describes how to setup and use the QMK CLI.
|
|||||||
|
|
||||||
The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to help you work with QMK:
|
The QMK CLI makes building and working with QMK keyboards easier. We have provided a number of commands to help you work with QMK:
|
||||||
|
|
||||||
* `qmk compile-json`
|
* `qmk compile`
|
||||||
|
* `qmk doctor`
|
||||||
|
|
||||||
# Setup
|
# Setup
|
||||||
|
|
||||||
@ -20,12 +21,28 @@ You may want to add this to your `.profile`, `.bash_profile`, `.zsh_profile`, or
|
|||||||
|
|
||||||
# Commands
|
# Commands
|
||||||
|
|
||||||
## `qmk compile-json`
|
## `qmk compile`
|
||||||
|
|
||||||
This command allows you to compile JSON files you have downloaded from <https://config.qmk.fm>.
|
This command allows you to compile firmware from any directory. You can compile JSON exports from <https://config.qmk.fm> or compile keymaps in the repo.
|
||||||
|
|
||||||
|
**Usage for Configurator Exports**:
|
||||||
|
|
||||||
|
```
|
||||||
|
qmk compile <configuratorExport.json>
|
||||||
|
```
|
||||||
|
|
||||||
|
**Usage for Keymaps**:
|
||||||
|
|
||||||
|
```
|
||||||
|
qmk compile -kb <keyboard_name> -km <keymap_name>
|
||||||
|
```
|
||||||
|
|
||||||
|
## `qmk cformat`
|
||||||
|
|
||||||
|
This command formats C code using clang-format. Run it with no arguments to format all core code, or pass filenames on the command line to run it on specific files.
|
||||||
|
|
||||||
**Usage**:
|
**Usage**:
|
||||||
|
|
||||||
```
|
```
|
||||||
qmk compile-json mine.json
|
qmk cformat [file1] [file2] [...] [fileN]
|
||||||
```
|
```
|
||||||
|
@ -76,7 +76,7 @@ This is a C header file that is one of the first things included, and will persi
|
|||||||
* `#define B7_AUDIO`
|
* `#define B7_AUDIO`
|
||||||
* enables audio on pin B7 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO)
|
* enables audio on pin B7 (duophony is enables if one of B[5-7]\_AUDIO is enabled along with one of C[4-6]\_AUDIO)
|
||||||
* `#define BACKLIGHT_PIN B7`
|
* `#define BACKLIGHT_PIN B7`
|
||||||
* pin of the backlight - `B5`, `B6`, `B7` and `C6` (and `D4` on ATmega32A) use hardware PWM, others use software implementation
|
* pin of the backlight
|
||||||
* `#define BACKLIGHT_LEVELS 3`
|
* `#define BACKLIGHT_LEVELS 3`
|
||||||
* number of levels your backlight will have (maximum 15 excluding off)
|
* number of levels your backlight will have (maximum 15 excluding off)
|
||||||
* `#define BACKLIGHT_BREATHING`
|
* `#define BACKLIGHT_BREATHING`
|
||||||
@ -91,8 +91,10 @@ This is a C header file that is one of the first things included, and will persi
|
|||||||
* tries to keep switch state consistent with keyboard LED state
|
* tries to keep switch state consistent with keyboard LED state
|
||||||
* `#define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)`
|
* `#define IS_COMMAND() (get_mods() == MOD_MASK_SHIFT)`
|
||||||
* key combination that allows the use of magic commands (useful for debugging)
|
* key combination that allows the use of magic commands (useful for debugging)
|
||||||
* `#define USB_MAX_POWER_CONSUMPTION`
|
* `#define USB_MAX_POWER_CONSUMPTION 500`
|
||||||
* sets the maximum power (in mA) over USB for the device (default: 500)
|
* sets the maximum power (in mA) over USB for the device (default: 500)
|
||||||
|
* `#define USB_POLLING_INTERVAL_MS 10`
|
||||||
|
* sets the USB polling rate in milliseconds for the keyboard, mouse, and shared (NKRO/media keys) interfaces
|
||||||
* `#define F_SCL 100000L`
|
* `#define F_SCL 100000L`
|
||||||
* sets the I2C clock rate speed for keyboards using I2C. The default is `400000L`, except for keyboards using `split_common`, where the default is `100000L`.
|
* sets the I2C clock rate speed for keyboards using I2C. The default is `400000L`, except for keyboards using `split_common`, where the default is `100000L`.
|
||||||
|
|
||||||
|
@ -297,8 +297,8 @@ This runs code every time that the layers get changed. This can be useful for l
|
|||||||
This example shows how to set the [RGB Underglow](feature_rgblight.md) lights based on the layer, using the Planck as an example
|
This example shows how to set the [RGB Underglow](feature_rgblight.md) lights based on the layer, using the Planck as an example
|
||||||
|
|
||||||
```c
|
```c
|
||||||
uint32_t layer_state_set_user(uint32_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case _RAISE:
|
case _RAISE:
|
||||||
rgblight_setrgb (0x00, 0x00, 0xFF);
|
rgblight_setrgb (0x00, 0x00, 0xFF);
|
||||||
break;
|
break;
|
||||||
@ -320,8 +320,8 @@ uint32_t layer_state_set_user(uint32_t state) {
|
|||||||
```
|
```
|
||||||
### `layer_state_set_*` Function Documentation
|
### `layer_state_set_*` Function Documentation
|
||||||
|
|
||||||
* Keyboard/Revision: `uint32_t layer_state_set_kb(uint32_t state)`
|
* Keyboard/Revision: `layer_state_t layer_state_set_kb(layer_state_t state)`
|
||||||
* Keymap: `uint32_t layer_state_set_user(uint32_t state)`
|
* Keymap: `layer_state_t layer_state_set_user(layer_state_t state)`
|
||||||
|
|
||||||
|
|
||||||
The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status)
|
The `state` is the bitmask of the active layers, as explained in the [Keymap Overview](keymap.md#keymap-layer-status)
|
||||||
@ -377,8 +377,8 @@ void keyboard_post_init_user(void) {
|
|||||||
The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above.
|
The above function will use the EEPROM config immediately after reading it, to set the default layer's RGB color. The "raw" value of it is converted in a usable structure based on the "union" that you created above.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
uint32_t layer_state_set_user(uint32_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
switch (biton32(state)) {
|
switch (get_highest_layer(state)) {
|
||||||
case _RAISE:
|
case _RAISE:
|
||||||
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
if (user_config.rgb_layer_change) { rgblight_sethsv_noeeprom_magenta(); rgblight_mode_noeeprom(1); }
|
||||||
break;
|
break;
|
||||||
|
42
docs/driver_installation_zadig.md
Normal file
42
docs/driver_installation_zadig.md
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# Bootloader Driver Installation with Zadig
|
||||||
|
|
||||||
|
QMK presents itself to the host as a regular HID keyboard device, and as such requires no special drivers. However, in order to flash your keyboard on Windows, the bootloader device that appears when you reset the board often *does*.
|
||||||
|
|
||||||
|
There are two notable exceptions: the Caterina bootloader, usually seen on Pro Micros, and the Halfkay bootloader shipped with PJRC Teensys, appear as a serial port and a generic HID device respectively, and so do not require a driver.
|
||||||
|
|
||||||
|
We recommend the use of the [Zadig](https://zadig.akeo.ie/) utility. If you have set up the development environment with Msys2 or WSL, the `qmk_install.sh` script will have asked if you want it to install the drivers for you.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
Place your keyboard into the bootloader mode, either by hitting the `RESET` keycode (which may be on a different layer), or by pressing the reset switch usually located on the underside of the board. If your keyboard has neither, try holding Escape, or Space+`B`, as you plug it in (see the [Bootmagic](feature_bootmagic.md) docs for more details).
|
||||||
|
Some keyboards may have specific instructions for entering the bootloader, for example the [Bootmagic Lite](feature_bootmagic.md#bootmagic-lite) key (Escape) might be on a different key, such as Left Control. Refer to the board's README if you are unsure.
|
||||||
|
|
||||||
|
Zadig will automatically detect the bootloader device. You may sometimes need to check **Options -> List All Devices**.
|
||||||
|
- For keyboards with Atmel AVR MCUs, the bootloader will be named something similar to `ATm32U4DFU`, and have a Vendor ID of `03EB`.
|
||||||
|
- USBasp bootloaders will appear as `USBasp`, with a VID/PID of `16C0:05DC`.
|
||||||
|
- AVR keyboards flashed with the QMK-DFU bootloader will be named `<keyboard name> Bootloader` and will also have the VID `03EB`.
|
||||||
|
- For most ARM keyboards, it will be called `STM32 BOOTLOADER`, and have a VID/PID of `0483:DF11`.
|
||||||
|
|
||||||
|
!> If Zadig lists one or more devices with the `HidUsb` driver, your keyboard is probably not in bootloader mode. The arrow will be colored orange and you will be asked to confirm modifying a system driver. **Do not** proceed if this is the case!
|
||||||
|
|
||||||
|
If the arrow appears green, select the driver, and click **Install Driver**. The `libusb-win32` driver will usually work for AVR, and `WinUSB` for ARM, but if you still cannot flash the board, try installing a different driver from the list.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Finally, unplug and replug the keyboard to make sure the new driver has been loaded. If you are using the QMK Toolbox to flash, exit and restart it too, as it can sometimes fail to recognize the driver change.
|
||||||
|
|
||||||
|
## Recovering from Installation to Wrong Device
|
||||||
|
|
||||||
|
If you find that you can no longer type with the keyboard, you may have installed the driver onto the keyboard itself instead of the bootloader. You can easily confirm this in Zadig - a healthy keyboard has the `HidUsb` driver installed on all of its interfaces:
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Open the Device Manager and look for a device that looks like your keyboard.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Right-click it and hit **Uninstall device**. Make sure to tick **Delete the driver software for this device** first.
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
Click **Action -> Scan for hardware changes**. At this point, you should be able to type again. Double check in Zadig that the keyboard device(s) are using the `HidUsb` driver. If so, you're all done, and your board should be functional again!
|
@ -75,14 +75,11 @@ Pro Micro (Atmega32u4), make sure to include `CONFIG_USB_ACM=y`. Other devices m
|
|||||||
|
|
||||||
## Unknown Device for DFU Bootloader
|
## Unknown Device for DFU Bootloader
|
||||||
|
|
||||||
Issues encountered when flashing keyboards on Windows are most often due to having the wrong drivers installed for the bootloader.
|
Issues encountered when flashing keyboards on Windows are most often due to having the wrong drivers installed for the bootloader, or none at all.
|
||||||
|
|
||||||
Re-running the installation script for MSYS2 may help (eg run `util/qmk_install.sh` from MSYS2/WSL) or reinstalling the QMK Toolbox may fix the issue. Alternatively, you can download and run the [`qmk_driver_installer`](https://github.com/qmk/qmk_driver_installer) package.
|
Re-running the QMK installation script (`./util/qmk_install.sh` from the `qmk_firmware` directory in MSYS2 or WSL) or reinstalling the QMK Toolbox may fix the issue. Alternatively, you can download and run the [`qmk_driver_installer`](https://github.com/qmk/qmk_driver_installer) package manually.
|
||||||
|
|
||||||
If that doesn't work, then you may need to grab the [Zadig Utility](https://zadig.akeo.ie/). Download this, and run it on the system. Then, you will need to reset your board into bootloader mode. After that, locate the device in question. If the device doesn't show up in the list (or nothing shows up in the list), you may need to enable the `List all devices` option in the `Options` menu.
|
|
||||||
|
|
||||||
From here, you will need to know what type of controller the board is using. You may see it listed in the Device Manager as `ATmega32U4` device (which is an AVR board), or an `STM32` device (Which is an ARM board). For AVR boards, use `libusb-win32` for the driver. For ARM boards, use the `WinUSB` driver. Once the correct driver type has been selected, click on the `Replace Driver` button, unplug your board, plug it back in, and reset it again.
|
|
||||||
|
|
||||||
|
If that doesn't work, then you may need to download and run Zadig. See [Bootloader Driver Installation with Zadig](driver_installation_zadig.md) for more detailed information.
|
||||||
|
|
||||||
## WINAVR is Obsolete
|
## WINAVR is Obsolete
|
||||||
It is no longer recommended and may cause some problem.
|
It is no longer recommended and may cause some problem.
|
||||||
|
@ -184,22 +184,15 @@ Pressing any key during sleep should wake host.
|
|||||||
|
|
||||||
Arduino Leonardo and micro have **ATMega32U4** and can be used for TMK, though Arduino bootloader may be a problem.
|
Arduino Leonardo and micro have **ATMega32U4** and can be used for TMK, though Arduino bootloader may be a problem.
|
||||||
|
|
||||||
|
## Enabling JTAG
|
||||||
|
|
||||||
## Using PF4-7 Pins of USB AVR?
|
By default, the JTAG debugging interface is disabled as soon as the keyboard starts up. JTAG-capable MCUs come from the factory with the `JTAGEN` fuse set, and it takes over certain pins of the MCU that the board may be using for the switch matrix, LEDs, etc.
|
||||||
You need to set JTD bit of MCUCR yourself to use PF4-7 as GPIO. Those pins are configured to serve JTAG function by default. MCUs like ATMega*U* or AT90USB* are affected with this.
|
|
||||||
|
|
||||||
If you are using Teensy this isn't needed. Teensy is shipped with JTAGEN fuse bit unprogrammed to disable the function.
|
If you would like to keep JTAG enabled, just add the following to your `config.h`:
|
||||||
|
|
||||||
See this code.
|
```c
|
||||||
|
#define NO_JTAG_DISABLE
|
||||||
```
|
```
|
||||||
// JTAG disable for PORT F. write JTD bit twice within four cycles.
|
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
```
|
|
||||||
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hbkb/matrix.c#L67
|
|
||||||
|
|
||||||
And read **26.5.1 MCU Control Register – MCUCR** of ATMega32U4 datasheet.
|
|
||||||
|
|
||||||
|
|
||||||
## Adding LED Indicators of Lock Keys
|
## Adding LED Indicators of Lock Keys
|
||||||
You need your own LED indicators for CapsLock, ScrollLock and NumLock? See this post.
|
You need your own LED indicators for CapsLock, ScrollLock and NumLock? See this post.
|
||||||
|
@ -21,6 +21,8 @@ STARTUP_SONG // plays when the keyboard starts up (audio.c)
|
|||||||
GOODBYE_SONG // plays when you press the RESET key (quantum.c)
|
GOODBYE_SONG // plays when you press the RESET key (quantum.c)
|
||||||
AG_NORM_SONG // plays when you press AG_NORM (quantum.c)
|
AG_NORM_SONG // plays when you press AG_NORM (quantum.c)
|
||||||
AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c)
|
AG_SWAP_SONG // plays when you press AG_SWAP (quantum.c)
|
||||||
|
CG_NORM_SONG // plays when you press CG_NORM (quantum.c)
|
||||||
|
CG_SWAP_SONG // plays when you press CG_SWAP (quantum.c)
|
||||||
MUSIC_ON_SONG // plays when music mode is activated (process_music.c)
|
MUSIC_ON_SONG // plays when music mode is activated (process_music.c)
|
||||||
MUSIC_OFF_SONG // plays when music mode is deactivated (process_music.c)
|
MUSIC_OFF_SONG // plays when music mode is deactivated (process_music.c)
|
||||||
CHROMATIC_SONG // plays when the chromatic music mode is selected (process_music.c)
|
CHROMATIC_SONG // plays when the chromatic music mode is selected (process_music.c)
|
||||||
|
@ -30,32 +30,31 @@ You should then be able to use the keycodes below to change the backlight level.
|
|||||||
|
|
||||||
This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard.
|
This feature is distinct from both the [RGB underglow](feature_rgblight.md) and [RGB matrix](feature_rgb_matrix.md) features as it usually allows for only a single colour per switch, though you can obviously use multiple different coloured LEDs on a keyboard.
|
||||||
|
|
||||||
Hardware PWM is only supported on certain pins of the MCU, so if the backlighting is not connected to one of them, a software PWM implementation triggered by hardware timer interrupts will be used.
|
|
||||||
|
|
||||||
Hardware PWM is supported according to the following table:
|
Hardware PWM is supported according to the following table:
|
||||||
|
|
||||||
| Backlight Pin | Hardware timer |
|
|Backlight Pin|AT90USB64/128|ATmega16/32U4|ATmega16/32U2|ATmega32A|
|
||||||
|---------------|-------------------------|
|
|-------------|-------------|-------------|-------------|---------|
|
||||||
|`B5` | Timer 1 |
|
|`B5` |Timer 1 |Timer 1 | | |
|
||||||
|`B6` | Timer 1 |
|
|`B6` |Timer 1 |Timer 1 | | |
|
||||||
|`B7` | Timer 1 |
|
|`B7` |Timer 1 |Timer 1 |Timer 1 | |
|
||||||
|`C6` | Timer 3 |
|
|`C4` |Timer 3 | | | |
|
||||||
|`D4` | Timer 1 (ATmega32A only)|
|
|`C5` |Timer 3 | |Timer 1 | |
|
||||||
| other | Software PWM |
|
|`C6` |Timer 3 |Timer 3 |Timer 1 | |
|
||||||
|
|`D4` | | | |Timer 1 |
|
||||||
|
|`D5` | | | |Timer 1 |
|
||||||
|
|
||||||
The [audio feature](feature_audio.md) also uses hardware timers. Please refer to the following table to know what hardware timer the software PWM will use depending on the audio configuration:
|
All other pins will use software PWM. If the [Audio](feature_audio.md) feature is disabled or only using one timer, the backlight PWM can be triggered by a hardware timer:
|
||||||
|
|
||||||
| Audio Pin(s) | Audio Timer | Software PWM Timer |
|
|Audio Pin|Audio Timer|Software PWM Timer|
|
||||||
|--------------|-------------|--------------------|
|
|---------|-----------|------------------|
|
||||||
|`C4` |Timer 3 |Timer 1 |
|
|`C4` |Timer 3 |Timer 1 |
|
||||||
|`C5` |Timer 3 |Timer 1 |
|
|`C5` |Timer 3 |Timer 1 |
|
||||||
|`C6` |Timer 3 |Timer 1 |
|
|`C6` |Timer 3 |Timer 1 |
|
||||||
|`B5` |Timer 1 |Timer 3 |
|
|`B5` |Timer 1 |Timer 3 |
|
||||||
|`B6` |Timer 1 |Timer 3 |
|
|`B6` |Timer 1 |Timer 3 |
|
||||||
|`B7` |Timer 1 |Timer 3 |
|
|`B7` |Timer 1 |Timer 3 |
|
||||||
| `Bx` & `Cx` | Timer 1 & 3 | None |
|
|
||||||
|
|
||||||
When all timers are in use for [audio](feature_audio.md), the backlight software PWM will not use a hardware timer, but instead will be triggered during the matrix scan. In this case the backlight doesn't support breathing and might show lighting artifacts (for instance flickering), because the PWM computation might not be called with enough timing precision.
|
When both timers are in use for Audio, the backlight PWM will not use a hardware timer, but will instead be triggered during the matrix scan. In this case, breathing is not supported, and the backlight might flicker, because the PWM computation may not be called with enough timing precision.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
@ -120,7 +119,8 @@ The breathing effect is the same as in the hardware PWM implementation.
|
|||||||
|`backlight_step()` |Cycle through backlight levels |
|
|`backlight_step()` |Cycle through backlight levels |
|
||||||
|`backlight_increase()` |Increase the backlight level |
|
|`backlight_increase()` |Increase the backlight level |
|
||||||
|`backlight_decrease()` |Decrease the backlight level |
|
|`backlight_decrease()` |Decrease the backlight level |
|
||||||
|`backlight_level(x)` |Sets the backlight level to specified level |
|
|`backlight_level(x)` |Sets the backlight level, from 0 to |
|
||||||
|
| |`BACKLIGHT_LEVELS` |
|
||||||
|`get_backlight_level()` |Return the current backlight level |
|
|`get_backlight_level()` |Return the current backlight level |
|
||||||
|`is_backlight_enabled()`|Return whether the backlight is currently on |
|
|`is_backlight_enabled()`|Return whether the backlight is currently on |
|
||||||
|
|
||||||
|
@ -64,8 +64,11 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug
|
|||||||
|`MAGIC_NO_GUI` | |Disable the GUI keys (useful when gaming) |
|
|`MAGIC_NO_GUI` | |Disable the GUI keys (useful when gaming) |
|
||||||
|`MAGIC_UNNO_GUI` | |Enable the GUI keys |
|
|`MAGIC_UNNO_GUI` | |Enable the GUI keys |
|
||||||
|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)|
|
|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides (for macOS)|
|
||||||
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Left Alt and Left GUI |
|
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI |
|
||||||
|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Left Alt and GUI swap |
|
|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap |
|
||||||
|
|`MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Ctrl and GUI on both sides (for macOS)|
|
||||||
|
|`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Ctrl and GUI |
|
||||||
|
|`MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Ctrl and GUI swap |
|
||||||
|`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace |
|
|`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace |
|
||||||
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace |
|
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace |
|
||||||
|`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock |
|
|`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Left Control and Caps Lock |
|
||||||
@ -76,6 +79,10 @@ Hold down the Bootmagic key (Space by default) and the desired hotkey while plug
|
|||||||
|`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and Left GUI |
|
|`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and Left GUI |
|
||||||
|`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and Right GUI |
|
|`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and Right GUI |
|
||||||
|`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and Right GUI |
|
|`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and Right GUI |
|
||||||
|
|`MAGIC_SWAP_LCTL_LGUI` | |Swap Left Control and Left GUI |
|
||||||
|
|`MAGIC_UNSWAP_LCTL_LGUI` | |Unswap Left Control and Left GUI |
|
||||||
|
|`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and Right GUI |
|
||||||
|
|`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and Right GUI |
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks.
|
The Combo feature is a chording type solution for adding custom actions. It lets you hit multiple keys at once and produce a different effect. For instance, hitting `A` and `S` within the tapping term would hit `ESC` instead, or have it perform even more complex tasks.
|
||||||
|
|
||||||
To enable this feature, yu need to add `COMBO_ENABLE = yes` to your `rules.mk`.
|
To enable this feature, you need to add `COMBO_ENABLE = yes` to your `rules.mk`.
|
||||||
|
|
||||||
Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using).
|
Additionally, in your `config.h`, you'll need to specify the number of combos that you'll be using, by adding `#define COMBO_COUNT 1` (replacing 1 with the number that you're using).
|
||||||
<!-- At this time, this is necessary -->
|
<!-- At this time, this is necessary -->
|
||||||
|
90
docs/feature_dip_switch.md
Normal file
90
docs/feature_dip_switch.md
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
# DIP Switches
|
||||||
|
|
||||||
|
DIP switches are supported by adding this to your `rules.mk`:
|
||||||
|
|
||||||
|
DIP_SWITCH_ENABLE = yes
|
||||||
|
|
||||||
|
and this to your `config.h`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define DIP_SWITCH_PINS { B14, A15, A10, B9 }
|
||||||
|
```
|
||||||
|
|
||||||
|
## Callbacks
|
||||||
|
|
||||||
|
The callback functions can be inserted into your `<keyboard>.c`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_kb(uint8_t index, bool active) {
|
||||||
|
dip_switch_update_user(index, active);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
or `keymap.c`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_user(uint8_t index, bool active) {
|
||||||
|
switch (index) {
|
||||||
|
case 0:
|
||||||
|
if(active) { audio_on(); } else { audio_off(); }
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
if(active) { clicky_on(); } else { clicky_off(); }
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
if(active) { music_on(); } else { music_off(); }
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
if (active) {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_SONG(plover_song);
|
||||||
|
#endif
|
||||||
|
layer_on(_PLOVER);
|
||||||
|
} else {
|
||||||
|
#ifdef AUDIO_ENABLE
|
||||||
|
PLAY_SONG(plover_gb_song);
|
||||||
|
#endif
|
||||||
|
layer_off(_PLOVER);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Additionally, we support bit mask functions which allow for more complex handling.
|
||||||
|
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_mask_kb(uint32_t state) {
|
||||||
|
dip_switch_update_mask_user(state);
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
or `keymap.c`:
|
||||||
|
|
||||||
|
```c
|
||||||
|
void dip_switch_update_mask_user(uint32_t state) {
|
||||||
|
if (state & (1UL<<0) && state & (1UL<<1)) {
|
||||||
|
layer_on(_ADJUST); // C on esc
|
||||||
|
} else {
|
||||||
|
layer_off(_ADJUST);
|
||||||
|
}
|
||||||
|
if (state & (1UL<<0)) {
|
||||||
|
layer_on(_TEST_A); // A on ESC
|
||||||
|
} else {
|
||||||
|
layer_off(_TEST_A);
|
||||||
|
}
|
||||||
|
if (state & (1UL<<1)) {
|
||||||
|
layer_on(_TEST_B); // B on esc
|
||||||
|
} else {
|
||||||
|
layer_off(_TEST_B);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Hardware
|
||||||
|
|
||||||
|
One side of the DIP switch should be wired directly to the pin on the MCU, and the other side to ground. It should not matter which side is connected to which, as it should be functionally the same.
|
@ -20,6 +20,15 @@ Additionally, the resolution can be specified in the same file (the default & su
|
|||||||
|
|
||||||
#define ENCODER_RESOLUTION 4
|
#define ENCODER_RESOLUTION 4
|
||||||
|
|
||||||
|
## Split Keyboards
|
||||||
|
|
||||||
|
If you are using different pinouts for the encoders on each half of a split keyboard, you can define the pinout for the right half like this:
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
|
||||||
|
#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
|
||||||
|
```
|
||||||
|
|
||||||
## Callbacks
|
## Callbacks
|
||||||
|
|
||||||
The callback functions can be inserted into your `<keyboard>.c`:
|
The callback functions can be inserted into your `<keyboard>.c`:
|
||||||
|
@ -31,7 +31,7 @@ This enables the feature and the `OLED_DRIVER_ENABLE` define. Then in your `keym
|
|||||||
void oled_task_user(void) {
|
void oled_task_user(void) {
|
||||||
// Host Keyboard Layer Status
|
// Host Keyboard Layer Status
|
||||||
oled_write_P(PSTR("Layer: "), false);
|
oled_write_P(PSTR("Layer: "), false);
|
||||||
switch (biton32(layer_state)) {
|
switch (get_highest_layer(layer_state)) {
|
||||||
case _QWERTY:
|
case _QWERTY:
|
||||||
oled_write_P(PSTR("Default\n"), false);
|
oled_write_P(PSTR("Default\n"), false);
|
||||||
break;
|
break;
|
||||||
@ -97,14 +97,16 @@ void oled_task_user(void) {
|
|||||||
## Basic Configuration
|
## Basic Configuration
|
||||||
|
|
||||||
| Define | Default | Description |
|
| Define | Default | Description |
|
||||||
|------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------|
|
|----------------------------|-------------------|----------------------------------------------------------------------------------------------------------------------------|
|
||||||
| `OLED_DISPLAY_ADDRESS` | `0x3C` | The i2c address of the OLED Display |
|
| `OLED_DISPLAY_ADDRESS` | `0x3C` | The i2c address of the OLED Display |
|
||||||
| `OLED_FONT_H` | `"glcdfont.c"` | The font code file to use for custom fonts |
|
| `OLED_FONT_H` | `"glcdfont.c"` | The font code file to use for custom fonts |
|
||||||
| `OLED_FONT_START` | `0` | The starting characer index for custom fonts |
|
| `OLED_FONT_START` | `0` | The starting characer index for custom fonts |
|
||||||
| `OLED_FONT_END` | `224` | The ending characer index for custom fonts |
|
| `OLED_FONT_END` | `224` | The ending characer index for custom fonts |
|
||||||
| `OLED_FONT_WIDTH` | `6` | The font width |
|
| `OLED_FONT_WIDTH` | `6` | The font width |
|
||||||
| `OLED_FONT_HEIGHT` | `8` | The font height (untested) |
|
| `OLED_FONT_HEIGHT` | `8` | The font height (untested) |
|
||||||
| `OLED_DISABLE_TIMEOUT` | *Not defined* | Disables the built in OLED timeout feature. Useful when implementing custom timeout rules. |
|
| `OLED_TIMEOUT` | `60000` | Turns off the OLED screen after 60000ms of keyboard inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|
||||||
|
| `OLED_SCROLL_TIMEOUT` | `0` | Scrolls the OLED screen after 0ms of OLED inactivity. Helps reduce OLED Burn-in. Set to 0 to disable. |
|
||||||
|
| `OLED_SCROLL_TIMEOUT_RIGHT`| *Not defined* | Scroll timeout direction is right when defined, left when undefined. |
|
||||||
| `OLED_IC` | `OLED_IC_SSD1306` | Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. |
|
| `OLED_IC` | `OLED_IC_SSD1306` | Set to `OLED_IC_SH1106` if you're using the SH1106 OLED controller. |
|
||||||
| `OLED_COLUMN_OFFSET` | `0` | (SH1106 only.) Shift output to the right this many pixels.<br />Useful for 128x64 displays centered on a 132x64 SH1106 IC. |
|
| `OLED_COLUMN_OFFSET` | `0` | (SH1106 only.) Shift output to the right this many pixels.<br />Useful for 128x64 displays centered on a 132x64 SH1106 IC. |
|
||||||
|
|
||||||
|
@ -374,6 +374,7 @@ These are defined in [`rgblight_list.h`](https://github.com/qmk/qmk_firmware/blo
|
|||||||
#define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
#define RGB_MATRIX_LED_PROCESS_LIMIT (DRIVER_LED_TOTAL + 4) / 5 // limits the number of LEDs to process in an animation per task run (increases keyboard responsiveness)
|
||||||
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
#define RGB_MATRIX_LED_FLUSH_LIMIT 16 // limits in milliseconds how frequently an animation will update the LEDs. 16 (16ms) is equivalent to limiting to 60fps (increases keyboard responsiveness)
|
||||||
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
|
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255
|
||||||
|
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_CYCLE_LEFT_RIGHT // Sets the default mode, if none has been set
|
||||||
```
|
```
|
||||||
|
|
||||||
## EEPROM storage
|
## EEPROM storage
|
||||||
|
@ -166,6 +166,13 @@ This allows you to specify a different set of pins for the matrix on the right s
|
|||||||
|
|
||||||
This allows you to specify a different set of direct pins for the right side.
|
This allows you to specify a different set of direct pins for the right side.
|
||||||
|
|
||||||
|
```c
|
||||||
|
#define ENCODERS_PAD_A_RIGHT { encoder1a, encoder2a }
|
||||||
|
#define ENCODERS_PAD_B_RIGHT { encoder1b, encoder2b }
|
||||||
|
```
|
||||||
|
|
||||||
|
This allows you to specify a different set of encoder pins for the right side.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define RGBLIGHT_SPLIT
|
#define RGBLIGHT_SPLIT
|
||||||
```
|
```
|
||||||
|
@ -115,11 +115,11 @@ For instance, let's look at the `layer_state_set_user()` function. You can enab
|
|||||||
In your `<name.c>` file, you'd want to add this:
|
In your `<name.c>` file, you'd want to add this:
|
||||||
```c
|
```c
|
||||||
__attribute__ ((weak))
|
__attribute__ ((weak))
|
||||||
uint32_t layer_state_set_keymap (uint32_t state) {
|
layer_state_t layer_state_set_keymap (layer_state_t state) {
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t layer_state_set_user (uint32_t state) {
|
layer_state_t layer_state_set_user (layer_state_t state) {
|
||||||
state = update_tri_layer_state(state, 2, 3, 5);
|
state = update_tri_layer_state(state, 2, 3, 5);
|
||||||
return layer_state_set_keymap (state);
|
return layer_state_set_keymap (state);
|
||||||
}
|
}
|
||||||
|
@ -12,6 +12,7 @@ QMK has a staggering number of features for building your keyboard. It can take
|
|||||||
* [Combos](feature_combo.md) - Custom actions for multiple key holds.
|
* [Combos](feature_combo.md) - Custom actions for multiple key holds.
|
||||||
* [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic").
|
* [Command](feature_command.md) - Runtime version of bootmagic (Formerly known as "Magic").
|
||||||
* [Debounce API](feature_debounce_type.md) - Customization of debouncing algorithms, and the ability to add more/custom debouncing.
|
* [Debounce API](feature_debounce_type.md) - Customization of debouncing algorithms, and the ability to add more/custom debouncing.
|
||||||
|
* [DIP Switch](feature_dip_switch.md) - Toggle switches for customizing board function.
|
||||||
* [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself.
|
* [Dynamic Macros](feature_dynamic_macros.md) - Record and playback macros from the keyboard itself.
|
||||||
* [Encoders](feature_encoders.md) - Rotary encoders!
|
* [Encoders](feature_encoders.md) - Rotary encoders!
|
||||||
* [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave.
|
* [Grave Escape](feature_grave_esc.md) - Lets you use a single key for Esc and Grave.
|
||||||
|
@ -144,6 +144,36 @@ Flashing sequence:
|
|||||||
3. Flash a .hex file
|
3. Flash a .hex file
|
||||||
4. Reset the device into application mode (may be done automatically)
|
4. Reset the device into application mode (may be done automatically)
|
||||||
|
|
||||||
|
## BootloadHID
|
||||||
|
|
||||||
|
BootloadHID is a USB bootloader for AVR microcontrollers. The uploader tool requires no kernel level driver on Windows and can therefore be run without installing any DLLs.
|
||||||
|
|
||||||
|
To ensure compatibility with the bootloadHID bootloader, make sure this block is present your `rules.mk`:
|
||||||
|
|
||||||
|
# Bootloader
|
||||||
|
# This definition is optional, and if your keyboard supports multiple bootloaders of
|
||||||
|
# different sizes, comment this out, and the correct address will be loaded
|
||||||
|
# automatically (+60). See bootloader.mk for all options.
|
||||||
|
BOOTLOADER = bootloadHID
|
||||||
|
|
||||||
|
Compatible flashers:
|
||||||
|
|
||||||
|
* [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash) (recommended Windows GUI)
|
||||||
|
* [bootloadhid Command Line](https://www.obdev.at/products/vusb/bootloadhid.html) / `:BootloadHID` in QMK (recommended command line)
|
||||||
|
|
||||||
|
Flashing sequence:
|
||||||
|
|
||||||
|
1. Enter the bootloader using any of the following methods:
|
||||||
|
* Tap the `RESET` keycode (may not work on all devices)
|
||||||
|
* Hold the salt key while plugging the keyboard in (usually documented within keyboard readme)
|
||||||
|
2. Wait for the OS to detect the device
|
||||||
|
3. Flash a .hex file
|
||||||
|
4. Reset the device into application mode (may be done automatically)
|
||||||
|
|
||||||
|
or:
|
||||||
|
|
||||||
|
make <keyboard>:<keymap>:bootloadHID
|
||||||
|
|
||||||
## STM32
|
## STM32
|
||||||
|
|
||||||
All STM32 chips come preloaded with a factory bootloader that cannot be modified nor deleted. Some STM32 chips have bootloaders that do not come with USB programming (e.g. STM32F103) but the process is still the same.
|
All STM32 chips come preloaded with a factory bootloader that cannot be modified nor deleted. Some STM32 chips have bootloaders that do not come with USB programming (e.g. STM32F103) but the process is still the same.
|
||||||
@ -172,6 +202,4 @@ Flashing sequence:
|
|||||||
There are a number of DFU commands that you can use to flash firmware to a STM32 device:
|
There are a number of DFU commands that you can use to flash firmware to a STM32 device:
|
||||||
|
|
||||||
* `:dfu-util` - The default command for flashing to STM32 devices.
|
* `:dfu-util` - The default command for flashing to STM32 devices.
|
||||||
* `:dfu-util-wait` - This works like the default command, but it gives you a (configurable) 10 second timeout before it attempts to flash the firmware. You can use `TIME_DELAY=20` from the command line to change the timeout.
|
|
||||||
* Eg: `make <keyboard>:<keymap>:dfu-util TIME_DELAY=5`
|
|
||||||
* `:st-link-cli` - This allows you to flash the firmware via ST-LINK's CLI utility, rather than dfu-util.
|
* `:st-link-cli` - This allows you to flash the firmware via ST-LINK's CLI utility, rather than dfu-util.
|
||||||
|
70
docs/flashing_bootloadhid.md
Normal file
70
docs/flashing_bootloadhid.md
Normal file
@ -0,0 +1,70 @@
|
|||||||
|
# BootloadHID Flashing Instructions and Bootloader Information
|
||||||
|
|
||||||
|
ps2avr(GB) boards use an ATmega32A microcontroller and a different bootloader. It is not flashable using the regular QMK methods.
|
||||||
|
|
||||||
|
General flashing sequence:
|
||||||
|
|
||||||
|
1. Enter the bootloader using any of the following methods:
|
||||||
|
* Tap the `RESET` keycode (may not work on all devices)
|
||||||
|
* Hold the salt key while plugging the keyboard in (usually documented within keyboard readme)
|
||||||
|
2. Wait for the OS to detect the device
|
||||||
|
3. Flash a .hex file
|
||||||
|
4. Reset the device into application mode (may be done automatically)
|
||||||
|
|
||||||
|
## bootloadHID Flashing Target
|
||||||
|
|
||||||
|
Using the QMK installation script, detailed [here](newbs_getting_started.md), the required bootloadHID tools should be automatically installed.
|
||||||
|
|
||||||
|
To flash via the command line, use the target `:bootloadHID` by executing the following command:
|
||||||
|
|
||||||
|
make <keyboard>:<keymap>:bootloadHID
|
||||||
|
|
||||||
|
## GUI Flashing
|
||||||
|
|
||||||
|
### Windows
|
||||||
|
1. Download [HIDBootFlash](http://vusb.wikidot.com/project:hidbootflash).
|
||||||
|
2. Place your keyboard into reset.
|
||||||
|
3. Ensure the configured VendorID is `16c0` and ProductID is `05df`
|
||||||
|
4. Press the `Find Device` button and ensure that your keyboard is found.
|
||||||
|
5. Press the `Open .hex File` button and locate the `.hex` file you created.
|
||||||
|
6. Press the `Flash Device` button and wait for the process to complete.
|
||||||
|
|
||||||
|
## Command Line Flashing
|
||||||
|
|
||||||
|
1. Place your keyboard into reset.
|
||||||
|
2. Flash the board by typing `bootloadHID -r` followed by the path to your `.hex` file.
|
||||||
|
|
||||||
|
### Windows Manual Installation
|
||||||
|
For MSYS2:
|
||||||
|
1. Download the BootloadHID firmware package from https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz.
|
||||||
|
2. Extract contents using a compatible tool, for example 7-Zip.
|
||||||
|
3. Add to the MSYS path by copying `commandline/bootloadHID.exe` from the extracted archive to your MSYS2 installation, typically `C:\msys64\usr\bin`.
|
||||||
|
|
||||||
|
For native Windows flashing, the `bootloadHID.exe` can be used outside of the MSYS2 environment.
|
||||||
|
|
||||||
|
### Linux Manual Installation
|
||||||
|
1. Install libusb development dependency:
|
||||||
|
```bash
|
||||||
|
# This depends on OS - for Debian the following works
|
||||||
|
sudo apt-get install libusb-dev
|
||||||
|
```
|
||||||
|
2. Download the BootloadHID firmware package:
|
||||||
|
```
|
||||||
|
wget https://www.obdev.at/downloads/vusb/bootloadHID.2012-12-08.tar.gz -O - | tar -xz -C /tmp
|
||||||
|
```
|
||||||
|
3. Build the bootloadHID executable:
|
||||||
|
```
|
||||||
|
cd /tmp/bootloadHID.2012-12-08/commandline/
|
||||||
|
make
|
||||||
|
sudo cp bootloadHID /usr/local/bin
|
||||||
|
```
|
||||||
|
|
||||||
|
### MacOS Manual Installation
|
||||||
|
1. Install Homebrew by typing the following:
|
||||||
|
```
|
||||||
|
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
|
||||||
|
```
|
||||||
|
2. Install the following packages:
|
||||||
|
```
|
||||||
|
brew install --HEAD https://raw.githubusercontent.com/robertgzr/homebrew-tap/master/bootloadhid.rb
|
||||||
|
```
|
@ -14,7 +14,7 @@ The full syntax of the `make` command is `<keyboard_folder>:<keymap>:<target>`,
|
|||||||
The `<target>` means the following
|
The `<target>` means the following
|
||||||
* If no target is given, then it's the same as `all` below
|
* If no target is given, then it's the same as `all` below
|
||||||
* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck.
|
* `all` compiles as many keyboard/revision/keymap combinations as specified. For example, `make planck/rev4:default` will generate a single .hex, while `make planck/rev4:all` will generate a hex for every keymap available to the planck.
|
||||||
* `dfu`, `teensy`, `avrdude` or `dfu-util`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
|
* `dfu`, `teensy`, `avrdude`, `dfu-util` or `bootloadHID`, compile and upload the firmware to the keyboard. If the compilation fails, then nothing will be uploaded. The programmer to use depends on the keyboard. For most keyboards it's `dfu`, but for ChibiOS keyboards you should use `dfu-util`, and `teensy` for standard Teensys. To find out which command you should use for your keyboard, check the keyboard specific readme.
|
||||||
* **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`.
|
* **Note**: some operating systems need root access for these commands to work, so in that case you need to run for example `sudo make planck/rev4:default:dfu`.
|
||||||
* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.
|
* `clean`, cleans the build output folders to make sure that everything is built from scratch. Run this before normal compilation if you have some unexplainable problems.
|
||||||
|
|
||||||
@ -83,7 +83,7 @@ This allows the keyboard to tell the host OS that up to 248 keys are held down a
|
|||||||
|
|
||||||
`BACKLIGHT_ENABLE`
|
`BACKLIGHT_ENABLE`
|
||||||
|
|
||||||
This enables your backlight on Timer1 and ports B5, B6, or B7 (for now). You can specify your port by putting this in your `config.h`:
|
This enables the in-switch LED backlighting. You can specify the backlight pin by putting this in your `config.h`:
|
||||||
|
|
||||||
#define BACKLIGHT_PIN B7
|
#define BACKLIGHT_PIN B7
|
||||||
|
|
||||||
|
@ -78,7 +78,7 @@ Do change the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` lines to accurately r
|
|||||||
#define DESCRIPTION A custom keyboard
|
#define DESCRIPTION A custom keyboard
|
||||||
```
|
```
|
||||||
|
|
||||||
?> Note: On Windows and macOS the `MANUFACTURER`, `PRODUCT`, and `DESCRIPTION` fields will be displayed in the list of USB devices. ?> On Linux these values will not be visible in lsusb by default, since Linux takes the information from the list maintained by [USB ID Repository](http://www.linux-usb.org/usb-ids.html) by default. lsusb will show the information reported by the device when executed with -v option. It is also present in kernel logs after plugging in the device.
|
?> Windows and macOS will display the `MANUFACTURER` and `PRODUCT` in the list of USB devices. `lsusb` on Linux instead takes these from the list maintained by the [USB ID Repository](http://www.linux-usb.org/usb-ids.html) by default. `lsusb -v` will show the values reported by the device, and they are also present in kernel logs after plugging it in.
|
||||||
|
|
||||||
### Keyboard Matrix Configuration
|
### Keyboard Matrix Configuration
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ To configure a keyboard where each switch is connected to a separate pin and gro
|
|||||||
|
|
||||||
### Backlight Configuration
|
### Backlight Configuration
|
||||||
|
|
||||||
By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are using one of those you can simply enable it here. For more details see the [Backlight Documentation](feature_backlight.md).
|
QMK supports backlighting on most GPIO pins. A select few of these can be driven by the MCU in hardware. For more details see the [Backlight Documentation](feature_backlight.md).
|
||||||
|
|
||||||
```c
|
```c
|
||||||
#define BACKLIGHT_PIN B7
|
#define BACKLIGHT_PIN B7
|
||||||
@ -134,8 +134,6 @@ By default QMK supports backlighting on pins `B5`, `B6`, and `B7`. If you are us
|
|||||||
#define BREATHING_PERIOD 6
|
#define BREATHING_PERIOD 6
|
||||||
```
|
```
|
||||||
|
|
||||||
?> You can use backlighting on any pin you like, but you will have to do more work to support that. See the [Backlight Documentation](feature_backlight.md) for more details.
|
|
||||||
|
|
||||||
### Other Configuration Options
|
### Other Configuration Options
|
||||||
|
|
||||||
There are a lot of features that can be configured or tuned in `config.h`. You should see the [Config Options](config_options.md) page for more details.
|
There are a lot of features that can be configured or tuned in `config.h`. You should see the [Config Options](config_options.md) page for more details.
|
||||||
|
@ -33,7 +33,11 @@ The firmware does not send actual letters or characters, but only scancodes.
|
|||||||
Thus, by modifying the firmware, you can only modify what scancode is sent over
|
Thus, by modifying the firmware, you can only modify what scancode is sent over
|
||||||
USB for a given key.
|
USB for a given key.
|
||||||
|
|
||||||
## 3. What the Operating System Does
|
## 3. What the Event Input/Kernel Does
|
||||||
|
|
||||||
|
The *scancode* is mapped to a *keycode* dependent on the keyboard [60-keyboard.hwdb at Master](https://github.com/systemd/systemd/blob/master/hwdb/60-keyboard.hwdb). Without this mapping, the operating system will not receive a valid keycode and will be unable to do anything useful with that key press.
|
||||||
|
|
||||||
|
## 4. What the Operating System Does
|
||||||
|
|
||||||
Once the keycode reaches the operating system, a piece of software has to have
|
Once the keycode reaches the operating system, a piece of software has to have
|
||||||
it match an actual character thanks to a keyboard layout. For example, if your
|
it match an actual character thanks to a keyboard layout. For example, if your
|
||||||
|
@ -7,7 +7,7 @@ The I2C Master drivers used in QMK have a set of common functions to allow porta
|
|||||||
|Function |Description |
|
|Function |Description |
|
||||||
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||||
|`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. |
|
|`void i2c_init(void);` |Initializes the I2C driver. This function should be called once before any transaction is initiated. |
|
||||||
|`uint8_t i2c_start(uint8_t address);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. |
|
|`uint8_t i2c_start(uint8_t address, uint16_t timeout);` |Starts an I2C transaction. Address is the 7-bit slave address without the direction bit. |
|
||||||
|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. |
|
|`uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Transmit data over I2C. Address is the 7-bit slave address without the direction. Returns status of transaction. |
|
||||||
|`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. |
|
|`uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout);` |Receive data over I2C. Address is the 7-bit slave address without the direction. Saves number of bytes specified by `length` in `data` array. Returns status of transaction. |
|
||||||
|`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. |
|
|`uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout);` |Same as the `i2c_transmit` function but `regaddr` sets where in the slave the data will be written. |
|
||||||
@ -34,7 +34,6 @@ The following defines can be used to configure the I2C master driver.
|
|||||||
|Variable |Description |Default|
|
|Variable |Description |Default|
|
||||||
|------------------|---------------------------------------------------|-------|
|
|------------------|---------------------------------------------------|-------|
|
||||||
|`F_SCL` |Clock frequency in Hz |400KHz |
|
|`F_SCL` |Clock frequency in Hz |400KHz |
|
||||||
|`Prescaler` |Divides master clock to aid in I2C clock selection |1 |
|
|
||||||
|
|
||||||
AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required.
|
AVRs usually have set GPIO which turn into I2C pins, therefore no further configuration is required.
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
|
||||||
<meta property="og:title" content="QMK Firmware Docs">
|
<meta property="og:title" content="QMK Firmware Docs">
|
||||||
<meta property="og:type" content="website">
|
<meta property="og:type" content="website">
|
||||||
<meta property="og:description" content="The full documenation of the open-source firmware">
|
<meta property="og:description" content="The full documentation of the open-source firmware">
|
||||||
<meta property="og:image" content="https://i.imgur.com/svjvIrw.jpg">
|
<meta property="og:image" content="https://i.imgur.com/svjvIrw.jpg">
|
||||||
<meta property="og:url" content="https://docs.qmk.fm">
|
<meta property="og:url" content="https://docs.qmk.fm">
|
||||||
<meta name="twitter:card" content="summary_large_image">
|
<meta name="twitter:card" content="summary_large_image">
|
||||||
|
@ -261,6 +261,8 @@ This is a reference only. Each group of keys links to the page documenting their
|
|||||||
|----------------------------------|---------|------------------------------------|
|
|----------------------------------|---------|------------------------------------|
|
||||||
|`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Caps Lock and Left Control |
|
|`MAGIC_SWAP_CONTROL_CAPSLOCK` | |Swap Caps Lock and Left Control |
|
||||||
|`MAGIC_CAPSLOCK_TO_CONTROL` | |Treat Caps Lock as Control |
|
|`MAGIC_CAPSLOCK_TO_CONTROL` | |Treat Caps Lock as Control |
|
||||||
|
|`MAGIC_SWAP_LCTL_LGUI` | |Swap Left Control and GUI |
|
||||||
|
|`MAGIC_SWAP_RCTL_RGUI` | |Swap Right Control and GUI |
|
||||||
|`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and GUI |
|
|`MAGIC_SWAP_LALT_LGUI` | |Swap Left Alt and GUI |
|
||||||
|`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and GUI |
|
|`MAGIC_SWAP_RALT_RGUI` | |Swap Right Alt and GUI |
|
||||||
|`MAGIC_NO_GUI` | |Disable the GUI key |
|
|`MAGIC_NO_GUI` | |Disable the GUI key |
|
||||||
@ -268,8 +270,11 @@ This is a reference only. Each group of keys links to the page documenting their
|
|||||||
|`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace |
|
|`MAGIC_SWAP_BACKSLASH_BACKSPACE` | |Swap `\` and Backspace |
|
||||||
|`MAGIC_HOST_NKRO` | |Force NKRO on |
|
|`MAGIC_HOST_NKRO` | |Force NKRO on |
|
||||||
|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides |
|
|`MAGIC_SWAP_ALT_GUI` |`AG_SWAP`|Swap Alt and GUI on both sides |
|
||||||
|
|`MAGIC_SWAP_CTL_GUI` |`CG_SWAP`|Swap Ctrl and GUI on both sides (for macOS)|
|
||||||
|`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Caps Lock and Left Control |
|
|`MAGIC_UNSWAP_CONTROL_CAPSLOCK` | |Unswap Caps Lock and Left Control |
|
||||||
|`MAGIC_UNCAPSLOCK_TO_CONTROL` | |Stop treating Caps Lock as Control |
|
|`MAGIC_UNCAPSLOCK_TO_CONTROL` | |Stop treating Caps Lock as Control |
|
||||||
|
|`MAGIC_UNSWAP_LCTL_LGUI` | |Unswap Left Control and GUI |
|
||||||
|
|`MAGIC_UNSWAP_RCTL_RGUI` | |Unswap Right Control and GUI |
|
||||||
|`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and GUI |
|
|`MAGIC_UNSWAP_LALT_LGUI` | |Unswap Left Alt and GUI |
|
||||||
|`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and GUI |
|
|`MAGIC_UNSWAP_RALT_RGUI` | |Unswap Right Alt and GUI |
|
||||||
|`MAGIC_UNNO_GUI` | |Enable the GUI key |
|
|`MAGIC_UNNO_GUI` | |Enable the GUI key |
|
||||||
@ -277,7 +282,9 @@ This is a reference only. Each group of keys links to the page documenting their
|
|||||||
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace |
|
|`MAGIC_UNSWAP_BACKSLASH_BACKSPACE`| |Unswap `\` and Backspace |
|
||||||
|`MAGIC_UNHOST_NKRO` | |Force NKRO off |
|
|`MAGIC_UNHOST_NKRO` | |Force NKRO off |
|
||||||
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides |
|
|`MAGIC_UNSWAP_ALT_GUI` |`AG_NORM`|Unswap Alt and GUI on both sides |
|
||||||
|
|`MAGIC_UNSWAP_CTL_GUI` |`CG_NORM`|Unswap Ctrl and GUI on both sides |
|
||||||
|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides |
|
|`MAGIC_TOGGLE_ALT_GUI` |`AG_TOGG`|Toggle Alt and GUI swap on both sides |
|
||||||
|
|`MAGIC_TOGGLE_CTL_GUI` |`CG_TOGG`|Toggle Ctrl and GUI swap on both sides |
|
||||||
|`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off |
|
|`MAGIC_TOGGLE_NKRO` | |Turn NKRO on or off |
|
||||||
|
|
||||||
## [Bluetooth](feature_bluetooth.md)
|
## [Bluetooth](feature_bluetooth.md)
|
||||||
|
@ -248,6 +248,42 @@ Programming.....................................................................
|
|||||||
Booting
|
Booting
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## BootloadHID
|
||||||
|
|
||||||
|
For Bootmapper Client(BMC)/bootloadHID/ATmega32A based boards, when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
|
||||||
|
|
||||||
|
make <my_keyboard>:<my_keymap>:bootloaderHID
|
||||||
|
|
||||||
|
For example, if your keymap is named "xyverz" and you're building a keymap for a jj40, you'll use this command:
|
||||||
|
|
||||||
|
make jj40:xyverz:bootloaderHID
|
||||||
|
|
||||||
|
Once the firmware finishes compiling, it will output something like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
Linking: .build/jj40_default.elf [OK]
|
||||||
|
Creating load file for flashing: .build/jj40_default.hex [OK]
|
||||||
|
Copying jj40_default.hex to qmk_firmware folder [OK]
|
||||||
|
Checking file size of jj40_default.hex [OK]
|
||||||
|
* The firmware size is fine - 21920/28672 (6752 bytes free)
|
||||||
|
```
|
||||||
|
|
||||||
|
After it gets to this point, the build script will look for the DFU bootloader every 5 seconds. It will repeat the following until the device is found or you cancel it.
|
||||||
|
|
||||||
|
```
|
||||||
|
Error opening HIDBoot device: The specified device was not found
|
||||||
|
Trying again in 5s.
|
||||||
|
```
|
||||||
|
|
||||||
|
Once it does this, you'll want to reset the controller. It should then show output similar to this:
|
||||||
|
|
||||||
|
```
|
||||||
|
Page size = 128 (0x80)
|
||||||
|
Device size = 32768 (0x8000); 30720 bytes remaining
|
||||||
|
Uploading 22016 (0x5600) bytes starting at 0 (0x0)
|
||||||
|
0x05580 ... 0x05600
|
||||||
|
```
|
||||||
|
|
||||||
## STM32 (ARM)
|
## STM32 (ARM)
|
||||||
|
|
||||||
For a majority of ARM boards (including the Proton C, Planck Rev 6, and Preonic Rev 3), when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
|
For a majority of ARM boards (including the Proton C, Planck Rev 6, and Preonic Rev 3), when you're ready to compile and flash your firmware, open up your terminal window and run the build command:
|
||||||
|
@ -34,7 +34,7 @@ For the `DIODE_DIRECTION`, most hand-wiring guides will instruct you to wire the
|
|||||||
|
|
||||||
To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `DIRECT_PINS`. The mapping defines the pins of each switch in rows and columns, from left to right. Must conform to the sizes within `MATRIX_ROWS` and `MATRIX_COLS`, use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `DIODE_DIRECTION`, `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`.
|
To configure a keyboard where each switch is connected to a separate pin and ground instead of sharing row and column pins, use `DIRECT_PINS`. The mapping defines the pins of each switch in rows and columns, from left to right. Must conform to the sizes within `MATRIX_ROWS` and `MATRIX_COLS`, use `NO_PIN` to fill in blank spaces. Overrides the behaviour of `DIODE_DIRECTION`, `MATRIX_ROW_PINS` and `MATRIX_COL_PINS`.
|
||||||
|
|
||||||
`BACKLIGHT_PIN` is the pin that your PWM-controlled backlight (if one exists) is hooked-up to. Currently only B5, B6, and B7 are supported.
|
`BACKLIGHT_PIN` is the pin that your PWM-controlled backlight (if one exists) is hooked-up to.
|
||||||
|
|
||||||
`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
|
`BACKLIGHT_BREATHING` is a fancier backlight feature that adds breathing/pulsing/fading effects to the backlight. It uses the same timer as the normal backlight. These breathing effects must be called by code in your keymap.
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ The caveat to this method is that you cannot access the `z` layer without having
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```c
|
```c
|
||||||
uint32_t layer_state_set_user(uint32_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@ -58,7 +58,7 @@ uint32_t layer_state_set_user(uint32_t state) {
|
|||||||
Alternatively, you don't have to immediately "return" the value. This is useful if you want to add multiple tri layers, or if you want to add additional effects.
|
Alternatively, you don't have to immediately "return" the value. This is useful if you want to add multiple tri layers, or if you want to add additional effects.
|
||||||
|
|
||||||
```c
|
```c
|
||||||
uint32_t layer_state_set_user(uint32_t state) {
|
layer_state_t layer_state_set_user(layer_state_t state) {
|
||||||
state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
state = update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
|
||||||
state = update_tri_layer_state(state, _RAISE, _SYMB, _SPECIAL);
|
state = update_tri_layer_state(state, _RAISE, _SYMB, _SPECIAL);
|
||||||
return state;
|
return state;
|
||||||
|
@ -54,6 +54,7 @@
|
|||||||
* [热改键](feature_bootmagic.md)
|
* [热改键](feature_bootmagic.md)
|
||||||
* [组合](feature_combo)
|
* [组合](feature_combo)
|
||||||
* [命令](feature_command.md)
|
* [命令](feature_command.md)
|
||||||
|
* [拨动开关](feature_dip_switch.md)
|
||||||
* [动态宏指令](feature_dynamic_macros.md)
|
* [动态宏指令](feature_dynamic_macros.md)
|
||||||
* [编码器](feature_encoders.md)
|
* [编码器](feature_encoders.md)
|
||||||
* [重音号Esc复合键](feature_grave_esc.md)
|
* [重音号Esc复合键](feature_grave_esc.md)
|
||||||
|
@ -173,23 +173,6 @@ EXTRAKEY_ENABLE = yes # 音频控制和系统控制
|
|||||||
|
|
||||||
Arduino Leonardo和micro使用**ATMega32U4**,该芯片TMK可用,但Arduino的bootloader会导致问题。
|
Arduino Leonardo和micro使用**ATMega32U4**,该芯片TMK可用,但Arduino的bootloader会导致问题。
|
||||||
|
|
||||||
|
|
||||||
## 在USB AVR使用PF4-7针脚?
|
|
||||||
你要置位MCUCR寄存器JTD位来将PF4-7设置为GPIO。这些针脚默认是JTAG功能。 像ATMega*U* or AT90USB*这样的MCU会受影响。
|
|
||||||
|
|
||||||
如果是用Teensy的话就不需要了。Tennsy自带JTAGEN位未编程来失能该功能。
|
|
||||||
<!--翻译问题:上句可能有错,原文为:Teensy is shipped with JTAGEN fuse bit unprogrammed to disable the function. -->
|
|
||||||
代码如下。
|
|
||||||
```
|
|
||||||
// F接口JTAG失能。在四个周期内写入两次JTD位。
|
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
MCUCR |= (1<<JTD);
|
|
||||||
```
|
|
||||||
https://github.com/tmk/tmk_keyboard/blob/master/keyboard/hbkb/matrix.c#L67
|
|
||||||
|
|
||||||
阅读ATMega32U4的datasheet中的**26.5.1 MCU Control Register – MCUCR**。
|
|
||||||
|
|
||||||
|
|
||||||
## 为锁定键添加指示灯
|
## 为锁定键添加指示灯
|
||||||
你要自制CapsLock, ScrollLock 和 NumLock指示灯?见下文。
|
你要自制CapsLock, ScrollLock 和 NumLock指示灯?见下文。
|
||||||
|
|
||||||
|
@ -38,11 +38,7 @@ static const I2CConfig i2cconfig = {
|
|||||||
I2C1_CLOCK_SPEED,
|
I2C1_CLOCK_SPEED,
|
||||||
I2C1_DUTY_CYCLE,
|
I2C1_DUTY_CYCLE,
|
||||||
#else
|
#else
|
||||||
STM32_TIMINGR_PRESC(I2C1_TIMINGR_PRESC) |
|
STM32_TIMINGR_PRESC(I2C1_TIMINGR_PRESC) | STM32_TIMINGR_SCLDEL(I2C1_TIMINGR_SCLDEL) | STM32_TIMINGR_SDADEL(I2C1_TIMINGR_SDADEL) | STM32_TIMINGR_SCLH(I2C1_TIMINGR_SCLH) | STM32_TIMINGR_SCLL(I2C1_TIMINGR_SCLL), 0, 0
|
||||||
STM32_TIMINGR_SCLDEL(I2C1_TIMINGR_SCLDEL) | STM32_TIMINGR_SDADEL(I2C1_TIMINGR_SDADEL) |
|
|
||||||
STM32_TIMINGR_SCLH(I2C1_TIMINGR_SCLH) | STM32_TIMINGR_SCLL(I2C1_TIMINGR_SCLL),
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -58,9 +54,7 @@ static i2c_status_t chibios_to_qmk(const msg_t* status) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__((weak)) void i2c_init(void) {
|
||||||
void i2c_init(void)
|
|
||||||
{
|
|
||||||
// Try releasing special pins for a short time
|
// Try releasing special pins for a short time
|
||||||
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_INPUT);
|
palSetPadMode(I2C1_SCL_BANK, I2C1_SCL, PAL_MODE_INPUT);
|
||||||
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_INPUT);
|
palSetPadMode(I2C1_SDA_BANK, I2C1_SDA, PAL_MODE_INPUT);
|
||||||
@ -78,37 +72,32 @@ void i2c_init(void)
|
|||||||
// i2cInit(); //This is invoked by halInit() so no need to redo it.
|
// i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_start(uint8_t address)
|
i2c_status_t i2c_start(uint8_t address) {
|
||||||
{
|
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
return I2C_STATUS_SUCCESS;
|
return I2C_STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_transmit(uint8_t address, const uint8_t* data, uint16_t length, uint16_t timeout) {
|
||||||
{
|
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout));
|
msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout));
|
||||||
return chibios_to_qmk(&status);
|
return chibios_to_qmk(&status);
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout) {
|
||||||
{
|
|
||||||
i2c_address = address;
|
i2c_address = address;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout));
|
msg_t status = i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout));
|
||||||
return chibios_to_qmk(&status);
|
return chibios_to_qmk(&status);
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data, uint16_t length, uint16_t timeout) {
|
||||||
{
|
|
||||||
i2c_address = devaddr;
|
i2c_address = devaddr;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
|
|
||||||
uint8_t complete_packet[length + 1];
|
uint8_t complete_packet[length + 1];
|
||||||
for(uint8_t i = 0; i < length; i++)
|
for (uint8_t i = 0; i < length; i++) {
|
||||||
{
|
|
||||||
complete_packet[i + 1] = data[i];
|
complete_packet[i + 1] = data[i];
|
||||||
}
|
}
|
||||||
complete_packet[0] = regaddr;
|
complete_packet[0] = regaddr;
|
||||||
@ -117,15 +106,11 @@ i2c_status_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, const uint8_t* data,
|
|||||||
return chibios_to_qmk(&status);
|
return chibios_to_qmk(&status);
|
||||||
}
|
}
|
||||||
|
|
||||||
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
i2c_status_t i2c_readReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout) {
|
||||||
{
|
|
||||||
i2c_address = devaddr;
|
i2c_address = devaddr;
|
||||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||||
msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), ®addr, 1, data, length, MS2ST(timeout));
|
msg_t status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), ®addr, 1, data, length, MS2ST(timeout));
|
||||||
return chibios_to_qmk(&status);
|
return chibios_to_qmk(&status);
|
||||||
}
|
}
|
||||||
|
|
||||||
void i2c_stop(void)
|
void i2c_stop(void) { i2cStop(&I2C_DRIVER); }
|
||||||
{
|
|
||||||
i2cStop(&I2C_DRIVER);
|
|
||||||
}
|
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
#include "ch.h"
|
#include "ch.h"
|
||||||
#include <hal.h>
|
#include <hal.h>
|
||||||
|
|
||||||
|
|
||||||
#if defined(STM32F1XX) || defined(STM32F1xx) || defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32L0xx) || defined(STM32L1xx)
|
#if defined(STM32F1XX) || defined(STM32F1xx) || defined(STM32F2xx) || defined(STM32F4xx) || defined(STM32L0xx) || defined(STM32L1xx)
|
||||||
# define USE_I2CV1
|
# define USE_I2CV1
|
||||||
#endif
|
#endif
|
||||||
|
@ -21,23 +21,14 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "analog.h"
|
#include "analog.h"
|
||||||
|
|
||||||
|
|
||||||
static uint8_t aref = (1 << REFS0); // default to AREF = Vcc
|
static uint8_t aref = (1 << REFS0); // default to AREF = Vcc
|
||||||
|
|
||||||
|
void analogReference(uint8_t mode) { aref = mode & 0xC0; }
|
||||||
void analogReference(uint8_t mode)
|
|
||||||
{
|
|
||||||
aref = mode & 0xC0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Arduino compatible pin input
|
// Arduino compatible pin input
|
||||||
int16_t analogRead(uint8_t pin)
|
int16_t analogRead(uint8_t pin) {
|
||||||
{
|
|
||||||
#if defined(__AVR_ATmega32U4__)
|
#if defined(__AVR_ATmega32U4__)
|
||||||
static const uint8_t PROGMEM pin_to_mux[] = {
|
static const uint8_t PROGMEM pin_to_mux[] = {0x00, 0x01, 0x04, 0x05, 0x06, 0x07, 0x25, 0x24, 0x23, 0x22, 0x21, 0x20};
|
||||||
0x00, 0x01, 0x04, 0x05, 0x06, 0x07,
|
|
||||||
0x25, 0x24, 0x23, 0x22, 0x21, 0x20};
|
|
||||||
if (pin >= 12) return 0;
|
if (pin >= 12) return 0;
|
||||||
return adc_read(pgm_read_byte(pin_to_mux + pin));
|
return adc_read(pgm_read_byte(pin_to_mux + pin));
|
||||||
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
|
#elif defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__)
|
||||||
@ -49,8 +40,7 @@ int16_t analogRead(uint8_t pin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Mux input
|
// Mux input
|
||||||
int16_t adc_read(uint8_t mux)
|
int16_t adc_read(uint8_t mux) {
|
||||||
{
|
|
||||||
#if defined(__AVR_AT90USB162__)
|
#if defined(__AVR_AT90USB162__)
|
||||||
return 0;
|
return 0;
|
||||||
#else
|
#else
|
||||||
@ -60,10 +50,9 @@ int16_t adc_read(uint8_t mux)
|
|||||||
ADCSRB = (1 << ADHSM) | (mux & 0x20); // high speed mode
|
ADCSRB = (1 << ADHSM) | (mux & 0x20); // high speed mode
|
||||||
ADMUX = aref | (mux & 0x1F); // configure mux input
|
ADMUX = aref | (mux & 0x1F); // configure mux input
|
||||||
ADCSRA = (1 << ADEN) | ADC_PRESCALER | (1 << ADSC); // start the conversion
|
ADCSRA = (1 << ADEN) | ADC_PRESCALER | (1 << ADSC); // start the conversion
|
||||||
while (ADCSRA & (1<<ADSC)) ; // wait for result
|
while (ADCSRA & (1 << ADSC))
|
||||||
|
; // wait for result
|
||||||
low = ADCL; // must read LSB first
|
low = ADCL; // must read LSB first
|
||||||
return (ADCH << 8) | low; // must read MSB only once!
|
return (ADCH << 8) | low; // must read MSB only once!
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -19,9 +19,15 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
void analogReference(uint8_t mode);
|
void analogReference(uint8_t mode);
|
||||||
int16_t analogRead(uint8_t pin);
|
int16_t analogRead(uint8_t pin);
|
||||||
int16_t adc_read(uint8_t mux);
|
int16_t adc_read(uint8_t mux);
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ADC_REF_POWER (1 << REFS0)
|
#define ADC_REF_POWER (1 << REFS0)
|
||||||
#define ADC_REF_INTERNAL ((1 << REFS1) | (1 << REFS0))
|
#define ADC_REF_INTERNAL ((1 << REFS1) | (1 << REFS0))
|
||||||
|
11
drivers/avr/apa102.c
Executable file → Normal file
11
drivers/avr/apa102.c
Executable file → Normal file
@ -27,9 +27,7 @@
|
|||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
// Setleds for standard RGB
|
// Setleds for standard RGB
|
||||||
void inline apa102_setleds(LED_TYPE *ledarray, uint16_t leds){
|
void inline apa102_setleds(LED_TYPE *ledarray, uint16_t leds) { apa102_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF), _BV(RGB_CLK_PIN & 0xF)); }
|
||||||
apa102_setleds_pin(ledarray,leds, _BV(RGB_DI_PIN & 0xF), _BV(RGB_CLK_PIN & 0xF));
|
|
||||||
}
|
|
||||||
|
|
||||||
void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK) {
|
void static inline apa102_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask_DI, uint8_t pinmask_CLK) {
|
||||||
pinMode(RGB_DI_PIN, PinDirectionOutput);
|
pinMode(RGB_DI_PIN, PinDirectionOutput);
|
||||||
@ -54,12 +52,9 @@ void apa102_send_frame(uint32_t frame){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void apa102_start_frame(){
|
void apa102_start_frame() { apa102_send_frame(0); }
|
||||||
apa102_send_frame(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void apa102_end_frame(uint16_t leds)
|
void apa102_end_frame(uint16_t leds) {
|
||||||
{
|
|
||||||
// This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h
|
// This function has been taken from: https://github.com/pololu/apa102-arduino/blob/master/APA102.h
|
||||||
// and adapted. The code is MIT licensed. I think thats compatible?
|
// and adapted. The code is MIT licensed. I think thats compatible?
|
||||||
|
|
||||||
|
1
drivers/avr/apa102.h
Executable file → Normal file
1
drivers/avr/apa102.h
Executable file → Normal file
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
|
|
||||||
|
|
||||||
/* User Interface
|
/* User Interface
|
||||||
*
|
*
|
||||||
* Input:
|
* Input:
|
||||||
|
@ -16,261 +16,19 @@
|
|||||||
// Standard ASCII 5x7 font
|
// Standard ASCII 5x7 font
|
||||||
|
|
||||||
static const unsigned char font[] PROGMEM = {
|
static const unsigned char font[] PROGMEM = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, 0x18, 0x3C, 0x18, 0x00, 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, 0x18, 0x24, 0x18, 0x00, 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x26, 0x29, 0x79, 0x29, 0x26, 0x40, 0x7F, 0x05, 0x05, 0x07, 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, 0x66, 0x89, 0x95, 0x6A, 0x60, 0x60, 0x60, 0x60, 0x60, 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x20, 0x10, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x1E, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x1E, 0x0C, 0x1E, 0x0C,
|
||||||
0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
|
0x30, 0x38, 0x3E, 0x38, 0x30, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x23, 0x13, 0x08, 0x64, 0x62, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x80, 0x70, 0x30, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x60, 0x60, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x72, 0x49, 0x49, 0x49, 0x46, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x27, 0x45, 0x45, 0x45, 0x39, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x41, 0x21, 0x11, 0x09, 0x07, 0x36, 0x49, 0x49, 0x49, 0x36, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00,
|
||||||
0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
|
0x00, 0x08, 0x14, 0x22, 0x41, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x41, 0x22, 0x14, 0x08, 0x02, 0x01, 0x59, 0x09, 0x06, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x7F, 0x08, 0x14, 0x22, 0x41, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x26, 0x49, 0x49, 0x49, 0x32, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x63, 0x14, 0x08, 0x14, 0x63, 0x03, 0x04, 0x78, 0x04, 0x03,
|
||||||
0x1C, 0x3E, 0x7C, 0x3E, 0x1C,
|
0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x04, 0x02, 0x01, 0x02, 0x04, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x03, 0x07, 0x08, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x38, 0x44, 0x44, 0x44, 0x28, 0x38, 0x44, 0x44, 0x28, 0x7F, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x38, 0x44, 0x44, 0x44, 0x38, 0xFC, 0x18, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x18, 0xFC, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x48, 0x54, 0x54, 0x54, 0x24, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x3C, 0x40, 0x30, 0x40, 0x3C,
|
||||||
0x18, 0x3C, 0x7E, 0x3C, 0x18,
|
0x44, 0x28, 0x10, 0x28, 0x44, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x1E, 0xA1, 0xA1, 0x61, 0x12, 0x3A, 0x40, 0x40, 0x20, 0x7A, 0x38, 0x54, 0x54, 0x55, 0x59, 0x21, 0x55, 0x55, 0x79, 0x41, 0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut
|
||||||
0x1C, 0x57, 0x7D, 0x57, 0x1C,
|
0x21, 0x55, 0x54, 0x78, 0x40, 0x20, 0x54, 0x55, 0x79, 0x40, 0x0C, 0x1E, 0x52, 0x72, 0x12, 0x39, 0x55, 0x55, 0x55, 0x59, 0x39, 0x54, 0x54, 0x54, 0x59, 0x39, 0x55, 0x54, 0x54, 0x58, 0x00, 0x00, 0x45, 0x7C, 0x41, 0x00, 0x02, 0x45, 0x7D, 0x42, 0x00, 0x01, 0x45, 0x7C, 0x40, 0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut
|
||||||
0x1C, 0x5E, 0x7F, 0x5E, 0x1C,
|
0xF0, 0x28, 0x25, 0x28, 0xF0, 0x7C, 0x54, 0x55, 0x45, 0x00, 0x20, 0x54, 0x54, 0x7C, 0x54, 0x7C, 0x0A, 0x09, 0x7F, 0x49, 0x32, 0x49, 0x49, 0x49, 0x32, 0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut
|
||||||
0x00, 0x18, 0x3C, 0x18, 0x00,
|
0x32, 0x4A, 0x48, 0x48, 0x30, 0x3A, 0x41, 0x41, 0x21, 0x7A, 0x3A, 0x42, 0x40, 0x20, 0x78, 0x00, 0x9D, 0xA0, 0xA0, 0x7D, 0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut
|
||||||
0xFF, 0xE7, 0xC3, 0xE7, 0xFF,
|
0x3D, 0x40, 0x40, 0x40, 0x3D, 0x3C, 0x24, 0xFF, 0x24, 0x24, 0x48, 0x7E, 0x49, 0x43, 0x66, 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, 0xFF, 0x09, 0x29, 0xF6, 0x20, 0xC0, 0x88, 0x7E, 0x09, 0x03, 0x20, 0x54, 0x54, 0x79, 0x41, 0x00, 0x00, 0x44, 0x7D, 0x41, 0x30, 0x48, 0x48, 0x4A, 0x32, 0x38, 0x40, 0x40, 0x22, 0x7A, 0x00, 0x7A, 0x0A, 0x0A, 0x72, 0x7D, 0x0D, 0x19, 0x31, 0x7D, 0x26, 0x29, 0x29, 0x2F, 0x28, 0x26, 0x29, 0x29, 0x29, 0x26, 0x30, 0x48, 0x4D, 0x40, 0x20, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x2F, 0x10, 0xC8, 0xAC, 0xBA, 0x2F, 0x10, 0x28, 0x34, 0xFA, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x08, 0x14, 0x2A, 0x14, 0x22, 0x22, 0x14, 0x2A, 0x14, 0x08, 0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code
|
||||||
0x00, 0x18, 0x24, 0x18, 0x00,
|
|
||||||
0xFF, 0xE7, 0xDB, 0xE7, 0xFF,
|
|
||||||
0x30, 0x48, 0x3A, 0x06, 0x0E,
|
|
||||||
0x26, 0x29, 0x79, 0x29, 0x26,
|
|
||||||
0x40, 0x7F, 0x05, 0x05, 0x07,
|
|
||||||
0x40, 0x7F, 0x05, 0x25, 0x3F,
|
|
||||||
0x5A, 0x3C, 0xE7, 0x3C, 0x5A,
|
|
||||||
0x7F, 0x3E, 0x1C, 0x1C, 0x08,
|
|
||||||
0x08, 0x1C, 0x1C, 0x3E, 0x7F,
|
|
||||||
0x14, 0x22, 0x7F, 0x22, 0x14,
|
|
||||||
0x5F, 0x5F, 0x00, 0x5F, 0x5F,
|
|
||||||
0x06, 0x09, 0x7F, 0x01, 0x7F,
|
|
||||||
0x00, 0x66, 0x89, 0x95, 0x6A,
|
|
||||||
0x60, 0x60, 0x60, 0x60, 0x60,
|
|
||||||
0x94, 0xA2, 0xFF, 0xA2, 0x94,
|
|
||||||
0x08, 0x04, 0x7E, 0x04, 0x08,
|
|
||||||
0x10, 0x20, 0x7E, 0x20, 0x10,
|
|
||||||
0x08, 0x08, 0x2A, 0x1C, 0x08,
|
|
||||||
0x08, 0x1C, 0x2A, 0x08, 0x08,
|
|
||||||
0x1E, 0x10, 0x10, 0x10, 0x10,
|
|
||||||
0x0C, 0x1E, 0x0C, 0x1E, 0x0C,
|
|
||||||
0x30, 0x38, 0x3E, 0x38, 0x30,
|
|
||||||
0x06, 0x0E, 0x3E, 0x0E, 0x06,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x5F, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x07, 0x00,
|
|
||||||
0x14, 0x7F, 0x14, 0x7F, 0x14,
|
|
||||||
0x24, 0x2A, 0x7F, 0x2A, 0x12,
|
|
||||||
0x23, 0x13, 0x08, 0x64, 0x62,
|
|
||||||
0x36, 0x49, 0x56, 0x20, 0x50,
|
|
||||||
0x00, 0x08, 0x07, 0x03, 0x00,
|
|
||||||
0x00, 0x1C, 0x22, 0x41, 0x00,
|
|
||||||
0x00, 0x41, 0x22, 0x1C, 0x00,
|
|
||||||
0x2A, 0x1C, 0x7F, 0x1C, 0x2A,
|
|
||||||
0x08, 0x08, 0x3E, 0x08, 0x08,
|
|
||||||
0x00, 0x80, 0x70, 0x30, 0x00,
|
|
||||||
0x08, 0x08, 0x08, 0x08, 0x08,
|
|
||||||
0x00, 0x00, 0x60, 0x60, 0x00,
|
|
||||||
0x20, 0x10, 0x08, 0x04, 0x02,
|
|
||||||
0x3E, 0x51, 0x49, 0x45, 0x3E,
|
|
||||||
0x00, 0x42, 0x7F, 0x40, 0x00,
|
|
||||||
0x72, 0x49, 0x49, 0x49, 0x46,
|
|
||||||
0x21, 0x41, 0x49, 0x4D, 0x33,
|
|
||||||
0x18, 0x14, 0x12, 0x7F, 0x10,
|
|
||||||
0x27, 0x45, 0x45, 0x45, 0x39,
|
|
||||||
0x3C, 0x4A, 0x49, 0x49, 0x31,
|
|
||||||
0x41, 0x21, 0x11, 0x09, 0x07,
|
|
||||||
0x36, 0x49, 0x49, 0x49, 0x36,
|
|
||||||
0x46, 0x49, 0x49, 0x29, 0x1E,
|
|
||||||
0x00, 0x00, 0x14, 0x00, 0x00,
|
|
||||||
0x00, 0x40, 0x34, 0x00, 0x00,
|
|
||||||
0x00, 0x08, 0x14, 0x22, 0x41,
|
|
||||||
0x14, 0x14, 0x14, 0x14, 0x14,
|
|
||||||
0x00, 0x41, 0x22, 0x14, 0x08,
|
|
||||||
0x02, 0x01, 0x59, 0x09, 0x06,
|
|
||||||
0x3E, 0x41, 0x5D, 0x59, 0x4E,
|
|
||||||
0x7C, 0x12, 0x11, 0x12, 0x7C,
|
|
||||||
0x7F, 0x49, 0x49, 0x49, 0x36,
|
|
||||||
0x3E, 0x41, 0x41, 0x41, 0x22,
|
|
||||||
0x7F, 0x41, 0x41, 0x41, 0x3E,
|
|
||||||
0x7F, 0x49, 0x49, 0x49, 0x41,
|
|
||||||
0x7F, 0x09, 0x09, 0x09, 0x01,
|
|
||||||
0x3E, 0x41, 0x41, 0x51, 0x73,
|
|
||||||
0x7F, 0x08, 0x08, 0x08, 0x7F,
|
|
||||||
0x00, 0x41, 0x7F, 0x41, 0x00,
|
|
||||||
0x20, 0x40, 0x41, 0x3F, 0x01,
|
|
||||||
0x7F, 0x08, 0x14, 0x22, 0x41,
|
|
||||||
0x7F, 0x40, 0x40, 0x40, 0x40,
|
|
||||||
0x7F, 0x02, 0x1C, 0x02, 0x7F,
|
|
||||||
0x7F, 0x04, 0x08, 0x10, 0x7F,
|
|
||||||
0x3E, 0x41, 0x41, 0x41, 0x3E,
|
|
||||||
0x7F, 0x09, 0x09, 0x09, 0x06,
|
|
||||||
0x3E, 0x41, 0x51, 0x21, 0x5E,
|
|
||||||
0x7F, 0x09, 0x19, 0x29, 0x46,
|
|
||||||
0x26, 0x49, 0x49, 0x49, 0x32,
|
|
||||||
0x03, 0x01, 0x7F, 0x01, 0x03,
|
|
||||||
0x3F, 0x40, 0x40, 0x40, 0x3F,
|
|
||||||
0x1F, 0x20, 0x40, 0x20, 0x1F,
|
|
||||||
0x3F, 0x40, 0x38, 0x40, 0x3F,
|
|
||||||
0x63, 0x14, 0x08, 0x14, 0x63,
|
|
||||||
0x03, 0x04, 0x78, 0x04, 0x03,
|
|
||||||
0x61, 0x59, 0x49, 0x4D, 0x43,
|
|
||||||
0x00, 0x7F, 0x41, 0x41, 0x41,
|
|
||||||
0x02, 0x04, 0x08, 0x10, 0x20,
|
|
||||||
0x00, 0x41, 0x41, 0x41, 0x7F,
|
|
||||||
0x04, 0x02, 0x01, 0x02, 0x04,
|
|
||||||
0x40, 0x40, 0x40, 0x40, 0x40,
|
|
||||||
0x00, 0x03, 0x07, 0x08, 0x00,
|
|
||||||
0x20, 0x54, 0x54, 0x78, 0x40,
|
|
||||||
0x7F, 0x28, 0x44, 0x44, 0x38,
|
|
||||||
0x38, 0x44, 0x44, 0x44, 0x28,
|
|
||||||
0x38, 0x44, 0x44, 0x28, 0x7F,
|
|
||||||
0x38, 0x54, 0x54, 0x54, 0x18,
|
|
||||||
0x00, 0x08, 0x7E, 0x09, 0x02,
|
|
||||||
0x18, 0xA4, 0xA4, 0x9C, 0x78,
|
|
||||||
0x7F, 0x08, 0x04, 0x04, 0x78,
|
|
||||||
0x00, 0x44, 0x7D, 0x40, 0x00,
|
|
||||||
0x20, 0x40, 0x40, 0x3D, 0x00,
|
|
||||||
0x7F, 0x10, 0x28, 0x44, 0x00,
|
|
||||||
0x00, 0x41, 0x7F, 0x40, 0x00,
|
|
||||||
0x7C, 0x04, 0x78, 0x04, 0x78,
|
|
||||||
0x7C, 0x08, 0x04, 0x04, 0x78,
|
|
||||||
0x38, 0x44, 0x44, 0x44, 0x38,
|
|
||||||
0xFC, 0x18, 0x24, 0x24, 0x18,
|
|
||||||
0x18, 0x24, 0x24, 0x18, 0xFC,
|
|
||||||
0x7C, 0x08, 0x04, 0x04, 0x08,
|
|
||||||
0x48, 0x54, 0x54, 0x54, 0x24,
|
|
||||||
0x04, 0x04, 0x3F, 0x44, 0x24,
|
|
||||||
0x3C, 0x40, 0x40, 0x20, 0x7C,
|
|
||||||
0x1C, 0x20, 0x40, 0x20, 0x1C,
|
|
||||||
0x3C, 0x40, 0x30, 0x40, 0x3C,
|
|
||||||
0x44, 0x28, 0x10, 0x28, 0x44,
|
|
||||||
0x4C, 0x90, 0x90, 0x90, 0x7C,
|
|
||||||
0x44, 0x64, 0x54, 0x4C, 0x44,
|
|
||||||
0x00, 0x08, 0x36, 0x41, 0x00,
|
|
||||||
0x00, 0x00, 0x77, 0x00, 0x00,
|
|
||||||
0x00, 0x41, 0x36, 0x08, 0x00,
|
|
||||||
0x02, 0x01, 0x02, 0x04, 0x02,
|
|
||||||
0x3C, 0x26, 0x23, 0x26, 0x3C,
|
|
||||||
0x1E, 0xA1, 0xA1, 0x61, 0x12,
|
|
||||||
0x3A, 0x40, 0x40, 0x20, 0x7A,
|
|
||||||
0x38, 0x54, 0x54, 0x55, 0x59,
|
|
||||||
0x21, 0x55, 0x55, 0x79, 0x41,
|
|
||||||
0x22, 0x54, 0x54, 0x78, 0x42, // a-umlaut
|
|
||||||
0x21, 0x55, 0x54, 0x78, 0x40,
|
|
||||||
0x20, 0x54, 0x55, 0x79, 0x40,
|
|
||||||
0x0C, 0x1E, 0x52, 0x72, 0x12,
|
|
||||||
0x39, 0x55, 0x55, 0x55, 0x59,
|
|
||||||
0x39, 0x54, 0x54, 0x54, 0x59,
|
|
||||||
0x39, 0x55, 0x54, 0x54, 0x58,
|
|
||||||
0x00, 0x00, 0x45, 0x7C, 0x41,
|
|
||||||
0x00, 0x02, 0x45, 0x7D, 0x42,
|
|
||||||
0x00, 0x01, 0x45, 0x7C, 0x40,
|
|
||||||
0x7D, 0x12, 0x11, 0x12, 0x7D, // A-umlaut
|
|
||||||
0xF0, 0x28, 0x25, 0x28, 0xF0,
|
|
||||||
0x7C, 0x54, 0x55, 0x45, 0x00,
|
|
||||||
0x20, 0x54, 0x54, 0x7C, 0x54,
|
|
||||||
0x7C, 0x0A, 0x09, 0x7F, 0x49,
|
|
||||||
0x32, 0x49, 0x49, 0x49, 0x32,
|
|
||||||
0x3A, 0x44, 0x44, 0x44, 0x3A, // o-umlaut
|
|
||||||
0x32, 0x4A, 0x48, 0x48, 0x30,
|
|
||||||
0x3A, 0x41, 0x41, 0x21, 0x7A,
|
|
||||||
0x3A, 0x42, 0x40, 0x20, 0x78,
|
|
||||||
0x00, 0x9D, 0xA0, 0xA0, 0x7D,
|
|
||||||
0x3D, 0x42, 0x42, 0x42, 0x3D, // O-umlaut
|
|
||||||
0x3D, 0x40, 0x40, 0x40, 0x3D,
|
|
||||||
0x3C, 0x24, 0xFF, 0x24, 0x24,
|
|
||||||
0x48, 0x7E, 0x49, 0x43, 0x66,
|
|
||||||
0x2B, 0x2F, 0xFC, 0x2F, 0x2B,
|
|
||||||
0xFF, 0x09, 0x29, 0xF6, 0x20,
|
|
||||||
0xC0, 0x88, 0x7E, 0x09, 0x03,
|
|
||||||
0x20, 0x54, 0x54, 0x79, 0x41,
|
|
||||||
0x00, 0x00, 0x44, 0x7D, 0x41,
|
|
||||||
0x30, 0x48, 0x48, 0x4A, 0x32,
|
|
||||||
0x38, 0x40, 0x40, 0x22, 0x7A,
|
|
||||||
0x00, 0x7A, 0x0A, 0x0A, 0x72,
|
|
||||||
0x7D, 0x0D, 0x19, 0x31, 0x7D,
|
|
||||||
0x26, 0x29, 0x29, 0x2F, 0x28,
|
|
||||||
0x26, 0x29, 0x29, 0x29, 0x26,
|
|
||||||
0x30, 0x48, 0x4D, 0x40, 0x20,
|
|
||||||
0x38, 0x08, 0x08, 0x08, 0x08,
|
|
||||||
0x08, 0x08, 0x08, 0x08, 0x38,
|
|
||||||
0x2F, 0x10, 0xC8, 0xAC, 0xBA,
|
|
||||||
0x2F, 0x10, 0x28, 0x34, 0xFA,
|
|
||||||
0x00, 0x00, 0x7B, 0x00, 0x00,
|
|
||||||
0x08, 0x14, 0x2A, 0x14, 0x22,
|
|
||||||
0x22, 0x14, 0x2A, 0x14, 0x08,
|
|
||||||
0x55, 0x00, 0x55, 0x00, 0x55, // #176 (25% block) missing in old code
|
|
||||||
0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block
|
0xAA, 0x55, 0xAA, 0x55, 0xAA, // 50% block
|
||||||
0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block
|
0xFF, 0x55, 0xFF, 0x55, 0xFF, // 75% block
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x00,
|
0x00, 0x00, 0x00, 0xFF, 0x00, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x14, 0x14, 0x14, 0xFF, 0x00, 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x14, 0x14, 0x14, 0xFC, 0x00, 0x14, 0x14, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x14, 0x14, 0xF4, 0x04, 0xFC, 0x14, 0x14, 0x17, 0x10, 0x1F, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x14, 0x14, 0x14, 0x1F, 0x00, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x14, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x1F, 0x10, 0x17, 0x00, 0x00, 0xFC, 0x04, 0xF4, 0x14, 0x14, 0x17, 0x10, 0x17, 0x14, 0x14, 0xF4, 0x04, 0xF4, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x17, 0x14, 0x10, 0x10, 0x1F, 0x10, 0x1F,
|
||||||
0x10, 0x10, 0x10, 0xFF, 0x00,
|
0x14, 0x14, 0x14, 0xF4, 0x14, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x38, 0x44, 0x44, 0x38, 0x44, 0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta
|
||||||
0x14, 0x14, 0x14, 0xFF, 0x00,
|
0x7E, 0x02, 0x02, 0x06, 0x06, 0x02, 0x7E, 0x02, 0x7E, 0x02, 0x63, 0x55, 0x49, 0x41, 0x63, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x40, 0x7E, 0x20, 0x1E, 0x20, 0x06, 0x02, 0x7E, 0x02, 0x02, 0x99, 0xA5, 0xE7, 0xA5, 0x99, 0x1C, 0x2A, 0x49, 0x2A, 0x1C, 0x4C, 0x72, 0x01, 0x72, 0x4C, 0x30, 0x4A, 0x4D, 0x4D, 0x30, 0x30, 0x48, 0x78, 0x48, 0x30, 0xBC, 0x62, 0x5A, 0x46, 0x3D, 0x3E, 0x49, 0x49, 0x49, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x7E, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x44, 0x44, 0x5F, 0x44, 0x44, 0x40, 0x51, 0x4A, 0x44, 0x40, 0x40, 0x44, 0x4A, 0x51, 0x40, 0x00, 0x00, 0xFF, 0x01, 0x03, 0xE0, 0x80, 0xFF, 0x00, 0x00, 0x08, 0x08, 0x6B, 0x6B, 0x08, 0x36, 0x12, 0x36, 0x24, 0x36, 0x06, 0x0F, 0x09, 0x0F, 0x06, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x30, 0x40, 0xFF, 0x01, 0x01, 0x00, 0x1F, 0x01, 0x01, 0x1E, 0x00, 0x19, 0x1D, 0x17, 0x12, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP
|
||||||
0x10, 0x10, 0xFF, 0x00, 0xFF,
|
|
||||||
0x10, 0x10, 0xF0, 0x10, 0xF0,
|
|
||||||
0x14, 0x14, 0x14, 0xFC, 0x00,
|
|
||||||
0x14, 0x14, 0xF7, 0x00, 0xFF,
|
|
||||||
0x00, 0x00, 0xFF, 0x00, 0xFF,
|
|
||||||
0x14, 0x14, 0xF4, 0x04, 0xFC,
|
|
||||||
0x14, 0x14, 0x17, 0x10, 0x1F,
|
|
||||||
0x10, 0x10, 0x1F, 0x10, 0x1F,
|
|
||||||
0x14, 0x14, 0x14, 0x1F, 0x00,
|
|
||||||
0x10, 0x10, 0x10, 0xF0, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x1F, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0x1F, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0xF0, 0x10,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0x10, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0xFF, 0x10,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x14,
|
|
||||||
0x00, 0x00, 0xFF, 0x00, 0xFF,
|
|
||||||
0x00, 0x00, 0x1F, 0x10, 0x17,
|
|
||||||
0x00, 0x00, 0xFC, 0x04, 0xF4,
|
|
||||||
0x14, 0x14, 0x17, 0x10, 0x17,
|
|
||||||
0x14, 0x14, 0xF4, 0x04, 0xF4,
|
|
||||||
0x00, 0x00, 0xFF, 0x00, 0xF7,
|
|
||||||
0x14, 0x14, 0x14, 0x14, 0x14,
|
|
||||||
0x14, 0x14, 0xF7, 0x00, 0xF7,
|
|
||||||
0x14, 0x14, 0x14, 0x17, 0x14,
|
|
||||||
0x10, 0x10, 0x1F, 0x10, 0x1F,
|
|
||||||
0x14, 0x14, 0x14, 0xF4, 0x14,
|
|
||||||
0x10, 0x10, 0xF0, 0x10, 0xF0,
|
|
||||||
0x00, 0x00, 0x1F, 0x10, 0x1F,
|
|
||||||
0x00, 0x00, 0x00, 0x1F, 0x14,
|
|
||||||
0x00, 0x00, 0x00, 0xFC, 0x14,
|
|
||||||
0x00, 0x00, 0xF0, 0x10, 0xF0,
|
|
||||||
0x10, 0x10, 0xFF, 0x10, 0xFF,
|
|
||||||
0x14, 0x14, 0x14, 0xFF, 0x14,
|
|
||||||
0x10, 0x10, 0x10, 0x1F, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0xF0, 0x10,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
|
||||||
0xFF, 0xFF, 0xFF, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0xFF,
|
|
||||||
0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
|
||||||
0x38, 0x44, 0x44, 0x38, 0x44,
|
|
||||||
0xFC, 0x4A, 0x4A, 0x4A, 0x34, // sharp-s or beta
|
|
||||||
0x7E, 0x02, 0x02, 0x06, 0x06,
|
|
||||||
0x02, 0x7E, 0x02, 0x7E, 0x02,
|
|
||||||
0x63, 0x55, 0x49, 0x41, 0x63,
|
|
||||||
0x38, 0x44, 0x44, 0x3C, 0x04,
|
|
||||||
0x40, 0x7E, 0x20, 0x1E, 0x20,
|
|
||||||
0x06, 0x02, 0x7E, 0x02, 0x02,
|
|
||||||
0x99, 0xA5, 0xE7, 0xA5, 0x99,
|
|
||||||
0x1C, 0x2A, 0x49, 0x2A, 0x1C,
|
|
||||||
0x4C, 0x72, 0x01, 0x72, 0x4C,
|
|
||||||
0x30, 0x4A, 0x4D, 0x4D, 0x30,
|
|
||||||
0x30, 0x48, 0x78, 0x48, 0x30,
|
|
||||||
0xBC, 0x62, 0x5A, 0x46, 0x3D,
|
|
||||||
0x3E, 0x49, 0x49, 0x49, 0x00,
|
|
||||||
0x7E, 0x01, 0x01, 0x01, 0x7E,
|
|
||||||
0x2A, 0x2A, 0x2A, 0x2A, 0x2A,
|
|
||||||
0x44, 0x44, 0x5F, 0x44, 0x44,
|
|
||||||
0x40, 0x51, 0x4A, 0x44, 0x40,
|
|
||||||
0x40, 0x44, 0x4A, 0x51, 0x40,
|
|
||||||
0x00, 0x00, 0xFF, 0x01, 0x03,
|
|
||||||
0xE0, 0x80, 0xFF, 0x00, 0x00,
|
|
||||||
0x08, 0x08, 0x6B, 0x6B, 0x08,
|
|
||||||
0x36, 0x12, 0x36, 0x24, 0x36,
|
|
||||||
0x06, 0x0F, 0x09, 0x0F, 0x06,
|
|
||||||
0x00, 0x00, 0x18, 0x18, 0x00,
|
|
||||||
0x00, 0x00, 0x10, 0x10, 0x00,
|
|
||||||
0x30, 0x40, 0xFF, 0x01, 0x01,
|
|
||||||
0x00, 0x1F, 0x01, 0x01, 0x1E,
|
|
||||||
0x00, 0x19, 0x1D, 0x17, 0x12,
|
|
||||||
0x00, 0x3C, 0x3C, 0x3C, 0x3C,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00 // #255 NBSP
|
|
||||||
};
|
};
|
||||||
#endif // FONT5X7_H
|
#endif // FONT5X7_H
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
# define PIN(x) (*(&x - 2)) /* address of input register of port x */
|
# define PIN(x) (*(&x - 2)) /* address of input register of port x */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if LCD_IO_MODE
|
#if LCD_IO_MODE
|
||||||
# define lcd_e_delay() _delay_us(LCD_DELAY_ENABLE_PULSE)
|
# define lcd_e_delay() _delay_us(LCD_DELAY_ENABLE_PULSE)
|
||||||
# define lcd_e_high() LCD_E_PORT |= _BV(LCD_E_PIN);
|
# define lcd_e_high() LCD_E_PORT |= _BV(LCD_E_PIN);
|
||||||
@ -87,25 +86,21 @@ static void toggle_e(void);
|
|||||||
** local functions
|
** local functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
delay for a minimum of <us> microseconds
|
delay for a minimum of <us> microseconds
|
||||||
the number of loops is calculated at compile-time from MCU clock frequency
|
the number of loops is calculated at compile-time from MCU clock frequency
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
#define delay(us) _delay_us(us)
|
#define delay(us) _delay_us(us)
|
||||||
|
|
||||||
|
|
||||||
#if LCD_IO_MODE
|
#if LCD_IO_MODE
|
||||||
/* toggle Enable Pin to initiate write */
|
/* toggle Enable Pin to initiate write */
|
||||||
static void toggle_e(void)
|
static void toggle_e(void) {
|
||||||
{
|
|
||||||
lcd_e_high();
|
lcd_e_high();
|
||||||
lcd_e_delay();
|
lcd_e_delay();
|
||||||
lcd_e_low();
|
lcd_e_low();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Low-level function to write byte to LCD controller
|
Low-level function to write byte to LCD controller
|
||||||
Input: data byte to write to LCD
|
Input: data byte to write to LCD
|
||||||
@ -114,11 +109,9 @@ Input: data byte to write to LCD
|
|||||||
Returns: none
|
Returns: none
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
#if LCD_IO_MODE
|
#if LCD_IO_MODE
|
||||||
static void lcd_write(uint8_t data,uint8_t rs)
|
static void lcd_write(uint8_t data, uint8_t rs) {
|
||||||
{
|
|
||||||
unsigned char dataBits;
|
unsigned char dataBits;
|
||||||
|
|
||||||
|
|
||||||
if (rs) { /* write data (RS=1, RW=0) */
|
if (rs) { /* write data (RS=1, RW=0) */
|
||||||
lcd_rs_high();
|
lcd_rs_high();
|
||||||
} else { /* write instruction (RS=0, RW=0) */
|
} else { /* write instruction (RS=0, RW=0) */
|
||||||
@ -126,9 +119,7 @@ static void lcd_write(uint8_t data,uint8_t rs)
|
|||||||
}
|
}
|
||||||
lcd_rw_low(); /* RW=0 write mode */
|
lcd_rw_low(); /* RW=0 write mode */
|
||||||
|
|
||||||
if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
if ((&LCD_DATA0_PORT == &LCD_DATA1_PORT) && (&LCD_DATA1_PORT == &LCD_DATA2_PORT) && (&LCD_DATA2_PORT == &LCD_DATA3_PORT) && (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3)) {
|
||||||
&& (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) )
|
|
||||||
{
|
|
||||||
/* configure data pins as output */
|
/* configure data pins as output */
|
||||||
DDR(LCD_DATA0_PORT) |= 0x0F;
|
DDR(LCD_DATA0_PORT) |= 0x0F;
|
||||||
|
|
||||||
@ -143,9 +134,7 @@ static void lcd_write(uint8_t data,uint8_t rs)
|
|||||||
|
|
||||||
/* all data pins high (inactive) */
|
/* all data pins high (inactive) */
|
||||||
LCD_DATA0_PORT = dataBits | 0x0F;
|
LCD_DATA0_PORT = dataBits | 0x0F;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
/* configure data pins as output */
|
/* configure data pins as output */
|
||||||
DDR(LCD_DATA0_PORT) |= _BV(LCD_DATA0_PIN);
|
DDR(LCD_DATA0_PORT) |= _BV(LCD_DATA0_PIN);
|
||||||
DDR(LCD_DATA1_PORT) |= _BV(LCD_DATA1_PIN);
|
DDR(LCD_DATA1_PORT) |= _BV(LCD_DATA1_PIN);
|
||||||
@ -182,12 +171,15 @@ static void lcd_write(uint8_t data,uint8_t rs)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define lcd_write(d,rs) if (rs) *(volatile uint8_t*)(LCD_IO_DATA) = d; else *(volatile uint8_t*)(LCD_IO_FUNCTION) = d;
|
# define lcd_write(d, rs) \
|
||||||
|
if (rs) \
|
||||||
|
*(volatile uint8_t *)(LCD_IO_DATA) = d; \
|
||||||
|
else \
|
||||||
|
*(volatile uint8_t *)(LCD_IO_FUNCTION) = d;
|
||||||
/* rs==0 -> write instruction to LCD_IO_FUNCTION */
|
/* rs==0 -> write instruction to LCD_IO_FUNCTION */
|
||||||
/* rs==1 -> write data to LCD_IO_DATA */
|
/* rs==1 -> write data to LCD_IO_DATA */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Low-level function to read byte from LCD controller
|
Low-level function to read byte from LCD controller
|
||||||
Input: rs 1: read data
|
Input: rs 1: read data
|
||||||
@ -195,20 +187,16 @@ Input: rs 1: read data
|
|||||||
Returns: byte read from LCD controller
|
Returns: byte read from LCD controller
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
#if LCD_IO_MODE
|
#if LCD_IO_MODE
|
||||||
static uint8_t lcd_read(uint8_t rs)
|
static uint8_t lcd_read(uint8_t rs) {
|
||||||
{
|
|
||||||
uint8_t data;
|
uint8_t data;
|
||||||
|
|
||||||
|
|
||||||
if (rs)
|
if (rs)
|
||||||
lcd_rs_high(); /* RS=1: read data */
|
lcd_rs_high(); /* RS=1: read data */
|
||||||
else
|
else
|
||||||
lcd_rs_low(); /* RS=0: read busy flag */
|
lcd_rs_low(); /* RS=0: read busy flag */
|
||||||
lcd_rw_high(); /* RW=1 read mode */
|
lcd_rw_high(); /* RW=1 read mode */
|
||||||
|
|
||||||
if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
if ((&LCD_DATA0_PORT == &LCD_DATA1_PORT) && (&LCD_DATA1_PORT == &LCD_DATA2_PORT) && (&LCD_DATA2_PORT == &LCD_DATA3_PORT) && (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3)) {
|
||||||
&& ( LCD_DATA0_PIN == 0 )&& (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) )
|
|
||||||
{
|
|
||||||
DDR(LCD_DATA0_PORT) &= 0xF0; /* configure data pins as input */
|
DDR(LCD_DATA0_PORT) &= 0xF0; /* configure data pins as input */
|
||||||
|
|
||||||
lcd_e_high();
|
lcd_e_high();
|
||||||
@ -222,9 +210,7 @@ static uint8_t lcd_read(uint8_t rs)
|
|||||||
lcd_e_delay();
|
lcd_e_delay();
|
||||||
data |= PIN(LCD_DATA0_PORT) & 0x0F; /* read low nibble */
|
data |= PIN(LCD_DATA0_PORT) & 0x0F; /* read low nibble */
|
||||||
lcd_e_low();
|
lcd_e_low();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
/* configure data pins as input */
|
/* configure data pins as input */
|
||||||
DDR(LCD_DATA0_PORT) &= ~_BV(LCD_DATA0_PIN);
|
DDR(LCD_DATA0_PORT) &= ~_BV(LCD_DATA0_PIN);
|
||||||
DDR(LCD_DATA1_PORT) &= ~_BV(LCD_DATA1_PIN);
|
DDR(LCD_DATA1_PORT) &= ~_BV(LCD_DATA1_PIN);
|
||||||
@ -260,7 +246,6 @@ static uint8_t lcd_read(uint8_t rs)
|
|||||||
/* rs==1 -> read data from LCD_IO_DATA */
|
/* rs==1 -> read data from LCD_IO_DATA */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
loops while lcd is busy, returns address counter
|
loops while lcd is busy, returns address counter
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
@ -270,7 +255,8 @@ static uint8_t lcd_waitbusy(void)
|
|||||||
register uint8_t c;
|
register uint8_t c;
|
||||||
|
|
||||||
/* wait until busy flag is cleared */
|
/* wait until busy flag is cleared */
|
||||||
while ( (c=lcd_read(0)) & (1<<LCD_BUSY)) {}
|
while ((c = lcd_read(0)) & (1 << LCD_BUSY)) {
|
||||||
|
}
|
||||||
|
|
||||||
/* the address counter is updated 4us after the busy flag is cleared */
|
/* the address counter is updated 4us after the busy flag is cleared */
|
||||||
delay(LCD_DELAY_BUSY_FLAG);
|
delay(LCD_DELAY_BUSY_FLAG);
|
||||||
@ -280,16 +266,13 @@ static uint8_t lcd_waitbusy(void)
|
|||||||
|
|
||||||
} /* lcd_waitbusy */
|
} /* lcd_waitbusy */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Move cursor to the start of next line or to the first line if the cursor
|
Move cursor to the start of next line or to the first line if the cursor
|
||||||
is already on the last line.
|
is already on the last line.
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
static inline void lcd_newline(uint8_t pos)
|
static inline void lcd_newline(uint8_t pos) {
|
||||||
{
|
|
||||||
register uint8_t addressCounter;
|
register uint8_t addressCounter;
|
||||||
|
|
||||||
|
|
||||||
#if LCD_LINES == 1
|
#if LCD_LINES == 1
|
||||||
addressCounter = 0;
|
addressCounter = 0;
|
||||||
#endif
|
#endif
|
||||||
@ -324,7 +307,6 @@ static inline void lcd_newline(uint8_t pos)
|
|||||||
|
|
||||||
} /* lcd_newline */
|
} /* lcd_newline */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** PUBLIC FUNCTIONS
|
** PUBLIC FUNCTIONS
|
||||||
*/
|
*/
|
||||||
@ -334,34 +316,28 @@ Send LCD controller instruction command
|
|||||||
Input: instruction to send to LCD controller, see HD44780 data sheet
|
Input: instruction to send to LCD controller, see HD44780 data sheet
|
||||||
Returns: none
|
Returns: none
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void lcd_command(uint8_t cmd)
|
void lcd_command(uint8_t cmd) {
|
||||||
{
|
|
||||||
lcd_waitbusy();
|
lcd_waitbusy();
|
||||||
lcd_write(cmd, 0);
|
lcd_write(cmd, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Send data byte to LCD controller
|
Send data byte to LCD controller
|
||||||
Input: data to send to LCD controller, see HD44780 data sheet
|
Input: data to send to LCD controller, see HD44780 data sheet
|
||||||
Returns: none
|
Returns: none
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void lcd_data(uint8_t data)
|
void lcd_data(uint8_t data) {
|
||||||
{
|
|
||||||
lcd_waitbusy();
|
lcd_waitbusy();
|
||||||
lcd_write(data, 1);
|
lcd_write(data, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Set cursor to specified position
|
Set cursor to specified position
|
||||||
Input: x horizontal position (0: left most position)
|
Input: x horizontal position (0: left most position)
|
||||||
y vertical position (0: first line)
|
y vertical position (0: first line)
|
||||||
Returns: none
|
Returns: none
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void lcd_gotoxy(uint8_t x, uint8_t y)
|
void lcd_gotoxy(uint8_t x, uint8_t y) {
|
||||||
{
|
|
||||||
#if LCD_LINES == 1
|
#if LCD_LINES == 1
|
||||||
lcd_command((1 << LCD_DDRAM) + LCD_START_LINE1 + x);
|
lcd_command((1 << LCD_DDRAM) + LCD_START_LINE1 + x);
|
||||||
#endif
|
#endif
|
||||||
@ -384,50 +360,32 @@ void lcd_gotoxy(uint8_t x, uint8_t y)
|
|||||||
|
|
||||||
} /* lcd_gotoxy */
|
} /* lcd_gotoxy */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
int lcd_getxy(void)
|
int lcd_getxy(void) { return lcd_waitbusy(); }
|
||||||
{
|
|
||||||
return lcd_waitbusy();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Clear display and set cursor to home position
|
Clear display and set cursor to home position
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void lcd_clrscr(void)
|
void lcd_clrscr(void) { lcd_command(1 << LCD_CLR); }
|
||||||
{
|
|
||||||
lcd_command(1<<LCD_CLR);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Set cursor to home position
|
Set cursor to home position
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void lcd_home(void)
|
void lcd_home(void) { lcd_command(1 << LCD_HOME); }
|
||||||
{
|
|
||||||
lcd_command(1<<LCD_HOME);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Display character at current cursor position
|
Display character at current cursor position
|
||||||
Input: character to be displayed
|
Input: character to be displayed
|
||||||
Returns: none
|
Returns: none
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void lcd_putc(char c)
|
void lcd_putc(char c) {
|
||||||
{
|
|
||||||
uint8_t pos;
|
uint8_t pos;
|
||||||
|
|
||||||
|
|
||||||
pos = lcd_waitbusy(); // read busy-flag and address counter
|
pos = lcd_waitbusy(); // read busy-flag and address counter
|
||||||
if (c=='\n')
|
if (c == '\n') {
|
||||||
{
|
|
||||||
lcd_newline(pos);
|
lcd_newline(pos);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
#if LCD_WRAP_LINES == 1
|
#if LCD_WRAP_LINES == 1
|
||||||
# if LCD_LINES == 1
|
# if LCD_LINES == 1
|
||||||
if (pos == LCD_START_LINE1 + LCD_DISP_LENGTH) {
|
if (pos == LCD_START_LINE1 + LCD_DISP_LENGTH) {
|
||||||
@ -457,7 +415,6 @@ void lcd_putc(char c)
|
|||||||
|
|
||||||
} /* lcd_putc */
|
} /* lcd_putc */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Display string without auto linefeed
|
Display string without auto linefeed
|
||||||
Input: string to be displayed
|
Input: string to be displayed
|
||||||
@ -474,7 +431,6 @@ void lcd_puts(const char *s)
|
|||||||
|
|
||||||
} /* lcd_puts */
|
} /* lcd_puts */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Display string from program memory without auto linefeed
|
Display string from program memory without auto linefeed
|
||||||
Input: string from program memory be be displayed
|
Input: string from program memory be be displayed
|
||||||
@ -491,7 +447,6 @@ void lcd_puts_p(const char *progmem_s)
|
|||||||
|
|
||||||
} /* lcd_puts_p */
|
} /* lcd_puts_p */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
Initialize display and select type of cursor
|
Initialize display and select type of cursor
|
||||||
Input: dispAttr LCD_DISP_OFF display off
|
Input: dispAttr LCD_DISP_OFF display off
|
||||||
@ -500,32 +455,22 @@ Input: dispAttr LCD_DISP_OFF display off
|
|||||||
LCD_DISP_CURSOR_BLINK display on, cursor on flashing
|
LCD_DISP_CURSOR_BLINK display on, cursor on flashing
|
||||||
Returns: none
|
Returns: none
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
void lcd_init(uint8_t dispAttr)
|
void lcd_init(uint8_t dispAttr) {
|
||||||
{
|
|
||||||
#if LCD_IO_MODE
|
#if LCD_IO_MODE
|
||||||
/*
|
/*
|
||||||
* Initialize LCD to 4 bit I/O mode
|
* Initialize LCD to 4 bit I/O mode
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
if ((&LCD_DATA0_PORT == &LCD_DATA1_PORT) && (&LCD_DATA1_PORT == &LCD_DATA2_PORT) && (&LCD_DATA2_PORT == &LCD_DATA3_PORT) && (&LCD_RS_PORT == &LCD_DATA0_PORT) && (&LCD_RW_PORT == &LCD_DATA0_PORT) && (&LCD_E_PORT == &LCD_DATA0_PORT) && (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) && (LCD_RS_PIN == 4) && (LCD_RW_PIN == 5) && (LCD_E_PIN == 6)) {
|
||||||
&& ( &LCD_RS_PORT == &LCD_DATA0_PORT) && ( &LCD_RW_PORT == &LCD_DATA0_PORT) && (&LCD_E_PORT == &LCD_DATA0_PORT)
|
|
||||||
&& (LCD_DATA0_PIN == 0 ) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3)
|
|
||||||
&& (LCD_RS_PIN == 4 ) && (LCD_RW_PIN == 5) && (LCD_E_PIN == 6 ) )
|
|
||||||
{
|
|
||||||
/* configure all port bits as output (all LCD lines on same port) */
|
/* configure all port bits as output (all LCD lines on same port) */
|
||||||
DDR(LCD_DATA0_PORT) |= 0x7F;
|
DDR(LCD_DATA0_PORT) |= 0x7F;
|
||||||
}
|
} else if ((&LCD_DATA0_PORT == &LCD_DATA1_PORT) && (&LCD_DATA1_PORT == &LCD_DATA2_PORT) && (&LCD_DATA2_PORT == &LCD_DATA3_PORT) && (LCD_DATA0_PIN == 0) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3)) {
|
||||||
else if ( ( &LCD_DATA0_PORT == &LCD_DATA1_PORT) && ( &LCD_DATA1_PORT == &LCD_DATA2_PORT ) && ( &LCD_DATA2_PORT == &LCD_DATA3_PORT )
|
|
||||||
&& (LCD_DATA0_PIN == 0 ) && (LCD_DATA1_PIN == 1) && (LCD_DATA2_PIN == 2) && (LCD_DATA3_PIN == 3) )
|
|
||||||
{
|
|
||||||
/* configure all port bits as output (all LCD data lines on same port, but control lines on different ports) */
|
/* configure all port bits as output (all LCD data lines on same port, but control lines on different ports) */
|
||||||
DDR(LCD_DATA0_PORT) |= 0x0F;
|
DDR(LCD_DATA0_PORT) |= 0x0F;
|
||||||
DDR(LCD_RS_PORT) |= _BV(LCD_RS_PIN);
|
DDR(LCD_RS_PORT) |= _BV(LCD_RS_PIN);
|
||||||
DDR(LCD_RW_PORT) |= _BV(LCD_RW_PIN);
|
DDR(LCD_RW_PORT) |= _BV(LCD_RW_PIN);
|
||||||
DDR(LCD_E_PORT) |= _BV(LCD_E_PIN);
|
DDR(LCD_E_PORT) |= _BV(LCD_E_PIN);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
/* configure all port bits as output (LCD data and control lines on different ports */
|
/* configure all port bits as output (LCD data and control lines on different ports */
|
||||||
DDR(LCD_RS_PORT) |= _BV(LCD_RS_PIN);
|
DDR(LCD_RS_PORT) |= _BV(LCD_RS_PIN);
|
||||||
DDR(LCD_RW_PORT) |= _BV(LCD_RW_PIN);
|
DDR(LCD_RW_PORT) |= _BV(LCD_RW_PIN);
|
||||||
@ -589,4 +534,3 @@ void lcd_init(uint8_t dispAttr)
|
|||||||
lcd_command(dispAttr); /* display/cursor control */
|
lcd_command(dispAttr); /* display/cursor control */
|
||||||
|
|
||||||
} /* lcd_init */
|
} /* lcd_init */
|
||||||
|
|
||||||
|
@ -50,7 +50,6 @@
|
|||||||
# error "This library requires AVR-GCC 4.5 or later, update to newer AVR-GCC compiler !"
|
# error "This library requires AVR-GCC 4.5 or later, update to newer AVR-GCC compiler !"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**@{*/
|
/**@{*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -62,7 +61,6 @@
|
|||||||
# include "lcd_definitions.h"
|
# include "lcd_definitions.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Definition for LCD controller type
|
* @name Definition for LCD controller type
|
||||||
* Use 0 for HD44780 controller, change to 1 for displays with KS0073 controller.
|
* Use 0 for HD44780 controller, change to 1 for displays with KS0073 controller.
|
||||||
@ -105,7 +103,6 @@
|
|||||||
# define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */
|
# define LCD_WRAP_LINES 0 /**< 0: no wrap, 1: wrap at end of visibile line */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Definitions for 4-bit IO mode
|
* @name Definitions for 4-bit IO mode
|
||||||
*
|
*
|
||||||
@ -174,9 +171,7 @@
|
|||||||
# define LCD_E_PIN 1 /**< pin for Enable line */
|
# define LCD_E_PIN 1 /**< pin for Enable line */
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
#elif defined(__AVR_AT90S4414__) || defined(__AVR_AT90S8515__) || defined(__AVR_ATmega64__) || \
|
#elif defined(__AVR_AT90S4414__) || defined(__AVR_AT90S8515__) || defined(__AVR_ATmega64__) || defined(__AVR_ATmega8515__) || defined(__AVR_ATmega103__) || defined(__AVR_ATmega128__) || defined(__AVR_ATmega161__) || defined(__AVR_ATmega162__)
|
||||||
defined(__AVR_ATmega8515__)|| defined(__AVR_ATmega103__) || defined(__AVR_ATmega128__) || \
|
|
||||||
defined(__AVR_ATmega161__) || defined(__AVR_ATmega162__)
|
|
||||||
/*
|
/*
|
||||||
* memory mapped mode is only supported when the device has an external data memory interface
|
* memory mapped mode is only supported when the device has an external data memory interface
|
||||||
*/
|
*/
|
||||||
@ -189,7 +184,6 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Definitions of delays
|
* @name Definitions of delays
|
||||||
* Used to calculate delay timers.
|
* Used to calculate delay timers.
|
||||||
@ -219,7 +213,6 @@
|
|||||||
# define LCD_DELAY_ENABLE_PULSE 1 /**< enable signal pulse width in micro seconds */
|
# define LCD_DELAY_ENABLE_PULSE 1 /**< enable signal pulse width in micro seconds */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Definitions for LCD command instructions
|
* @name Definitions for LCD command instructions
|
||||||
* The constants define the various LCD controller instructions which can be passed to the
|
* The constants define the various LCD controller instructions which can be passed to the
|
||||||
@ -272,16 +265,12 @@
|
|||||||
#define LCD_FUNCTION_8BIT_1LINE 0x30 /* 8-bit interface, single line, 5x7 dots */
|
#define LCD_FUNCTION_8BIT_1LINE 0x30 /* 8-bit interface, single line, 5x7 dots */
|
||||||
#define LCD_FUNCTION_8BIT_2LINES 0x38 /* 8-bit interface, dual line, 5x7 dots */
|
#define LCD_FUNCTION_8BIT_2LINES 0x38 /* 8-bit interface, dual line, 5x7 dots */
|
||||||
|
|
||||||
|
|
||||||
#define LCD_MODE_DEFAULT ((1 << LCD_ENTRY_MODE) | (1 << LCD_ENTRY_INC))
|
#define LCD_MODE_DEFAULT ((1 << LCD_ENTRY_MODE) | (1 << LCD_ENTRY_INC))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @name Functions
|
* @name Functions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Initialize display and select type of cursor
|
@brief Initialize display and select type of cursor
|
||||||
@param dispAttr \b LCD_DISP_OFF display off\n
|
@param dispAttr \b LCD_DISP_OFF display off\n
|
||||||
@ -292,21 +281,18 @@
|
|||||||
*/
|
*/
|
||||||
extern void lcd_init(uint8_t dispAttr);
|
extern void lcd_init(uint8_t dispAttr);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Clear display and set cursor to home position
|
@brief Clear display and set cursor to home position
|
||||||
@return none
|
@return none
|
||||||
*/
|
*/
|
||||||
extern void lcd_clrscr(void);
|
extern void lcd_clrscr(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Set cursor to home position
|
@brief Set cursor to home position
|
||||||
@return none
|
@return none
|
||||||
*/
|
*/
|
||||||
extern void lcd_home(void);
|
extern void lcd_home(void);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Set cursor to specified position
|
@brief Set cursor to specified position
|
||||||
|
|
||||||
@ -316,7 +302,6 @@ extern void lcd_home(void);
|
|||||||
*/
|
*/
|
||||||
extern void lcd_gotoxy(uint8_t x, uint8_t y);
|
extern void lcd_gotoxy(uint8_t x, uint8_t y);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Display character at current cursor position
|
@brief Display character at current cursor position
|
||||||
@param c character to be displayed
|
@param c character to be displayed
|
||||||
@ -324,7 +309,6 @@ extern void lcd_gotoxy(uint8_t x, uint8_t y);
|
|||||||
*/
|
*/
|
||||||
extern void lcd_putc(char c);
|
extern void lcd_putc(char c);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Display string without auto linefeed
|
@brief Display string without auto linefeed
|
||||||
@param s string to be displayed
|
@param s string to be displayed
|
||||||
@ -332,7 +316,6 @@ extern void lcd_putc(char c);
|
|||||||
*/
|
*/
|
||||||
extern void lcd_puts(const char *s);
|
extern void lcd_puts(const char *s);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Display string from program memory without auto linefeed
|
@brief Display string from program memory without auto linefeed
|
||||||
@param progmem_s string from program memory be be displayed
|
@param progmem_s string from program memory be be displayed
|
||||||
@ -341,7 +324,6 @@ extern void lcd_puts(const char *s);
|
|||||||
*/
|
*/
|
||||||
extern void lcd_puts_p(const char *progmem_s);
|
extern void lcd_puts_p(const char *progmem_s);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Send LCD controller instruction command
|
@brief Send LCD controller instruction command
|
||||||
@param cmd instruction to send to LCD controller, see HD44780 data sheet
|
@param cmd instruction to send to LCD controller, see HD44780 data sheet
|
||||||
@ -349,7 +331,6 @@ extern void lcd_puts_p(const char *progmem_s);
|
|||||||
*/
|
*/
|
||||||
extern void lcd_command(uint8_t cmd);
|
extern void lcd_command(uint8_t cmd);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief Send data byte to LCD controller
|
@brief Send data byte to LCD controller
|
||||||
|
|
||||||
@ -359,7 +340,6 @@ extern void lcd_command(uint8_t cmd);
|
|||||||
*/
|
*/
|
||||||
extern void lcd_data(uint8_t data);
|
extern void lcd_data(uint8_t data);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief macros for automatically storing string constant in program memory
|
@brief macros for automatically storing string constant in program memory
|
||||||
*/
|
*/
|
||||||
@ -368,4 +348,3 @@ extern void lcd_data(uint8_t data);
|
|||||||
/**@}*/
|
/**@}*/
|
||||||
|
|
||||||
#endif // LCD_H
|
#endif // LCD_H
|
||||||
|
|
||||||
|
4
drivers/avr/i2c_master.c
Executable file → Normal file
4
drivers/avr/i2c_master.c
Executable file → Normal file
@ -27,8 +27,8 @@
|
|||||||
#ifndef F_SCL
|
#ifndef F_SCL
|
||||||
# define F_SCL 400000UL // SCL frequency
|
# define F_SCL 400000UL // SCL frequency
|
||||||
#endif
|
#endif
|
||||||
#define Prescaler 1
|
|
||||||
#define TWBR_val ((((F_CPU / F_SCL) / Prescaler) - 16) / 2)
|
#define TWBR_val (((F_CPU / F_SCL) - 16) / 2)
|
||||||
|
|
||||||
void i2c_init(void) {
|
void i2c_init(void) {
|
||||||
TWSR = 0; /* no prescaler */
|
TWSR = 0; /* no prescaler */
|
||||||
|
0
drivers/avr/i2c_master.h
Executable file → Normal file
0
drivers/avr/i2c_master.h
Executable file → Normal file
0
drivers/avr/i2c_slave.c
Executable file → Normal file
0
drivers/avr/i2c_slave.c
Executable file → Normal file
0
drivers/avr/i2c_slave.h
Executable file → Normal file
0
drivers/avr/i2c_slave.h
Executable file → Normal file
@ -182,33 +182,15 @@ extern const uint8_t PROGMEM analog_pin_to_channel_PGM[];
|
|||||||
// appropriate addresses for various functions (e.g. reading
|
// appropriate addresses for various functions (e.g. reading
|
||||||
// and writing)
|
// and writing)
|
||||||
const uint16_t PROGMEM port_to_mode_PGM[] = {
|
const uint16_t PROGMEM port_to_mode_PGM[] = {
|
||||||
NOT_A_PORT,
|
NOT_A_PORT, NOT_A_PORT, (uint16_t)&DDRB, (uint16_t)&DDRC, (uint16_t)&DDRD, (uint16_t)&DDRE, (uint16_t)&DDRF,
|
||||||
NOT_A_PORT,
|
|
||||||
(uint16_t) &DDRB,
|
|
||||||
(uint16_t) &DDRC,
|
|
||||||
(uint16_t) &DDRD,
|
|
||||||
(uint16_t) &DDRE,
|
|
||||||
(uint16_t) &DDRF,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM port_to_output_PGM[] = {
|
const uint16_t PROGMEM port_to_output_PGM[] = {
|
||||||
NOT_A_PORT,
|
NOT_A_PORT, NOT_A_PORT, (uint16_t)&PORTB, (uint16_t)&PORTC, (uint16_t)&PORTD, (uint16_t)&PORTE, (uint16_t)&PORTF,
|
||||||
NOT_A_PORT,
|
|
||||||
(uint16_t) &PORTB,
|
|
||||||
(uint16_t) &PORTC,
|
|
||||||
(uint16_t) &PORTD,
|
|
||||||
(uint16_t) &PORTE,
|
|
||||||
(uint16_t) &PORTF,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint16_t PROGMEM port_to_input_PGM[] = {
|
const uint16_t PROGMEM port_to_input_PGM[] = {
|
||||||
NOT_A_PORT,
|
NOT_A_PORT, NOT_A_PORT, (uint16_t)&PINB, (uint16_t)&PINC, (uint16_t)&PIND, (uint16_t)&PINE, (uint16_t)&PINF,
|
||||||
NOT_A_PORT,
|
|
||||||
(uint16_t) &PINB,
|
|
||||||
(uint16_t) &PINC,
|
|
||||||
(uint16_t) &PIND,
|
|
||||||
(uint16_t) &PINE,
|
|
||||||
(uint16_t) &PINF,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
|
||||||
@ -286,40 +268,20 @@ const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
|
||||||
NOT_ON_TIMER,
|
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, TIMER0B, /* 3 */
|
||||||
NOT_ON_TIMER,
|
NOT_ON_TIMER, TIMER3A, /* 5 */
|
||||||
NOT_ON_TIMER,
|
|
||||||
TIMER0B, /* 3 */
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
TIMER3A, /* 5 */
|
|
||||||
TIMER4D, /* 6 */
|
TIMER4D, /* 6 */
|
||||||
NOT_ON_TIMER,
|
NOT_ON_TIMER,
|
||||||
|
|
||||||
NOT_ON_TIMER,
|
NOT_ON_TIMER, TIMER1A, /* 9 */
|
||||||
TIMER1A, /* 9 */
|
|
||||||
TIMER1B, /* 10 */
|
TIMER1B, /* 10 */
|
||||||
TIMER0A, /* 11 */
|
TIMER0A, /* 11 */
|
||||||
|
|
||||||
NOT_ON_TIMER,
|
NOT_ON_TIMER, TIMER4A, /* 13 */
|
||||||
TIMER4A, /* 13 */
|
|
||||||
|
|
||||||
NOT_ON_TIMER,
|
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
|
|
||||||
NOT_ON_TIMER,
|
NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER, NOT_ON_TIMER,
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
NOT_ON_TIMER,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
|
const uint8_t PROGMEM analog_pin_to_channel_PGM[] = {
|
||||||
|
@ -76,9 +76,18 @@ static inline bool _send_cmd3(uint8_t cmd, uint8_t opr1, uint8_t opr2) {
|
|||||||
return _send_cmd1(opr2);
|
return _send_cmd1(opr2);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define send_cmd1(c) if (!_send_cmd1(c)) {goto done;}
|
# define send_cmd1(c) \
|
||||||
#define send_cmd2(c,o) if (!_send_cmd2(c,o)) {goto done;}
|
if (!_send_cmd1(c)) { \
|
||||||
#define send_cmd3(c,o1,o2) if (!_send_cmd3(c,o1,o2)) {goto done;}
|
goto done; \
|
||||||
|
}
|
||||||
|
# define send_cmd2(c, o) \
|
||||||
|
if (!_send_cmd2(c, o)) { \
|
||||||
|
goto done; \
|
||||||
|
}
|
||||||
|
# define send_cmd3(c, o1, o2) \
|
||||||
|
if (!_send_cmd3(c, o1, o2)) { \
|
||||||
|
goto done; \
|
||||||
|
}
|
||||||
|
|
||||||
static void clear_display(void) {
|
static void clear_display(void) {
|
||||||
matrix_clear(&display);
|
matrix_clear(&display);
|
||||||
@ -129,7 +138,6 @@ bool iota_gfx_init(void) {
|
|||||||
|
|
||||||
send_cmd2(SetDisplayOffset, 0);
|
send_cmd2(SetDisplayOffset, 0);
|
||||||
|
|
||||||
|
|
||||||
send_cmd1(SetStartLine | 0x0);
|
send_cmd1(SetStartLine | 0x0);
|
||||||
send_cmd2(SetChargePump, 0x14 /* Enable */);
|
send_cmd2(SetChargePump, 0x14 /* Enable */);
|
||||||
send_cmd2(SetMemoryMode, 0 /* horizontal addressing */);
|
send_cmd2(SetMemoryMode, 0 /* horizontal addressing */);
|
||||||
@ -196,8 +204,7 @@ void matrix_write_char_inner(struct CharacterMatrix *matrix, uint8_t c) {
|
|||||||
|
|
||||||
if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) {
|
if (matrix->cursor - &matrix->display[0][0] == sizeof(matrix->display)) {
|
||||||
// We went off the end; scroll the display upwards by one line
|
// We went off the end; scroll the display upwards by one line
|
||||||
memmove(&matrix->display[0], &matrix->display[1],
|
memmove(&matrix->display[0], &matrix->display[1], MatrixCols * (MatrixRows - 1));
|
||||||
MatrixCols * (MatrixRows - 1));
|
|
||||||
matrix->cursor = &matrix->display[MatrixRows - 1][0];
|
matrix->cursor = &matrix->display[MatrixRows - 1][0];
|
||||||
memset(matrix->cursor, ' ', MatrixCols);
|
memset(matrix->cursor, ' ', MatrixCols);
|
||||||
}
|
}
|
||||||
@ -220,9 +227,7 @@ void matrix_write_char(struct CharacterMatrix *matrix, uint8_t c) {
|
|||||||
matrix_write_char_inner(matrix, c);
|
matrix_write_char_inner(matrix, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void iota_gfx_write_char(uint8_t c) {
|
void iota_gfx_write_char(uint8_t c) { matrix_write_char(&display, c); }
|
||||||
matrix_write_char(&display, c);
|
|
||||||
}
|
|
||||||
|
|
||||||
void matrix_write(struct CharacterMatrix *matrix, const char *data) {
|
void matrix_write(struct CharacterMatrix *matrix, const char *data) {
|
||||||
const char *end = data + strlen(data);
|
const char *end = data + strlen(data);
|
||||||
@ -232,9 +237,7 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void iota_gfx_write(const char *data) {
|
void iota_gfx_write(const char *data) { matrix_write(&display, data); }
|
||||||
matrix_write(&display, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
|
void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -247,9 +250,7 @@ void matrix_write_P(struct CharacterMatrix *matrix, const char *data) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void iota_gfx_write_P(const char *data) {
|
void iota_gfx_write_P(const char *data) { matrix_write_P(&display, data); }
|
||||||
matrix_write_P(&display, data);
|
|
||||||
}
|
|
||||||
|
|
||||||
void matrix_clear(struct CharacterMatrix *matrix) {
|
void matrix_clear(struct CharacterMatrix *matrix) {
|
||||||
memset(matrix->display, ' ', sizeof(matrix->display));
|
memset(matrix->display, ' ', sizeof(matrix->display));
|
||||||
@ -257,9 +258,7 @@ void matrix_clear(struct CharacterMatrix *matrix) {
|
|||||||
matrix->dirty = true;
|
matrix->dirty = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void iota_gfx_clear_screen(void) {
|
void iota_gfx_clear_screen(void) { matrix_clear(&display); }
|
||||||
matrix_clear(&display);
|
|
||||||
}
|
|
||||||
|
|
||||||
void matrix_render(struct CharacterMatrix *matrix) {
|
void matrix_render(struct CharacterMatrix *matrix) {
|
||||||
last_flush = timer_read();
|
last_flush = timer_read();
|
||||||
@ -303,13 +302,9 @@ done:
|
|||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void iota_gfx_flush(void) {
|
void iota_gfx_flush(void) { matrix_render(&display); }
|
||||||
matrix_render(&display);
|
|
||||||
}
|
|
||||||
|
|
||||||
__attribute__ ((weak))
|
__attribute__((weak)) void iota_gfx_task_user(void) {}
|
||||||
void iota_gfx_task_user(void) {
|
|
||||||
}
|
|
||||||
|
|
||||||
void iota_gfx_task(void) {
|
void iota_gfx_task(void) {
|
||||||
iota_gfx_task_user();
|
iota_gfx_task_user();
|
||||||
|
@ -88,6 +88,4 @@ void matrix_write(struct CharacterMatrix *matrix, const char *data);
|
|||||||
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
void matrix_write_P(struct CharacterMatrix *matrix, const char *data);
|
||||||
void matrix_render(struct CharacterMatrix *matrix);
|
void matrix_render(struct CharacterMatrix *matrix);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -60,14 +60,10 @@ I2C_PORT &= ~ (1 << I2C_CLK);
|
|||||||
|
|
||||||
# define I2C_DELAY 1
|
# define I2C_DELAY 1
|
||||||
|
|
||||||
void I2C_WriteBit(unsigned char c)
|
void I2C_WriteBit(unsigned char c) {
|
||||||
{
|
if (c > 0) {
|
||||||
if (c > 0)
|
|
||||||
{
|
|
||||||
I2C_DATA_HI();
|
I2C_DATA_HI();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
I2C_DATA_LO();
|
I2C_DATA_LO();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,8 +73,7 @@ void I2C_WriteBit(unsigned char c)
|
|||||||
I2C_CLOCK_LO();
|
I2C_CLOCK_LO();
|
||||||
_delay_us(I2C_DELAY);
|
_delay_us(I2C_DELAY);
|
||||||
|
|
||||||
if (c > 0)
|
if (c > 0) {
|
||||||
{
|
|
||||||
I2C_DATA_LO();
|
I2C_DATA_LO();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,8 +82,7 @@ void I2C_WriteBit(unsigned char c)
|
|||||||
|
|
||||||
// Inits bitbanging port, must be called before using the functions below
|
// Inits bitbanging port, must be called before using the functions below
|
||||||
//
|
//
|
||||||
void I2C_Init(void)
|
void I2C_Init(void) {
|
||||||
{
|
|
||||||
I2C_PORT &= ~((1 << I2C_DAT) | (1 << I2C_CLK));
|
I2C_PORT &= ~((1 << I2C_DAT) | (1 << I2C_CLK));
|
||||||
|
|
||||||
I2C_CLOCK_HI();
|
I2C_CLOCK_HI();
|
||||||
@ -99,8 +93,7 @@ void I2C_Init(void)
|
|||||||
|
|
||||||
// Send a START Condition
|
// Send a START Condition
|
||||||
//
|
//
|
||||||
void I2C_Start(void)
|
void I2C_Start(void) {
|
||||||
{
|
|
||||||
// set both to high at the same time
|
// set both to high at the same time
|
||||||
I2C_DDR &= ~((1 << I2C_DAT) | (1 << I2C_CLK));
|
I2C_DDR &= ~((1 << I2C_DAT) | (1 << I2C_CLK));
|
||||||
_delay_us(I2C_DELAY);
|
_delay_us(I2C_DELAY);
|
||||||
@ -114,8 +107,7 @@ void I2C_Start(void)
|
|||||||
|
|
||||||
// Send a STOP Condition
|
// Send a STOP Condition
|
||||||
//
|
//
|
||||||
void I2C_Stop(void)
|
void I2C_Stop(void) {
|
||||||
{
|
|
||||||
I2C_CLOCK_HI();
|
I2C_CLOCK_HI();
|
||||||
_delay_us(I2C_DELAY);
|
_delay_us(I2C_DELAY);
|
||||||
|
|
||||||
@ -125,16 +117,13 @@ void I2C_Stop(void)
|
|||||||
|
|
||||||
// write a byte to the I2C slave device
|
// write a byte to the I2C slave device
|
||||||
//
|
//
|
||||||
unsigned char I2C_Write(unsigned char c)
|
unsigned char I2C_Write(unsigned char c) {
|
||||||
{
|
for (char i = 0; i < 8; i++) {
|
||||||
for (char i = 0; i < 8; i++)
|
|
||||||
{
|
|
||||||
I2C_WriteBit(c & 128);
|
I2C_WriteBit(c & 128);
|
||||||
|
|
||||||
c <<= 1;
|
c <<= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
I2C_WriteBit(0);
|
I2C_WriteBit(0);
|
||||||
_delay_us(I2C_DELAY);
|
_delay_us(I2C_DELAY);
|
||||||
_delay_us(I2C_DELAY);
|
_delay_us(I2C_DELAY);
|
||||||
@ -144,20 +133,17 @@ unsigned char I2C_Write(unsigned char c)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef RGB_MATRIX_ENABLE
|
#ifdef RGB_MATRIX_ENABLE
|
||||||
// Set an led in the buffer to a color
|
// Set an led in the buffer to a color
|
||||||
void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b)
|
void inline ws2812_setled(int i, uint8_t r, uint8_t g, uint8_t b) {
|
||||||
{
|
|
||||||
led[i].r = r;
|
led[i].r = r;
|
||||||
led[i].g = g;
|
led[i].g = g;
|
||||||
led[i].b = b;
|
led[i].b = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b)
|
void ws2812_setled_all(uint8_t r, uint8_t g, uint8_t b) {
|
||||||
{
|
|
||||||
for (int i = 0; i < sizeof(led) / sizeof(led[0]); i++) {
|
for (int i = 0; i < sizeof(led) / sizeof(led[0]); i++) {
|
||||||
led[i].r = r;
|
led[i].r = r;
|
||||||
led[i].g = g;
|
led[i].g = g;
|
||||||
@ -167,14 +153,12 @@ void ws2812_setled_all (uint8_t r, uint8_t g, uint8_t b)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Setleds for standard RGB
|
// Setleds for standard RGB
|
||||||
void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t leds)
|
void inline ws2812_setleds(LED_TYPE *ledarray, uint16_t leds) {
|
||||||
{
|
|
||||||
// ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin));
|
// ws2812_setleds_pin(ledarray,leds, _BV(ws2812_pin));
|
||||||
ws2812_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF));
|
ws2812_setleds_pin(ledarray, leds, _BV(RGB_DI_PIN & 0xF));
|
||||||
}
|
}
|
||||||
|
|
||||||
void inline ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask)
|
void inline ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmask) {
|
||||||
{
|
|
||||||
// ws2812_DDRREG |= pinmask; // Enable DDR
|
// ws2812_DDRREG |= pinmask; // Enable DDR
|
||||||
// new universal format (DDR)
|
// new universal format (DDR)
|
||||||
_SFR_IO8((RGB_DI_PIN >> 4) + 1) |= pinmask;
|
_SFR_IO8((RGB_DI_PIN >> 4) + 1) |= pinmask;
|
||||||
@ -184,9 +168,7 @@ void inline ws2812_setleds_pin(LED_TYPE *ledarray, uint16_t leds, uint8_t pinmas
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setleds for SK6812RGBW
|
// Setleds for SK6812RGBW
|
||||||
void inline ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t leds)
|
void inline ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t leds) {
|
||||||
{
|
|
||||||
|
|
||||||
#ifdef RGBW_BB_TWI
|
#ifdef RGBW_BB_TWI
|
||||||
uint8_t sreg_prev, twcr_prev;
|
uint8_t sreg_prev, twcr_prev;
|
||||||
sreg_prev = SREG;
|
sreg_prev = SREG;
|
||||||
@ -208,23 +190,18 @@ void inline ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t leds)
|
|||||||
TWCR = twcr_prev;
|
TWCR = twcr_prev;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR
|
// ws2812_DDRREG |= _BV(ws2812_pin); // Enable DDR
|
||||||
// new universal format (DDR)
|
// new universal format (DDR)
|
||||||
_SFR_IO8((RGB_DI_PIN >> 4) + 1) |= _BV(RGB_DI_PIN & 0xF);
|
_SFR_IO8((RGB_DI_PIN >> 4) + 1) |= _BV(RGB_DI_PIN & 0xF);
|
||||||
|
|
||||||
ws2812_sendarray_mask((uint8_t *)ledarray, leds << 2, _BV(RGB_DI_PIN & 0xF));
|
ws2812_sendarray_mask((uint8_t *)ledarray, leds << 2, _BV(RGB_DI_PIN & 0xF));
|
||||||
|
|
||||||
|
|
||||||
#ifndef RGBW_BB_TWI
|
#ifndef RGBW_BB_TWI
|
||||||
_delay_us(80);
|
_delay_us(80);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void ws2812_sendarray(uint8_t *data,uint16_t datlen)
|
void ws2812_sendarray(uint8_t *data, uint16_t datlen) { ws2812_sendarray_mask(data, datlen, _BV(RGB_DI_PIN & 0xF)); }
|
||||||
{
|
|
||||||
ws2812_sendarray_mask(data,datlen,_BV(RGB_DI_PIN & 0xF));
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
This routine writes an array of bytes with RGB values to the Dataout pin
|
This routine writes an array of bytes with RGB values to the Dataout pin
|
||||||
@ -287,8 +264,7 @@ void ws2812_sendarray(uint8_t *data,uint16_t datlen)
|
|||||||
#define w_nop8 w_nop4 w_nop4
|
#define w_nop8 w_nop4 w_nop4
|
||||||
#define w_nop16 w_nop8 w_nop8
|
#define w_nop16 w_nop8 w_nop8
|
||||||
|
|
||||||
void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi)
|
void inline ws2812_sendarray_mask(uint8_t *data, uint16_t datlen, uint8_t maskhi) {
|
||||||
{
|
|
||||||
uint8_t curbyte, ctr, masklo;
|
uint8_t curbyte, ctr, masklo;
|
||||||
uint8_t sreg_prev;
|
uint8_t sreg_prev;
|
||||||
|
|
||||||
@ -302,8 +278,7 @@ void inline ws2812_sendarray_mask(uint8_t *data,uint16_t datlen,uint8_t maskhi)
|
|||||||
while (datlen--) {
|
while (datlen--) {
|
||||||
curbyte = (*data++);
|
curbyte = (*data++);
|
||||||
|
|
||||||
asm volatile(
|
asm volatile(" ldi %0,8 \n\t"
|
||||||
" ldi %0,8 \n\t"
|
|
||||||
"loop%=: \n\t"
|
"loop%=: \n\t"
|
||||||
" out %2,%3 \n\t" // '1' [01] '0' [01] - re
|
" out %2,%3 \n\t" // '1' [01] '0' [01] - re
|
||||||
#if (w1_nops & 1)
|
#if (w1_nops & 1)
|
||||||
@ -359,8 +334,7 @@ w_nop16
|
|||||||
" dec %0 \n\t" // '1' [+2] '0' [+2]
|
" dec %0 \n\t" // '1' [+2] '0' [+2]
|
||||||
" brne loop%=\n\t" // '1' [+3] '0' [+4]
|
" brne loop%=\n\t" // '1' [+3] '0' [+4]
|
||||||
: "=&d"(ctr)
|
: "=&d"(ctr)
|
||||||
: "r" (curbyte), "I" (_SFR_IO_ADDR(_SFR_IO8((RGB_DI_PIN >> 4) + 2))), "r" (maskhi), "r" (masklo)
|
: "r"(curbyte), "I"(_SFR_IO_ADDR(_SFR_IO8((RGB_DI_PIN >> 4) + 2))), "r"(maskhi), "r"(masklo));
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SREG = sreg_prev;
|
SREG = sreg_prev;
|
||||||
|
@ -61,7 +61,6 @@ void ws2812_setleds_rgbw(LED_TYPE *ledarray, uint16_t number_of_leds);
|
|||||||
void ws2812_sendarray(uint8_t *array, uint16_t length);
|
void ws2812_sendarray(uint8_t *array, uint16_t length);
|
||||||
void ws2812_sendarray_mask(uint8_t *array, uint16_t length, uint8_t pinmask);
|
void ws2812_sendarray_mask(uint8_t *array, uint16_t length, uint8_t pinmask);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Internal defines
|
* Internal defines
|
||||||
*/
|
*/
|
||||||
|
@ -24,40 +24,31 @@
|
|||||||
*/
|
*/
|
||||||
const PALConfig pal_default_config = {
|
const PALConfig pal_default_config = {
|
||||||
# if STM32_HAS_GPIOA
|
# if STM32_HAS_GPIOA
|
||||||
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
|
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR, VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
|
||||||
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOB
|
# if STM32_HAS_GPIOB
|
||||||
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
|
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR, VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
|
||||||
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOC
|
# if STM32_HAS_GPIOC
|
||||||
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
|
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR, VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
|
||||||
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOD
|
# if STM32_HAS_GPIOD
|
||||||
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
|
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR, VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
|
||||||
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOE
|
# if STM32_HAS_GPIOE
|
||||||
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
|
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR, VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
|
||||||
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOF
|
# if STM32_HAS_GPIOF
|
||||||
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
|
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR, VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
|
||||||
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOG
|
# if STM32_HAS_GPIOG
|
||||||
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
|
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR, VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
|
||||||
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOH
|
# if STM32_HAS_GPIOH
|
||||||
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
|
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR, VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
|
||||||
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
|
|
||||||
# endif
|
# endif
|
||||||
# if STM32_HAS_GPIOI
|
# if STM32_HAS_GPIOI
|
||||||
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
|
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR, VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
|
||||||
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
|
|
||||||
# endif
|
# endif
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
@ -79,7 +70,6 @@ void __early_init(void) {
|
|||||||
* @brief SDC card detection.
|
* @brief SDC card detection.
|
||||||
*/
|
*/
|
||||||
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
||||||
|
|
||||||
(void)sdcp;
|
(void)sdcp;
|
||||||
/* TODO: Fill the implementation.*/
|
/* TODO: Fill the implementation.*/
|
||||||
return true;
|
return true;
|
||||||
@ -89,7 +79,6 @@ bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
|
|||||||
* @brief SDC card write protection detection.
|
* @brief SDC card write protection detection.
|
||||||
*/
|
*/
|
||||||
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
|
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
|
||||||
|
|
||||||
(void)sdcp;
|
(void)sdcp;
|
||||||
/* TODO: Fill the implementation.*/
|
/* TODO: Fill the implementation.*/
|
||||||
return false;
|
return false;
|
||||||
@ -101,7 +90,6 @@ bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
|
|||||||
* @brief MMC_SPI card detection.
|
* @brief MMC_SPI card detection.
|
||||||
*/
|
*/
|
||||||
bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
|
bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
|
||||||
|
|
||||||
(void)mmcp;
|
(void)mmcp;
|
||||||
/* TODO: Fill the implementation.*/
|
/* TODO: Fill the implementation.*/
|
||||||
return true;
|
return true;
|
||||||
@ -111,7 +99,6 @@ bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
|
|||||||
* @brief MMC_SPI card write protection detection.
|
* @brief MMC_SPI card write protection detection.
|
||||||
*/
|
*/
|
||||||
bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
|
bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
|
||||||
|
|
||||||
(void)mmcp;
|
(void)mmcp;
|
||||||
/* TODO: Fill the implementation.*/
|
/* TODO: Fill the implementation.*/
|
||||||
return false;
|
return false;
|
||||||
@ -122,5 +109,4 @@ bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
|
|||||||
* @brief Board-specific initialization code.
|
* @brief Board-specific initialization code.
|
||||||
* @todo Add your board-specific code, if any.
|
* @todo Add your board-specific code, if any.
|
||||||
*/
|
*/
|
||||||
void boardInit(void) {
|
void boardInit(void) {}
|
||||||
}
|
|
||||||
|
@ -201,7 +201,6 @@
|
|||||||
|
|
||||||
#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U)
|
#define LINE_CAPS_LOCK PAL_LINE(GPIOB, 7U)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* I/O ports initial setup, this configuration is established soon after reset
|
* I/O ports initial setup, this configuration is established soon after reset
|
||||||
* in the initialization code.
|
* in the initialization code.
|
||||||
@ -244,102 +243,13 @@
|
|||||||
* PA14 - SWCLK (alternate 0).
|
* PA14 - SWCLK (alternate 0).
|
||||||
* PA15 - ROW4
|
* PA15 - ROW4
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | \
|
#define VAL_GPIOA_MODER (PIN_MODE_INPUT(GPIOA_PIN0) | PIN_MODE_ALTERNATE(GPIOA_PIN1) | PIN_MODE_INPUT(GPIOA_PIN2) | PIN_MODE_INPUT(GPIOA_PIN3) | PIN_MODE_INPUT(GPIOA_PIN4) | PIN_MODE_INPUT(GPIOA_PIN5) | PIN_MODE_INPUT(GPIOA_PIN6) | PIN_MODE_INPUT(GPIOA_PIN7) | PIN_MODE_INPUT(GPIOA_PIN8) | PIN_MODE_INPUT(GPIOA_PIN9) | PIN_MODE_INPUT(GPIOA_PIN10) | PIN_MODE_ALTERNATE(GPIOA_USB_DM) | PIN_MODE_ALTERNATE(GPIOA_USB_DP) | PIN_MODE_ALTERNATE(GPIOA_SWDIO) | PIN_MODE_ALTERNATE(GPIOA_SWCLK) | PIN_MODE_INPUT(GPIOA_PIN15))
|
||||||
PIN_MODE_ALTERNATE(GPIOA_PIN1) | \
|
#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOA_PIN2) | \
|
#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | PIN_OSPEED_HIGH(GPIOA_PIN1) | PIN_OSPEED_VERYLOW(GPIOA_PIN2) | PIN_OSPEED_VERYLOW(GPIOA_PIN3) | PIN_OSPEED_VERYLOW(GPIOA_PIN4) | PIN_OSPEED_VERYLOW(GPIOA_PIN5) | PIN_OSPEED_VERYLOW(GPIOA_PIN6) | PIN_OSPEED_VERYLOW(GPIOA_PIN7) | PIN_OSPEED_VERYLOW(GPIOA_PIN8) | PIN_OSPEED_VERYLOW(GPIOA_PIN9) | PIN_OSPEED_VERYLOW(GPIOA_PIN10) | PIN_OSPEED_HIGH(GPIOA_USB_DM) | PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | PIN_OSPEED_HIGH(GPIOA_SWDIO) | PIN_OSPEED_HIGH(GPIOA_SWCLK) | PIN_OSPEED_VERYLOW(GPIOA_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOA_PIN3) | \
|
#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | PIN_PUPDR_FLOATING(GPIOA_PIN1) | PIN_PUPDR_PULLUP(GPIOA_PIN2) | PIN_PUPDR_PULLUP(GPIOA_PIN3) | PIN_PUPDR_PULLUP(GPIOA_PIN4) | PIN_PUPDR_PULLUP(GPIOA_PIN5) | PIN_PUPDR_PULLUP(GPIOA_PIN6) | PIN_PUPDR_FLOATING(GPIOA_PIN7) | PIN_PUPDR_PULLUP(GPIOA_PIN8) | PIN_PUPDR_PULLUP(GPIOA_PIN9) | PIN_PUPDR_PULLUP(GPIOA_PIN10) | PIN_PUPDR_FLOATING(GPIOA_USB_DM) | PIN_PUPDR_FLOATING(GPIOA_USB_DP) | PIN_PUPDR_PULLUP(GPIOA_SWDIO) | PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | PIN_PUPDR_PULLUP(GPIOA_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOA_PIN4) | \
|
#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | PIN_ODR_HIGH(GPIOA_PIN1) | PIN_ODR_HIGH(GPIOA_PIN2) | PIN_ODR_HIGH(GPIOA_PIN3) | PIN_ODR_HIGH(GPIOA_PIN4) | PIN_ODR_HIGH(GPIOA_PIN5) | PIN_ODR_HIGH(GPIOA_PIN6) | PIN_ODR_HIGH(GPIOA_PIN7) | PIN_ODR_HIGH(GPIOA_PIN8) | PIN_ODR_HIGH(GPIOA_PIN9) | PIN_ODR_HIGH(GPIOA_PIN10) | PIN_ODR_HIGH(GPIOA_USB_DM) | PIN_ODR_HIGH(GPIOA_USB_DP) | PIN_ODR_HIGH(GPIOA_SWDIO) | PIN_ODR_HIGH(GPIOA_SWCLK) | PIN_ODR_HIGH(GPIOA_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOA_PIN5) | \
|
#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | PIN_AFIO_AF(GPIOA_PIN1, 1) | PIN_AFIO_AF(GPIOA_PIN2, 0) | PIN_AFIO_AF(GPIOA_PIN3, 0) | PIN_AFIO_AF(GPIOA_PIN4, 0) | PIN_AFIO_AF(GPIOA_PIN5, 5) | PIN_AFIO_AF(GPIOA_PIN6, 5) | PIN_AFIO_AF(GPIOA_PIN7, 5))
|
||||||
PIN_MODE_INPUT(GPIOA_PIN6) | \
|
#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | PIN_AFIO_AF(GPIOA_PIN9, 0) | PIN_AFIO_AF(GPIOA_PIN10, 0) | PIN_AFIO_AF(GPIOA_USB_DM, 14) | PIN_AFIO_AF(GPIOA_USB_DP, 14) | PIN_AFIO_AF(GPIOA_SWDIO, 0) | PIN_AFIO_AF(GPIOA_SWCLK, 0) | PIN_AFIO_AF(GPIOA_PIN15, 0))
|
||||||
PIN_MODE_INPUT(GPIOA_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN10) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOA_USB_DM) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOA_USB_DP) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOA_SWDIO) | \
|
|
||||||
PIN_MODE_ALTERNATE(GPIOA_SWCLK) | \
|
|
||||||
PIN_MODE_INPUT(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_OTYPER (PIN_OTYPE_PUSHPULL(GPIOA_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_USB_DM) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_USB_DP) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_SWDIO) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_SWCLK) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOA_PIN0) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOA_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN10) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOA_USB_DM) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_USB_DP) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOA_SWDIO) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOA_SWCLK) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_PUPDR (PIN_PUPDR_FLOATING(GPIOA_PIN0) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOA_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN6) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOA_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN10) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOA_USB_DM) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOA_USB_DP) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_SWDIO) | \
|
|
||||||
PIN_PUPDR_PULLDOWN(GPIOA_SWCLK) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_ODR (PIN_ODR_HIGH(GPIOA_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_USB_DM) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_USB_DP) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_SWDIO) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_SWCLK) | \
|
|
||||||
PIN_ODR_HIGH(GPIOA_PIN15))
|
|
||||||
#define VAL_GPIOA_AFRL (PIN_AFIO_AF(GPIOA_PIN0, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN1, 1) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN2, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN4, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN5, 5) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN6, 5) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN7, 5))
|
|
||||||
#define VAL_GPIOA_AFRH (PIN_AFIO_AF(GPIOA_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_USB_DM, 14) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_USB_DP, 14) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_SWDIO, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_SWCLK, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOA_PIN15, 0))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIOB setup:
|
* GPIOB setup:
|
||||||
@ -361,102 +271,13 @@
|
|||||||
* PB14 - PIN14 (input pullup).
|
* PB14 - PIN14 (input pullup).
|
||||||
* PB15 - PIN15 (input pullup).
|
* PB15 - PIN15 (input pullup).
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | \
|
#define VAL_GPIOB_MODER (PIN_MODE_INPUT(GPIOB_PIN0) | PIN_MODE_INPUT(GPIOB_PIN1) | PIN_MODE_INPUT(GPIOB_PIN2) | PIN_MODE_ALTERNATE(GPIOB_PIN3) | PIN_MODE_INPUT(GPIOB_PIN4) | PIN_MODE_INPUT(GPIOB_PIN5) | PIN_MODE_ALTERNATE(GPIOB_PIN6) | PIN_MODE_OUTPUT(GPIOB_PIN7) | PIN_MODE_INPUT(GPIOB_PIN8) | PIN_MODE_INPUT(GPIOB_PIN9) | PIN_MODE_INPUT(GPIOB_PIN10) | PIN_MODE_INPUT(GPIOB_PIN11) | PIN_MODE_INPUT(GPIOB_PIN12) | PIN_MODE_INPUT(GPIOB_PIN13) | PIN_MODE_INPUT(GPIOB_PIN14) | PIN_MODE_INPUT(GPIOB_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOB_PIN1) | \
|
#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOB_PIN2) | \
|
#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | PIN_OSPEED_VERYLOW(GPIOB_PIN1) | PIN_OSPEED_VERYLOW(GPIOB_PIN2) | PIN_OSPEED_HIGH(GPIOB_PIN3) | PIN_OSPEED_VERYLOW(GPIOB_PIN4) | PIN_OSPEED_VERYLOW(GPIOB_PIN5) | PIN_OSPEED_HIGH(GPIOB_PIN6) | PIN_OSPEED_VERYLOW(GPIOB_PIN7) | PIN_OSPEED_VERYLOW(GPIOB_PIN8) | PIN_OSPEED_VERYLOW(GPIOB_PIN9) | PIN_OSPEED_VERYLOW(GPIOB_PIN10) | PIN_OSPEED_VERYLOW(GPIOB_PIN11) | PIN_OSPEED_VERYLOW(GPIOB_PIN12) | PIN_OSPEED_VERYLOW(GPIOB_PIN13) | PIN_OSPEED_VERYLOW(GPIOB_PIN14) | PIN_OSPEED_VERYLOW(GPIOB_PIN15))
|
||||||
PIN_MODE_ALTERNATE(GPIOB_PIN3) | \
|
#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | PIN_PUPDR_PULLUP(GPIOB_PIN1) | PIN_PUPDR_PULLUP(GPIOB_PIN2) | PIN_PUPDR_FLOATING(GPIOB_PIN3) | PIN_PUPDR_PULLUP(GPIOB_PIN4) | PIN_PUPDR_PULLUP(GPIOB_PIN5) | PIN_PUPDR_FLOATING(GPIOB_PIN6) | PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | PIN_PUPDR_PULLUP(GPIOB_PIN8) | PIN_PUPDR_PULLUP(GPIOB_PIN9) | PIN_PUPDR_PULLUP(GPIOB_PIN10) | PIN_PUPDR_PULLUP(GPIOB_PIN11) | PIN_PUPDR_PULLUP(GPIOB_PIN12) | PIN_PUPDR_PULLUP(GPIOB_PIN13) | PIN_PUPDR_PULLUP(GPIOB_PIN14) | PIN_PUPDR_PULLUP(GPIOB_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOB_PIN4) | \
|
#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | PIN_ODR_HIGH(GPIOB_PIN1) | PIN_ODR_HIGH(GPIOB_PIN2) | PIN_ODR_HIGH(GPIOB_PIN3) | PIN_ODR_HIGH(GPIOB_PIN4) | PIN_ODR_HIGH(GPIOB_PIN5) | PIN_ODR_HIGH(GPIOB_PIN6) | PIN_ODR_LOW(GPIOB_PIN7) | PIN_ODR_HIGH(GPIOB_PIN8) | PIN_ODR_HIGH(GPIOB_PIN9) | PIN_ODR_HIGH(GPIOB_PIN10) | PIN_ODR_HIGH(GPIOB_PIN11) | PIN_ODR_HIGH(GPIOB_PIN12) | PIN_ODR_HIGH(GPIOB_PIN13) | PIN_ODR_HIGH(GPIOB_PIN14) | PIN_ODR_HIGH(GPIOB_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOB_PIN5) | \
|
#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | PIN_AFIO_AF(GPIOB_PIN1, 0) | PIN_AFIO_AF(GPIOB_PIN2, 0) | PIN_AFIO_AF(GPIOB_PIN3, 0) | PIN_AFIO_AF(GPIOB_PIN4, 0) | PIN_AFIO_AF(GPIOB_PIN5, 0) | PIN_AFIO_AF(GPIOB_PIN6, 4) | PIN_AFIO_AF(GPIOB_PIN7, 0))
|
||||||
PIN_MODE_ALTERNATE(GPIOB_PIN6) | \
|
#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | PIN_AFIO_AF(GPIOB_PIN9, 0) | PIN_AFIO_AF(GPIOB_PIN10, 0) | PIN_AFIO_AF(GPIOB_PIN11, 0) | PIN_AFIO_AF(GPIOB_PIN12, 0) | PIN_AFIO_AF(GPIOB_PIN13, 0) | PIN_AFIO_AF(GPIOB_PIN14, 0) | PIN_AFIO_AF(GPIOB_PIN15, 0))
|
||||||
PIN_MODE_OUTPUT(GPIOB_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOB_PIN15))
|
|
||||||
#define VAL_GPIOB_OTYPER (PIN_OTYPE_PUSHPULL(GPIOB_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN5) | \
|
|
||||||
PIN_OTYPE_OPENDRAIN(GPIOB_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOB_PIN15))
|
|
||||||
#define VAL_GPIOB_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOB_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN2) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOB_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN5) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOB_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOB_PIN15))
|
|
||||||
#define VAL_GPIOB_PUPDR (PIN_PUPDR_PULLUP(GPIOB_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN2) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOB_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN5) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOB_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLDOWN(GPIOB_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOB_PIN15))
|
|
||||||
#define VAL_GPIOB_ODR (PIN_ODR_HIGH(GPIOB_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN6) | \
|
|
||||||
PIN_ODR_LOW(GPIOB_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOB_PIN15))
|
|
||||||
#define VAL_GPIOB_AFRL (PIN_AFIO_AF(GPIOB_PIN0, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN1, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN2, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN4, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN5, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN6, 4) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN7, 0))
|
|
||||||
#define VAL_GPIOB_AFRH (PIN_AFIO_AF(GPIOB_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN11, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN12, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN13, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN14, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOB_PIN15, 0))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIOC setup:
|
* GPIOC setup:
|
||||||
@ -478,102 +299,13 @@
|
|||||||
* PC14 - PIN14 (input floating).
|
* PC14 - PIN14 (input floating).
|
||||||
* PC15 - PIN15 (input floating).
|
* PC15 - PIN15 (input floating).
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | \
|
#define VAL_GPIOC_MODER (PIN_MODE_INPUT(GPIOC_PIN0) | PIN_MODE_INPUT(GPIOC_PIN1) | PIN_MODE_INPUT(GPIOC_PIN2) | PIN_MODE_INPUT(GPIOC_PIN3) | PIN_MODE_INPUT(GPIOC_PIN4) | PIN_MODE_INPUT(GPIOC_PIN5) | PIN_MODE_INPUT(GPIOC_PIN6) | PIN_MODE_INPUT(GPIOC_PIN7) | PIN_MODE_INPUT(GPIOC_PIN8) | PIN_MODE_INPUT(GPIOC_PIN9) | PIN_MODE_INPUT(GPIOC_PIN10) | PIN_MODE_INPUT(GPIOC_PIN11) | PIN_MODE_INPUT(GPIOC_PIN12) | PIN_MODE_INPUT(GPIOC_PIN13) | PIN_MODE_INPUT(GPIOC_PIN14) | PIN_MODE_INPUT(GPIOC_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOC_PIN1) | \
|
#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOC_PIN2) | \
|
#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | PIN_OSPEED_VERYLOW(GPIOC_PIN1) | PIN_OSPEED_VERYLOW(GPIOC_PIN2) | PIN_OSPEED_VERYLOW(GPIOC_PIN3) | PIN_OSPEED_VERYLOW(GPIOC_PIN4) | PIN_OSPEED_VERYLOW(GPIOC_PIN5) | PIN_OSPEED_VERYLOW(GPIOC_PIN6) | PIN_OSPEED_VERYLOW(GPIOC_PIN7) | PIN_OSPEED_VERYLOW(GPIOC_PIN8) | PIN_OSPEED_VERYLOW(GPIOC_PIN9) | PIN_OSPEED_VERYLOW(GPIOC_PIN10) | PIN_OSPEED_VERYLOW(GPIOC_PIN11) | PIN_OSPEED_VERYLOW(GPIOC_PIN12) | PIN_OSPEED_VERYLOW(GPIOC_PIN13) | PIN_OSPEED_HIGH(GPIOC_PIN14) | PIN_OSPEED_HIGH(GPIOC_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOC_PIN3) | \
|
#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | PIN_PUPDR_PULLUP(GPIOC_PIN1) | PIN_PUPDR_PULLUP(GPIOC_PIN2) | PIN_PUPDR_PULLUP(GPIOC_PIN3) | PIN_PUPDR_PULLUP(GPIOC_PIN4) | PIN_PUPDR_PULLUP(GPIOC_PIN5) | PIN_PUPDR_PULLUP(GPIOC_PIN6) | PIN_PUPDR_PULLUP(GPIOC_PIN7) | PIN_PUPDR_PULLUP(GPIOC_PIN8) | PIN_PUPDR_PULLUP(GPIOC_PIN9) | PIN_PUPDR_PULLUP(GPIOC_PIN10) | PIN_PUPDR_PULLUP(GPIOC_PIN11) | PIN_PUPDR_PULLUP(GPIOC_PIN12) | PIN_PUPDR_PULLUP(GPIOC_PIN13) | PIN_PUPDR_FLOATING(GPIOC_PIN14) | PIN_PUPDR_FLOATING(GPIOC_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOC_PIN4) | \
|
#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | PIN_ODR_HIGH(GPIOC_PIN1) | PIN_ODR_HIGH(GPIOC_PIN2) | PIN_ODR_HIGH(GPIOC_PIN3) | PIN_ODR_HIGH(GPIOC_PIN4) | PIN_ODR_HIGH(GPIOC_PIN5) | PIN_ODR_HIGH(GPIOC_PIN6) | PIN_ODR_HIGH(GPIOC_PIN7) | PIN_ODR_HIGH(GPIOC_PIN8) | PIN_ODR_HIGH(GPIOC_PIN9) | PIN_ODR_HIGH(GPIOC_PIN10) | PIN_ODR_HIGH(GPIOC_PIN11) | PIN_ODR_HIGH(GPIOC_PIN12) | PIN_ODR_HIGH(GPIOC_PIN13) | PIN_ODR_HIGH(GPIOC_PIN14) | PIN_ODR_HIGH(GPIOC_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOC_PIN5) | \
|
#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | PIN_AFIO_AF(GPIOC_PIN1, 0) | PIN_AFIO_AF(GPIOC_PIN2, 0) | PIN_AFIO_AF(GPIOC_PIN3, 0) | PIN_AFIO_AF(GPIOC_PIN4, 0) | PIN_AFIO_AF(GPIOC_PIN5, 0) | PIN_AFIO_AF(GPIOC_PIN6, 0) | PIN_AFIO_AF(GPIOC_PIN7, 0))
|
||||||
PIN_MODE_INPUT(GPIOC_PIN6) | \
|
#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | PIN_AFIO_AF(GPIOC_PIN9, 0) | PIN_AFIO_AF(GPIOC_PIN10, 0) | PIN_AFIO_AF(GPIOC_PIN11, 0) | PIN_AFIO_AF(GPIOC_PIN12, 0) | PIN_AFIO_AF(GPIOC_PIN13, 0) | PIN_AFIO_AF(GPIOC_PIN14, 0) | PIN_AFIO_AF(GPIOC_PIN15, 0))
|
||||||
PIN_MODE_INPUT(GPIOC_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOC_PIN15))
|
|
||||||
#define VAL_GPIOC_OTYPER (PIN_OTYPE_PUSHPULL(GPIOC_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOC_PIN15))
|
|
||||||
#define VAL_GPIOC_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOC_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOC_PIN13) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_PIN14) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOC_PIN15))
|
|
||||||
#define VAL_GPIOC_PUPDR (PIN_PUPDR_PULLUP(GPIOC_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOC_PIN13) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_PIN14) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOC_PIN15))
|
|
||||||
#define VAL_GPIOC_ODR (PIN_ODR_HIGH(GPIOC_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOC_PIN15))
|
|
||||||
#define VAL_GPIOC_AFRL (PIN_AFIO_AF(GPIOC_PIN0, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN1, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN2, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN4, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN5, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN6, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN7, 0))
|
|
||||||
#define VAL_GPIOC_AFRH (PIN_AFIO_AF(GPIOC_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN11, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN12, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN13, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN14, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOC_PIN15, 0))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIOD setup:
|
* GPIOD setup:
|
||||||
@ -595,102 +327,13 @@
|
|||||||
* PD14 - PIN14 (input pullup).
|
* PD14 - PIN14 (input pullup).
|
||||||
* PD15 - PIN15 (input pullup).
|
* PD15 - PIN15 (input pullup).
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | \
|
#define VAL_GPIOD_MODER (PIN_MODE_INPUT(GPIOD_PIN0) | PIN_MODE_INPUT(GPIOD_PIN1) | PIN_MODE_INPUT(GPIOD_PIN2) | PIN_MODE_INPUT(GPIOD_PIN3) | PIN_MODE_INPUT(GPIOD_PIN4) | PIN_MODE_INPUT(GPIOD_PIN5) | PIN_MODE_INPUT(GPIOD_PIN6) | PIN_MODE_INPUT(GPIOD_PIN7) | PIN_MODE_INPUT(GPIOD_PIN8) | PIN_MODE_INPUT(GPIOD_PIN9) | PIN_MODE_INPUT(GPIOD_PIN10) | PIN_MODE_INPUT(GPIOD_PIN11) | PIN_MODE_INPUT(GPIOD_PIN12) | PIN_MODE_INPUT(GPIOD_PIN13) | PIN_MODE_INPUT(GPIOD_PIN14) | PIN_MODE_INPUT(GPIOD_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOD_PIN1) | \
|
#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOD_PIN2) | \
|
#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | PIN_OSPEED_VERYLOW(GPIOD_PIN1) | PIN_OSPEED_VERYLOW(GPIOD_PIN2) | PIN_OSPEED_VERYLOW(GPIOD_PIN3) | PIN_OSPEED_VERYLOW(GPIOD_PIN4) | PIN_OSPEED_VERYLOW(GPIOD_PIN5) | PIN_OSPEED_VERYLOW(GPIOD_PIN6) | PIN_OSPEED_VERYLOW(GPIOD_PIN7) | PIN_OSPEED_VERYLOW(GPIOD_PIN8) | PIN_OSPEED_VERYLOW(GPIOD_PIN9) | PIN_OSPEED_VERYLOW(GPIOD_PIN10) | PIN_OSPEED_VERYLOW(GPIOD_PIN11) | PIN_OSPEED_VERYLOW(GPIOD_PIN12) | PIN_OSPEED_VERYLOW(GPIOD_PIN13) | PIN_OSPEED_VERYLOW(GPIOD_PIN14) | PIN_OSPEED_VERYLOW(GPIOD_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOD_PIN3) | \
|
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | PIN_PUPDR_PULLUP(GPIOD_PIN1) | PIN_PUPDR_PULLUP(GPIOD_PIN2) | PIN_PUPDR_PULLUP(GPIOD_PIN3) | PIN_PUPDR_PULLUP(GPIOD_PIN4) | PIN_PUPDR_PULLUP(GPIOD_PIN5) | PIN_PUPDR_PULLUP(GPIOD_PIN6) | PIN_PUPDR_PULLUP(GPIOD_PIN7) | PIN_PUPDR_PULLUP(GPIOD_PIN8) | PIN_PUPDR_PULLUP(GPIOD_PIN9) | PIN_PUPDR_PULLUP(GPIOD_PIN10) | PIN_PUPDR_PULLUP(GPIOD_PIN11) | PIN_PUPDR_PULLUP(GPIOD_PIN12) | PIN_PUPDR_PULLUP(GPIOD_PIN13) | PIN_PUPDR_PULLUP(GPIOD_PIN14) | PIN_PUPDR_PULLUP(GPIOD_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOD_PIN4) | \
|
#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | PIN_ODR_HIGH(GPIOD_PIN1) | PIN_ODR_HIGH(GPIOD_PIN2) | PIN_ODR_HIGH(GPIOD_PIN3) | PIN_ODR_HIGH(GPIOD_PIN4) | PIN_ODR_HIGH(GPIOD_PIN5) | PIN_ODR_HIGH(GPIOD_PIN6) | PIN_ODR_HIGH(GPIOD_PIN7) | PIN_ODR_HIGH(GPIOD_PIN8) | PIN_ODR_HIGH(GPIOD_PIN9) | PIN_ODR_HIGH(GPIOD_PIN10) | PIN_ODR_HIGH(GPIOD_PIN11) | PIN_ODR_HIGH(GPIOD_PIN12) | PIN_ODR_HIGH(GPIOD_PIN13) | PIN_ODR_HIGH(GPIOD_PIN14) | PIN_ODR_HIGH(GPIOD_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOD_PIN5) | \
|
#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | PIN_AFIO_AF(GPIOD_PIN1, 0) | PIN_AFIO_AF(GPIOD_PIN2, 0) | PIN_AFIO_AF(GPIOD_PIN3, 0) | PIN_AFIO_AF(GPIOD_PIN4, 0) | PIN_AFIO_AF(GPIOD_PIN5, 0) | PIN_AFIO_AF(GPIOD_PIN6, 0) | PIN_AFIO_AF(GPIOD_PIN7, 0))
|
||||||
PIN_MODE_INPUT(GPIOD_PIN6) | \
|
#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | PIN_AFIO_AF(GPIOD_PIN9, 0) | PIN_AFIO_AF(GPIOD_PIN10, 0) | PIN_AFIO_AF(GPIOD_PIN11, 0) | PIN_AFIO_AF(GPIOD_PIN12, 0) | PIN_AFIO_AF(GPIOD_PIN13, 0) | PIN_AFIO_AF(GPIOD_PIN14, 0) | PIN_AFIO_AF(GPIOD_PIN15, 0))
|
||||||
PIN_MODE_INPUT(GPIOD_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_OTYPER (PIN_OTYPE_PUSHPULL(GPIOD_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOD_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_PUPDR (PIN_PUPDR_PULLUP(GPIOD_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_ODR (PIN_ODR_HIGH(GPIOD_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOD_PIN15))
|
|
||||||
#define VAL_GPIOD_AFRL (PIN_AFIO_AF(GPIOD_PIN0, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN1, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN2, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN4, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN5, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN6, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN7, 0))
|
|
||||||
#define VAL_GPIOD_AFRH (PIN_AFIO_AF(GPIOD_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN11, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN12, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN13, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN14, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOD_PIN15, 0))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIOE setup:
|
* GPIOE setup:
|
||||||
@ -712,102 +355,13 @@
|
|||||||
* PE14 - PIN14 (output pushpull maximum).
|
* PE14 - PIN14 (output pushpull maximum).
|
||||||
* PE15 - PIN15 (output pushpull maximum).
|
* PE15 - PIN15 (output pushpull maximum).
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | \
|
#define VAL_GPIOE_MODER (PIN_MODE_INPUT(GPIOE_PIN0) | PIN_MODE_INPUT(GPIOE_PIN1) | PIN_MODE_INPUT(GPIOE_PIN2) | PIN_MODE_OUTPUT(GPIOE_PIN3) | PIN_MODE_INPUT(GPIOE_PIN4) | PIN_MODE_INPUT(GPIOE_PIN5) | PIN_MODE_INPUT(GPIOE_PIN6) | PIN_MODE_INPUT(GPIOE_PIN7) | PIN_MODE_OUTPUT(GPIOE_PIN8) | PIN_MODE_OUTPUT(GPIOE_PIN9) | PIN_MODE_OUTPUT(GPIOE_PIN10) | PIN_MODE_OUTPUT(GPIOE_PIN11) | PIN_MODE_OUTPUT(GPIOE_PIN12) | PIN_MODE_OUTPUT(GPIOE_PIN13) | PIN_MODE_OUTPUT(GPIOE_PIN14) | PIN_MODE_OUTPUT(GPIOE_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOE_PIN1) | \
|
#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) | PIN_OTYPE_PUSHPULL(GPIOE_PIN1) | PIN_OTYPE_PUSHPULL(GPIOE_PIN2) | PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | PIN_OTYPE_PUSHPULL(GPIOE_PIN4) | PIN_OTYPE_PUSHPULL(GPIOE_PIN5) | PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | PIN_OTYPE_PUSHPULL(GPIOE_PIN10) | PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | PIN_OTYPE_PUSHPULL(GPIOE_PIN14) | PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOE_PIN2) |\
|
#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) | PIN_OSPEED_VERYLOW(GPIOE_PIN1) | PIN_OSPEED_VERYLOW(GPIOE_PIN2) | PIN_OSPEED_HIGH(GPIOE_PIN3) | PIN_OSPEED_VERYLOW(GPIOE_PIN4) | PIN_OSPEED_VERYLOW(GPIOE_PIN5) | PIN_OSPEED_VERYLOW(GPIOE_PIN6) | PIN_OSPEED_VERYLOW(GPIOE_PIN7) | PIN_OSPEED_HIGH(GPIOE_PIN8) | PIN_OSPEED_HIGH(GPIOE_PIN9) | PIN_OSPEED_HIGH(GPIOE_PIN10) | PIN_OSPEED_HIGH(GPIOE_PIN11) | PIN_OSPEED_HIGH(GPIOE_PIN12) | PIN_OSPEED_HIGH(GPIOE_PIN13) | PIN_OSPEED_HIGH(GPIOE_PIN14) | PIN_OSPEED_HIGH(GPIOE_PIN15))
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN3) | \
|
#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | PIN_PUPDR_PULLUP(GPIOE_PIN1) | PIN_PUPDR_PULLUP(GPIOE_PIN2) | PIN_PUPDR_FLOATING(GPIOE_PIN3) | PIN_PUPDR_PULLUP(GPIOE_PIN4) | PIN_PUPDR_PULLUP(GPIOE_PIN5) | PIN_PUPDR_PULLUP(GPIOE_PIN6) | PIN_PUPDR_PULLUP(GPIOE_PIN7) | PIN_PUPDR_PULLUP(GPIOE_PIN8) | PIN_PUPDR_PULLUP(GPIOE_PIN9) | PIN_PUPDR_PULLUP(GPIOE_PIN10) | PIN_PUPDR_FLOATING(GPIOE_PIN11) | PIN_PUPDR_PULLUP(GPIOE_PIN12) | PIN_PUPDR_FLOATING(GPIOE_PIN13) | PIN_PUPDR_FLOATING(GPIOE_PIN14) | PIN_PUPDR_FLOATING(GPIOE_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOE_PIN4) |\
|
#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | PIN_ODR_HIGH(GPIOE_PIN1) | PIN_ODR_HIGH(GPIOE_PIN2) | PIN_ODR_HIGH(GPIOE_PIN3) | PIN_ODR_HIGH(GPIOE_PIN4) | PIN_ODR_HIGH(GPIOE_PIN5) | PIN_ODR_HIGH(GPIOE_PIN6) | PIN_ODR_HIGH(GPIOE_PIN7) | PIN_ODR_LOW(GPIOE_PIN8) | PIN_ODR_LOW(GPIOE_PIN9) | PIN_ODR_LOW(GPIOE_PIN10) | PIN_ODR_LOW(GPIOE_PIN11) | PIN_ODR_LOW(GPIOE_PIN12) | PIN_ODR_LOW(GPIOE_PIN13) | PIN_ODR_LOW(GPIOE_PIN14) | PIN_ODR_LOW(GPIOE_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOE_PIN5) |\
|
#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | PIN_AFIO_AF(GPIOE_PIN1, 0) | PIN_AFIO_AF(GPIOE_PIN2, 0) | PIN_AFIO_AF(GPIOE_PIN3, 0) | PIN_AFIO_AF(GPIOE_PIN4, 0) | PIN_AFIO_AF(GPIOE_PIN5, 0) | PIN_AFIO_AF(GPIOE_PIN6, 0) | PIN_AFIO_AF(GPIOE_PIN7, 0))
|
||||||
PIN_MODE_INPUT(GPIOE_PIN6) | \
|
#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | PIN_AFIO_AF(GPIOE_PIN9, 0) | PIN_AFIO_AF(GPIOE_PIN10, 0) | PIN_AFIO_AF(GPIOE_PIN11, 0) | PIN_AFIO_AF(GPIOE_PIN12, 0) | PIN_AFIO_AF(GPIOE_PIN13, 0) | PIN_AFIO_AF(GPIOE_PIN14, 0) | PIN_AFIO_AF(GPIOE_PIN15, 0))
|
||||||
PIN_MODE_INPUT(GPIOE_PIN7) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN8) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN9) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN10) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN11) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN12) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN13) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN14) | \
|
|
||||||
PIN_MODE_OUTPUT(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_OTYPER (PIN_OTYPE_PUSHPULL(GPIOE_PIN0) |\
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN1) |\
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN2) |\
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN4) |\
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN5) |\
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN10) |\
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN14) |\
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOE_PIN0) |\
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN1) |\
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN2) |\
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN4) |\
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN5) |\
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOE_PIN7) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN8) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN9) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN10) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN11) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN12) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN13) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN14) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_PUPDR (PIN_PUPDR_PULLUP(GPIOE_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN2) |\
|
|
||||||
PIN_PUPDR_FLOATING(GPIOE_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN4) |\
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN5) |\
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN10) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOE_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOE_PIN12) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOE_PIN13) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOE_PIN14) |\
|
|
||||||
PIN_PUPDR_FLOATING(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_ODR (PIN_ODR_HIGH(GPIOE_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOE_PIN7) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN8) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN9) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN10) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN11) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN12) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN13) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN14) | \
|
|
||||||
PIN_ODR_LOW(GPIOE_PIN15))
|
|
||||||
#define VAL_GPIOE_AFRL (PIN_AFIO_AF(GPIOE_PIN0, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN1, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN2, 0) |\
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN4, 0) |\
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN5, 0) |\
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN6, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN7, 0))
|
|
||||||
#define VAL_GPIOE_AFRH (PIN_AFIO_AF(GPIOE_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN11, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN12, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN13, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN14, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOE_PIN15, 0))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIOF setup:
|
* GPIOF setup:
|
||||||
@ -829,102 +383,13 @@
|
|||||||
* PF14 - PIN14 (input pullup).
|
* PF14 - PIN14 (input pullup).
|
||||||
* PF15 - PIN15 (input pullup).
|
* PF15 - PIN15 (input pullup).
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | \
|
#define VAL_GPIOF_MODER (PIN_MODE_INPUT(GPIOF_I2C2_SDA) | PIN_MODE_INPUT(GPIOF_I2C2_SCL) | PIN_MODE_INPUT(GPIOF_PIN2) | PIN_MODE_INPUT(GPIOF_PIN3) | PIN_MODE_INPUT(GPIOF_PIN4) | PIN_MODE_INPUT(GPIOF_PIN5) | PIN_MODE_INPUT(GPIOF_PIN6) | PIN_MODE_INPUT(GPIOF_PIN7) | PIN_MODE_INPUT(GPIOF_PIN8) | PIN_MODE_INPUT(GPIOF_PIN9) | PIN_MODE_INPUT(GPIOF_PIN10) | PIN_MODE_INPUT(GPIOF_PIN11) | PIN_MODE_INPUT(GPIOF_PIN12) | PIN_MODE_INPUT(GPIOF_PIN13) | PIN_MODE_INPUT(GPIOF_PIN14) | PIN_MODE_INPUT(GPIOF_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOF_I2C2_SCL) | \
|
#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOF_PIN2) | \
|
#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | PIN_OSPEED_VERYLOW(GPIOF_PIN2) | PIN_OSPEED_VERYLOW(GPIOF_PIN3) | PIN_OSPEED_VERYLOW(GPIOF_PIN4) | PIN_OSPEED_VERYLOW(GPIOF_PIN5) | PIN_OSPEED_VERYLOW(GPIOF_PIN6) | PIN_OSPEED_VERYLOW(GPIOF_PIN7) | PIN_OSPEED_VERYLOW(GPIOF_PIN8) | PIN_OSPEED_VERYLOW(GPIOF_PIN9) | PIN_OSPEED_VERYLOW(GPIOF_PIN10) | PIN_OSPEED_VERYLOW(GPIOF_PIN11) | PIN_OSPEED_VERYLOW(GPIOF_PIN12) | PIN_OSPEED_VERYLOW(GPIOF_PIN13) | PIN_OSPEED_VERYLOW(GPIOF_PIN14) | PIN_OSPEED_VERYLOW(GPIOF_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOF_PIN3) | \
|
#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | PIN_PUPDR_PULLUP(GPIOF_PIN2) | PIN_PUPDR_PULLUP(GPIOF_PIN3) | PIN_PUPDR_PULLUP(GPIOF_PIN4) | PIN_PUPDR_PULLUP(GPIOF_PIN5) | PIN_PUPDR_PULLUP(GPIOF_PIN6) | PIN_PUPDR_PULLUP(GPIOF_PIN7) | PIN_PUPDR_PULLUP(GPIOF_PIN8) | PIN_PUPDR_PULLUP(GPIOF_PIN9) | PIN_PUPDR_PULLUP(GPIOF_PIN10) | PIN_PUPDR_PULLUP(GPIOF_PIN11) | PIN_PUPDR_PULLUP(GPIOF_PIN12) | PIN_PUPDR_PULLUP(GPIOF_PIN13) | PIN_PUPDR_PULLUP(GPIOF_PIN14) | PIN_PUPDR_PULLUP(GPIOF_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOF_PIN4) | \
|
#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | PIN_ODR_HIGH(GPIOF_I2C2_SCL) | PIN_ODR_HIGH(GPIOF_PIN2) | PIN_ODR_HIGH(GPIOF_PIN3) | PIN_ODR_HIGH(GPIOF_PIN4) | PIN_ODR_HIGH(GPIOF_PIN5) | PIN_ODR_HIGH(GPIOF_PIN6) | PIN_ODR_HIGH(GPIOF_PIN7) | PIN_ODR_HIGH(GPIOF_PIN8) | PIN_ODR_HIGH(GPIOF_PIN9) | PIN_ODR_HIGH(GPIOF_PIN10) | PIN_ODR_HIGH(GPIOF_PIN11) | PIN_ODR_HIGH(GPIOF_PIN12) | PIN_ODR_HIGH(GPIOF_PIN13) | PIN_ODR_HIGH(GPIOF_PIN14) | PIN_ODR_HIGH(GPIOF_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOF_PIN5) | \
|
#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | PIN_AFIO_AF(GPIOF_PIN2, 0) | PIN_AFIO_AF(GPIOF_PIN3, 0) | PIN_AFIO_AF(GPIOF_PIN4, 0) | PIN_AFIO_AF(GPIOF_PIN5, 0) | PIN_AFIO_AF(GPIOF_PIN6, 0) | PIN_AFIO_AF(GPIOF_PIN7, 0))
|
||||||
PIN_MODE_INPUT(GPIOF_PIN6) | \
|
#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | PIN_AFIO_AF(GPIOF_PIN9, 0) | PIN_AFIO_AF(GPIOF_PIN10, 0) | PIN_AFIO_AF(GPIOF_PIN11, 0) | PIN_AFIO_AF(GPIOF_PIN12, 0) | PIN_AFIO_AF(GPIOF_PIN13, 0) | PIN_AFIO_AF(GPIOF_PIN14, 0) | PIN_AFIO_AF(GPIOF_PIN15, 0))
|
||||||
PIN_MODE_INPUT(GPIOF_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_OTYPER (PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SDA) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_I2C2_SCL) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_OSPEEDR (PIN_OSPEED_HIGH(GPIOF_I2C2_SDA) | \
|
|
||||||
PIN_OSPEED_HIGH(GPIOF_I2C2_SCL) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_PUPDR (PIN_PUPDR_FLOATING(GPIOF_I2C2_SDA) | \
|
|
||||||
PIN_PUPDR_FLOATING(GPIOF_I2C2_SCL) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_ODR (PIN_ODR_HIGH(GPIOF_I2C2_SDA) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_I2C2_SCL) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOF_PIN15))
|
|
||||||
#define VAL_GPIOF_AFRL (PIN_AFIO_AF(GPIOF_I2C2_SDA, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_I2C2_SCL, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN2, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN4, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN5, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN6, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN7, 0))
|
|
||||||
#define VAL_GPIOF_AFRH (PIN_AFIO_AF(GPIOF_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN11, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN12, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN13, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN14, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOF_PIN15, 0))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIOG setup:
|
* GPIOG setup:
|
||||||
@ -946,102 +411,13 @@
|
|||||||
* PG14 - PIN14 (input pullup).
|
* PG14 - PIN14 (input pullup).
|
||||||
* PG15 - PIN15 (input pullup).
|
* PG15 - PIN15 (input pullup).
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | \
|
#define VAL_GPIOG_MODER (PIN_MODE_INPUT(GPIOG_PIN0) | PIN_MODE_INPUT(GPIOG_PIN1) | PIN_MODE_INPUT(GPIOG_PIN2) | PIN_MODE_INPUT(GPIOG_PIN3) | PIN_MODE_INPUT(GPIOG_PIN4) | PIN_MODE_INPUT(GPIOG_PIN5) | PIN_MODE_INPUT(GPIOG_PIN6) | PIN_MODE_INPUT(GPIOG_PIN7) | PIN_MODE_INPUT(GPIOG_PIN8) | PIN_MODE_INPUT(GPIOG_PIN9) | PIN_MODE_INPUT(GPIOG_PIN10) | PIN_MODE_INPUT(GPIOG_PIN11) | PIN_MODE_INPUT(GPIOG_PIN12) | PIN_MODE_INPUT(GPIOG_PIN13) | PIN_MODE_INPUT(GPIOG_PIN14) | PIN_MODE_INPUT(GPIOG_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOG_PIN1) | \
|
#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOG_PIN2) | \
|
#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | PIN_OSPEED_VERYLOW(GPIOG_PIN1) | PIN_OSPEED_VERYLOW(GPIOG_PIN2) | PIN_OSPEED_VERYLOW(GPIOG_PIN3) | PIN_OSPEED_VERYLOW(GPIOG_PIN4) | PIN_OSPEED_VERYLOW(GPIOG_PIN5) | PIN_OSPEED_VERYLOW(GPIOG_PIN6) | PIN_OSPEED_VERYLOW(GPIOG_PIN7) | PIN_OSPEED_VERYLOW(GPIOG_PIN8) | PIN_OSPEED_VERYLOW(GPIOG_PIN9) | PIN_OSPEED_VERYLOW(GPIOG_PIN10) | PIN_OSPEED_VERYLOW(GPIOG_PIN11) | PIN_OSPEED_VERYLOW(GPIOG_PIN12) | PIN_OSPEED_VERYLOW(GPIOG_PIN13) | PIN_OSPEED_VERYLOW(GPIOG_PIN14) | PIN_OSPEED_VERYLOW(GPIOG_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOG_PIN3) | \
|
#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | PIN_PUPDR_PULLUP(GPIOG_PIN1) | PIN_PUPDR_PULLUP(GPIOG_PIN2) | PIN_PUPDR_PULLUP(GPIOG_PIN3) | PIN_PUPDR_PULLUP(GPIOG_PIN4) | PIN_PUPDR_PULLUP(GPIOG_PIN5) | PIN_PUPDR_PULLUP(GPIOG_PIN6) | PIN_PUPDR_PULLUP(GPIOG_PIN7) | PIN_PUPDR_PULLUP(GPIOG_PIN8) | PIN_PUPDR_PULLUP(GPIOG_PIN9) | PIN_PUPDR_PULLUP(GPIOG_PIN10) | PIN_PUPDR_PULLUP(GPIOG_PIN11) | PIN_PUPDR_PULLUP(GPIOG_PIN12) | PIN_PUPDR_PULLUP(GPIOG_PIN13) | PIN_PUPDR_PULLUP(GPIOG_PIN14) | PIN_PUPDR_PULLUP(GPIOG_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOG_PIN4) | \
|
#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | PIN_ODR_HIGH(GPIOG_PIN1) | PIN_ODR_HIGH(GPIOG_PIN2) | PIN_ODR_HIGH(GPIOG_PIN3) | PIN_ODR_HIGH(GPIOG_PIN4) | PIN_ODR_HIGH(GPIOG_PIN5) | PIN_ODR_HIGH(GPIOG_PIN6) | PIN_ODR_HIGH(GPIOG_PIN7) | PIN_ODR_HIGH(GPIOG_PIN8) | PIN_ODR_HIGH(GPIOG_PIN9) | PIN_ODR_HIGH(GPIOG_PIN10) | PIN_ODR_HIGH(GPIOG_PIN11) | PIN_ODR_HIGH(GPIOG_PIN12) | PIN_ODR_HIGH(GPIOG_PIN13) | PIN_ODR_HIGH(GPIOG_PIN14) | PIN_ODR_HIGH(GPIOG_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOG_PIN5) | \
|
#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | PIN_AFIO_AF(GPIOG_PIN1, 0) | PIN_AFIO_AF(GPIOG_PIN2, 0) | PIN_AFIO_AF(GPIOG_PIN3, 0) | PIN_AFIO_AF(GPIOG_PIN4, 0) | PIN_AFIO_AF(GPIOG_PIN5, 0) | PIN_AFIO_AF(GPIOG_PIN6, 0) | PIN_AFIO_AF(GPIOG_PIN7, 0))
|
||||||
PIN_MODE_INPUT(GPIOG_PIN6) | \
|
#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | PIN_AFIO_AF(GPIOG_PIN9, 0) | PIN_AFIO_AF(GPIOG_PIN10, 0) | PIN_AFIO_AF(GPIOG_PIN11, 0) | PIN_AFIO_AF(GPIOG_PIN12, 0) | PIN_AFIO_AF(GPIOG_PIN13, 0) | PIN_AFIO_AF(GPIOG_PIN14, 0) | PIN_AFIO_AF(GPIOG_PIN15, 0))
|
||||||
PIN_MODE_INPUT(GPIOG_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOG_PIN15))
|
|
||||||
#define VAL_GPIOG_OTYPER (PIN_OTYPE_PUSHPULL(GPIOG_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOG_PIN15))
|
|
||||||
#define VAL_GPIOG_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOG_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOG_PIN15))
|
|
||||||
#define VAL_GPIOG_PUPDR (PIN_PUPDR_PULLUP(GPIOG_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOG_PIN15))
|
|
||||||
#define VAL_GPIOG_ODR (PIN_ODR_HIGH(GPIOG_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOG_PIN15))
|
|
||||||
#define VAL_GPIOG_AFRL (PIN_AFIO_AF(GPIOG_PIN0, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN1, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN2, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN4, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN5, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN6, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN7, 0))
|
|
||||||
#define VAL_GPIOG_AFRH (PIN_AFIO_AF(GPIOG_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN11, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN12, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN13, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN14, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOG_PIN15, 0))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GPIOH setup:
|
* GPIOH setup:
|
||||||
@ -1063,103 +439,13 @@
|
|||||||
* PH14 - PIN14 (input pullup).
|
* PH14 - PIN14 (input pullup).
|
||||||
* PH15 - PIN15 (input pullup).
|
* PH15 - PIN15 (input pullup).
|
||||||
*/
|
*/
|
||||||
#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | \
|
#define VAL_GPIOH_MODER (PIN_MODE_INPUT(GPIOH_PIN0) | PIN_MODE_INPUT(GPIOH_PIN1) | PIN_MODE_INPUT(GPIOH_PIN2) | PIN_MODE_INPUT(GPIOH_PIN3) | PIN_MODE_INPUT(GPIOH_PIN4) | PIN_MODE_INPUT(GPIOH_PIN5) | PIN_MODE_INPUT(GPIOH_PIN6) | PIN_MODE_INPUT(GPIOH_PIN7) | PIN_MODE_INPUT(GPIOH_PIN8) | PIN_MODE_INPUT(GPIOH_PIN9) | PIN_MODE_INPUT(GPIOH_PIN10) | PIN_MODE_INPUT(GPIOH_PIN11) | PIN_MODE_INPUT(GPIOH_PIN12) | PIN_MODE_INPUT(GPIOH_PIN13) | PIN_MODE_INPUT(GPIOH_PIN14) | PIN_MODE_INPUT(GPIOH_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOH_PIN1) | \
|
#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOH_PIN2) | \
|
#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | PIN_OSPEED_VERYLOW(GPIOH_PIN1) | PIN_OSPEED_VERYLOW(GPIOH_PIN2) | PIN_OSPEED_VERYLOW(GPIOH_PIN3) | PIN_OSPEED_VERYLOW(GPIOH_PIN4) | PIN_OSPEED_VERYLOW(GPIOH_PIN5) | PIN_OSPEED_VERYLOW(GPIOH_PIN6) | PIN_OSPEED_VERYLOW(GPIOH_PIN7) | PIN_OSPEED_VERYLOW(GPIOH_PIN8) | PIN_OSPEED_VERYLOW(GPIOH_PIN9) | PIN_OSPEED_VERYLOW(GPIOH_PIN10) | PIN_OSPEED_VERYLOW(GPIOH_PIN11) | PIN_OSPEED_VERYLOW(GPIOH_PIN12) | PIN_OSPEED_VERYLOW(GPIOH_PIN13) | PIN_OSPEED_VERYLOW(GPIOH_PIN14) | PIN_OSPEED_VERYLOW(GPIOH_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOH_PIN3) | \
|
#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | PIN_PUPDR_PULLUP(GPIOH_PIN1) | PIN_PUPDR_PULLUP(GPIOH_PIN2) | PIN_PUPDR_PULLUP(GPIOH_PIN3) | PIN_PUPDR_PULLUP(GPIOH_PIN4) | PIN_PUPDR_PULLUP(GPIOH_PIN5) | PIN_PUPDR_PULLUP(GPIOH_PIN6) | PIN_PUPDR_PULLUP(GPIOH_PIN7) | PIN_PUPDR_PULLUP(GPIOH_PIN8) | PIN_PUPDR_PULLUP(GPIOH_PIN9) | PIN_PUPDR_PULLUP(GPIOH_PIN10) | PIN_PUPDR_PULLUP(GPIOH_PIN11) | PIN_PUPDR_PULLUP(GPIOH_PIN12) | PIN_PUPDR_PULLUP(GPIOH_PIN13) | PIN_PUPDR_PULLUP(GPIOH_PIN14) | PIN_PUPDR_PULLUP(GPIOH_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOH_PIN4) | \
|
#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | PIN_ODR_HIGH(GPIOH_PIN1) | PIN_ODR_HIGH(GPIOH_PIN2) | PIN_ODR_HIGH(GPIOH_PIN3) | PIN_ODR_HIGH(GPIOH_PIN4) | PIN_ODR_HIGH(GPIOH_PIN5) | PIN_ODR_HIGH(GPIOH_PIN6) | PIN_ODR_HIGH(GPIOH_PIN7) | PIN_ODR_HIGH(GPIOH_PIN8) | PIN_ODR_HIGH(GPIOH_PIN9) | PIN_ODR_HIGH(GPIOH_PIN10) | PIN_ODR_HIGH(GPIOH_PIN11) | PIN_ODR_HIGH(GPIOH_PIN12) | PIN_ODR_HIGH(GPIOH_PIN13) | PIN_ODR_HIGH(GPIOH_PIN14) | PIN_ODR_HIGH(GPIOH_PIN15))
|
||||||
PIN_MODE_INPUT(GPIOH_PIN5) | \
|
#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | PIN_AFIO_AF(GPIOH_PIN1, 0) | PIN_AFIO_AF(GPIOH_PIN2, 0) | PIN_AFIO_AF(GPIOH_PIN3, 0) | PIN_AFIO_AF(GPIOH_PIN4, 0) | PIN_AFIO_AF(GPIOH_PIN5, 0) | PIN_AFIO_AF(GPIOH_PIN6, 0) | PIN_AFIO_AF(GPIOH_PIN7, 0))
|
||||||
PIN_MODE_INPUT(GPIOH_PIN6) | \
|
#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | PIN_AFIO_AF(GPIOH_PIN9, 0) | PIN_AFIO_AF(GPIOH_PIN10, 0) | PIN_AFIO_AF(GPIOH_PIN11, 0) | PIN_AFIO_AF(GPIOH_PIN12, 0) | PIN_AFIO_AF(GPIOH_PIN13, 0) | PIN_AFIO_AF(GPIOH_PIN14, 0) | PIN_AFIO_AF(GPIOH_PIN15, 0))
|
||||||
PIN_MODE_INPUT(GPIOH_PIN7) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN8) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN9) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN10) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN11) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN12) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN13) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN14) | \
|
|
||||||
PIN_MODE_INPUT(GPIOH_PIN15))
|
|
||||||
#define VAL_GPIOH_OTYPER (PIN_OTYPE_PUSHPULL(GPIOH_PIN0) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN1) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN2) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN3) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN4) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN5) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN6) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN7) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN8) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN9) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN10) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN11) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN12) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN13) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN14) | \
|
|
||||||
PIN_OTYPE_PUSHPULL(GPIOH_PIN15))
|
|
||||||
#define VAL_GPIOH_OSPEEDR (PIN_OSPEED_VERYLOW(GPIOH_PIN0) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN1) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN2) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN3) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN4) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN5) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN6) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN7) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN8) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN9) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN10) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN11) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN12) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN13) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN14) | \
|
|
||||||
PIN_OSPEED_VERYLOW(GPIOH_PIN15))
|
|
||||||
#define VAL_GPIOH_PUPDR (PIN_PUPDR_PULLUP(GPIOH_PIN0) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN1) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN2) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN3) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN4) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN5) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN6) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN7) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN8) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN9) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN10) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN11) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN12) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN13) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN14) | \
|
|
||||||
PIN_PUPDR_PULLUP(GPIOH_PIN15))
|
|
||||||
#define VAL_GPIOH_ODR (PIN_ODR_HIGH(GPIOH_PIN0) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN1) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN2) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN3) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN4) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN5) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN6) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN7) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN8) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN9) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN10) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN11) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN12) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN13) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN14) | \
|
|
||||||
PIN_ODR_HIGH(GPIOH_PIN15))
|
|
||||||
#define VAL_GPIOH_AFRL (PIN_AFIO_AF(GPIOH_PIN0, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN1, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN2, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN3, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN4, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN5, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN6, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN7, 0))
|
|
||||||
#define VAL_GPIOH_AFRH (PIN_AFIO_AF(GPIOH_PIN8, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN9, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN10, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN11, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN12, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN13, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN14, 0) | \
|
|
||||||
PIN_AFIO_AF(GPIOH_PIN15, 0))
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* USB bus activation macro, required by the USB driver.
|
* USB bus activation macro, required by the USB driver.
|
||||||
@ -1171,7 +457,9 @@
|
|||||||
* USB bus de-activation macro, required by the USB driver.
|
* USB bus de-activation macro, required by the USB driver.
|
||||||
*/
|
*/
|
||||||
// #define usb_lld_disconnect_bus(usbp)
|
// #define usb_lld_disconnect_bus(usbp)
|
||||||
#define usb_lld_disconnect_bus(usbp) (palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); palClearPad(GPIOA, GPIOA_USB_DP)
|
#define usb_lld_disconnect_bus(usbp) \
|
||||||
|
(palSetPadMode(GPIOA, GPIOA_USB_DP, PAL_MODE_OUTPUT_PUSHPULL)); \
|
||||||
|
palClearPad(GPIOA, GPIOA_USB_DP)
|
||||||
// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12)
|
// #define usb_lld_disconnect_bus(usbp) palSetPadMode(GPIOA, 12, PAL_MODE_OUTPUT_PUSHPULL); palClearPad(GPIOA, 12)
|
||||||
|
|
||||||
#if !defined(_FROM_ASM_)
|
#if !defined(_FROM_ASM_)
|
||||||
|
@ -21,9 +21,9 @@
|
|||||||
* @details Digital I/O ports static configuration as defined in @p board.h.
|
* @details Digital I/O ports static configuration as defined in @p board.h.
|
||||||
* This variable is used by the HAL when initializing the PAL driver.
|
* This variable is used by the HAL when initializing the PAL driver.
|
||||||
*/
|
*/
|
||||||
const PALConfig pal_default_config =
|
const PALConfig pal_default_config = {
|
||||||
|
.ports =
|
||||||
{
|
{
|
||||||
.ports = {
|
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* PORTA setup.
|
* PORTA setup.
|
||||||
@ -37,18 +37,9 @@ const PALConfig pal_default_config =
|
|||||||
* PTA0/3 SWD
|
* PTA0/3 SWD
|
||||||
*/
|
*/
|
||||||
.port = IOPORT1,
|
.port = IOPORT1,
|
||||||
.pads = {
|
.pads =
|
||||||
PAL_MODE_ALTERNATIVE_7, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
{
|
||||||
PAL_MODE_ALTERNATIVE_7, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
PAL_MODE_ALTERNATIVE_7, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_ALTERNATIVE_7, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_INPUT_ANALOG, PAL_MODE_INPUT_ANALOG, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_INPUT_ANALOG, PAL_MODE_INPUT_ANALOG, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -65,18 +56,9 @@ const PALConfig pal_default_config =
|
|||||||
* PTB19 - PIN25
|
* PTB19 - PIN25
|
||||||
*/
|
*/
|
||||||
.port = IOPORT2,
|
.port = IOPORT2,
|
||||||
.pads = {
|
.pads =
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
{
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_ALTERNATIVE_3, PAL_MODE_ALTERNATIVE_3, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_ALTERNATIVE_3, PAL_MODE_ALTERNATIVE_3,
|
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -97,18 +79,9 @@ const PALConfig pal_default_config =
|
|||||||
* PTC11 - PIN30
|
* PTC11 - PIN30
|
||||||
*/
|
*/
|
||||||
.port = IOPORT3,
|
.port = IOPORT3,
|
||||||
.pads = {
|
.pads =
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
{
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -125,18 +98,9 @@ const PALConfig pal_default_config =
|
|||||||
* PTD7 - PIN5
|
* PTD7 - PIN5
|
||||||
*/
|
*/
|
||||||
.port = IOPORT4,
|
.port = IOPORT4,
|
||||||
.pads = {
|
.pads =
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
{
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL,
|
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -147,18 +111,9 @@ const PALConfig pal_default_config =
|
|||||||
* PTE1 - PIN26
|
* PTE1 - PIN26
|
||||||
*/
|
*/
|
||||||
.port = IOPORT5,
|
.port = IOPORT5,
|
||||||
.pads = {
|
.pads =
|
||||||
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED,
|
{
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_OUTPUT_PUSHPULL, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
PAL_MODE_UNCONNECTED, PAL_MODE_UNCONNECTED,
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -178,7 +133,8 @@ const PALConfig pal_default_config =
|
|||||||
void __early_init(void) {
|
void __early_init(void) {
|
||||||
// This is a dirty hack and should only be used as a temporary fix until this
|
// This is a dirty hack and should only be used as a temporary fix until this
|
||||||
// is upstreamed.
|
// is upstreamed.
|
||||||
while (WDOG_TMROUTL < 2); // Must wait for WDOG timer if already running, before jumping
|
while (WDOG_TMROUTL < 2)
|
||||||
|
; // Must wait for WDOG timer if already running, before jumping
|
||||||
|
|
||||||
k20x_clock_init();
|
k20x_clock_init();
|
||||||
}
|
}
|
||||||
@ -187,5 +143,4 @@ void __early_init(void) {
|
|||||||
* @brief Board-specific initialization code.
|
* @brief Board-specific initialization code.
|
||||||
* @todo Add your board-specific code, if any.
|
* @todo Add your board-specific code, if any.
|
||||||
*/
|
*/
|
||||||
void boardInit(void) {
|
void boardInit(void) {}
|
||||||
}
|
|
||||||
|
78
drivers/gpio/pca9555.c
Normal file
78
drivers/gpio/pca9555.c
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
/* Copyright 2019
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 2 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
#include "i2c_master.h"
|
||||||
|
#include "pca9555.h"
|
||||||
|
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
#define SLAVE_TO_ADDR(n) (n << 1)
|
||||||
|
#define TIMEOUT 100
|
||||||
|
|
||||||
|
enum {
|
||||||
|
CMD_INPUT_0 = 0,
|
||||||
|
CMD_INPUT_1,
|
||||||
|
CMD_OUTPUT_0,
|
||||||
|
CMD_OUTPUT_1,
|
||||||
|
CMD_INVERSION_0,
|
||||||
|
CMD_INVERSION_1,
|
||||||
|
CMD_CONFIG_0,
|
||||||
|
CMD_CONFIG_1,
|
||||||
|
};
|
||||||
|
|
||||||
|
void pca9555_init(uint8_t slave_addr) {
|
||||||
|
static uint8_t s_init = 0;
|
||||||
|
if (!s_init) {
|
||||||
|
i2c_init();
|
||||||
|
|
||||||
|
s_init = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: could check device connected
|
||||||
|
// i2c_start(SLAVE_TO_ADDR(slave) | I2C_WRITE);
|
||||||
|
// i2c_stop();
|
||||||
|
}
|
||||||
|
|
||||||
|
void pca9555_set_config(uint8_t slave_addr, uint8_t port, uint8_t conf) {
|
||||||
|
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
|
||||||
|
uint8_t cmd = port ? CMD_CONFIG_1 : CMD_CONFIG_0;
|
||||||
|
|
||||||
|
i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT);
|
||||||
|
if (ret != I2C_STATUS_SUCCESS) {
|
||||||
|
print("pca9555_set_config::FAILED\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void pca9555_set_output(uint8_t slave_addr, uint8_t port, uint8_t conf) {
|
||||||
|
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
|
||||||
|
uint8_t cmd = port ? CMD_OUTPUT_1 : CMD_OUTPUT_0;
|
||||||
|
|
||||||
|
i2c_status_t ret = i2c_writeReg(addr, cmd, &conf, sizeof(conf), TIMEOUT);
|
||||||
|
if (ret != I2C_STATUS_SUCCESS) {
|
||||||
|
print("pca9555_set_output::FAILED\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
uint8_t pca9555_readPins(uint8_t slave_addr, uint8_t port) {
|
||||||
|
uint8_t addr = SLAVE_TO_ADDR(slave_addr);
|
||||||
|
uint8_t cmd = port ? CMD_INPUT_1 : CMD_INPUT_0;
|
||||||
|
|
||||||
|
uint8_t data = 0;
|
||||||
|
i2c_status_t ret = i2c_readReg(addr, cmd, &data, sizeof(data), TIMEOUT);
|
||||||
|
if (ret != I2C_STATUS_SUCCESS) {
|
||||||
|
print("pca9555_readPins::FAILED\n");
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}
|
@ -20,13 +20,11 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
|
||||||
uint8_t DRV2605L_transfer_buffer[2];
|
uint8_t DRV2605L_transfer_buffer[2];
|
||||||
uint8_t DRV2605L_tx_register[0];
|
uint8_t DRV2605L_tx_register[0];
|
||||||
uint8_t DRV2605L_read_buffer[0];
|
uint8_t DRV2605L_read_buffer[0];
|
||||||
uint8_t DRV2605L_read_register;
|
uint8_t DRV2605L_read_register;
|
||||||
|
|
||||||
|
|
||||||
void DRV_write(uint8_t drv_register, uint8_t settings) {
|
void DRV_write(uint8_t drv_register, uint8_t settings) {
|
||||||
DRV2605L_transfer_buffer[0] = drv_register;
|
DRV2605L_transfer_buffer[0] = drv_register;
|
||||||
DRV2605L_transfer_buffer[1] = settings;
|
DRV2605L_transfer_buffer[1] = settings;
|
||||||
@ -35,15 +33,11 @@ void DRV_write(uint8_t drv_register, uint8_t settings) {
|
|||||||
|
|
||||||
uint8_t DRV_read(uint8_t regaddress) {
|
uint8_t DRV_read(uint8_t regaddress) {
|
||||||
#ifdef __AVR__
|
#ifdef __AVR__
|
||||||
i2c_readReg(DRV2605L_BASE_ADDRESS << 1,
|
i2c_readReg(DRV2605L_BASE_ADDRESS << 1, regaddress, DRV2605L_read_buffer, 1, 100);
|
||||||
regaddress, DRV2605L_read_buffer, 1, 100);
|
|
||||||
DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0];
|
DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0];
|
||||||
#else
|
#else
|
||||||
DRV2605L_tx_register[0] = regaddress;
|
DRV2605L_tx_register[0] = regaddress;
|
||||||
if (MSG_OK != i2c_transmit_receive(DRV2605L_BASE_ADDRESS << 1,
|
if (MSG_OK != i2c_transmit_receive(DRV2605L_BASE_ADDRESS << 1, DRV2605L_tx_register, 1, DRV2605L_read_buffer, 1)) {
|
||||||
DRV2605L_tx_register, 1,
|
|
||||||
DRV2605L_read_buffer, 1
|
|
||||||
)){
|
|
||||||
printf("err reading reg \n");
|
printf("err reading reg \n");
|
||||||
}
|
}
|
||||||
DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0];
|
DRV2605L_read_register = (uint8_t)DRV2605L_read_buffer[0];
|
||||||
@ -51,8 +45,7 @@ uint8_t DRV_read(uint8_t regaddress) {
|
|||||||
return DRV2605L_read_register;
|
return DRV2605L_read_register;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DRV_init(void)
|
void DRV_init(void) {
|
||||||
{
|
|
||||||
i2c_init();
|
i2c_init();
|
||||||
/* 0x07 sets DRV2605 into calibration mode */
|
/* 0x07 sets DRV2605 into calibration mode */
|
||||||
DRV_write(DRV_MODE, 0x07);
|
DRV_write(DRV_MODE, 0x07);
|
||||||
@ -121,8 +114,7 @@ void DRV_init(void)
|
|||||||
DRV_write(DRV_GO, 0x01);
|
DRV_write(DRV_GO, 0x01);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DRV_pulse(uint8_t sequence)
|
void DRV_pulse(uint8_t sequence) {
|
||||||
{
|
|
||||||
DRV_write(DRV_GO, 0x00);
|
DRV_write(DRV_GO, 0x00);
|
||||||
DRV_write(DRV_WAVEFORM_SEQ_1, sequence);
|
DRV_write(DRV_WAVEFORM_SEQ_1, sequence);
|
||||||
DRV_write(DRV_GO, 0x01);
|
DRV_write(DRV_GO, 0x01);
|
||||||
|
@ -86,8 +86,7 @@ if (haptic_config.enable) {
|
|||||||
|
|
||||||
void haptic_feedback_toggle(void) {
|
void haptic_feedback_toggle(void) {
|
||||||
haptic_config.feedback++;
|
haptic_config.feedback++;
|
||||||
if (haptic_config.feedback >= HAPTIC_FEEDBACK_MAX)
|
if (haptic_config.feedback >= HAPTIC_FEEDBACK_MAX) haptic_config.feedback = KEY_PRESS;
|
||||||
haptic_config.feedback = KEY_PRESS;
|
|
||||||
xprintf("haptic_config.feedback = %u\n", !haptic_config.feedback);
|
xprintf("haptic_config.feedback = %u\n", !haptic_config.feedback);
|
||||||
eeconfig_update_haptic(haptic_config.raw);
|
eeconfig_update_haptic(haptic_config.raw);
|
||||||
}
|
}
|
||||||
@ -214,16 +213,36 @@ void haptic_play(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool process_haptic(uint16_t keycode, keyrecord_t *record) {
|
bool process_haptic(uint16_t keycode, keyrecord_t *record) {
|
||||||
if (keycode == HPT_ON && record->event.pressed) { haptic_enable(); }
|
if (keycode == HPT_ON && record->event.pressed) {
|
||||||
if (keycode == HPT_OFF && record->event.pressed) { haptic_disable(); }
|
haptic_enable();
|
||||||
if (keycode == HPT_TOG && record->event.pressed) { haptic_toggle(); }
|
}
|
||||||
if (keycode == HPT_RST && record->event.pressed) { haptic_reset(); }
|
if (keycode == HPT_OFF && record->event.pressed) {
|
||||||
if (keycode == HPT_FBK && record->event.pressed) { haptic_feedback_toggle(); }
|
haptic_disable();
|
||||||
if (keycode == HPT_BUZ && record->event.pressed) { haptic_buzz_toggle(); }
|
}
|
||||||
if (keycode == HPT_MODI && record->event.pressed) { haptic_mode_increase(); }
|
if (keycode == HPT_TOG && record->event.pressed) {
|
||||||
if (keycode == HPT_MODD && record->event.pressed) { haptic_mode_decrease(); }
|
haptic_toggle();
|
||||||
if (keycode == HPT_DWLI && record->event.pressed) { haptic_dwell_increase(); }
|
}
|
||||||
if (keycode == HPT_DWLD && record->event.pressed) { haptic_dwell_decrease(); }
|
if (keycode == HPT_RST && record->event.pressed) {
|
||||||
|
haptic_reset();
|
||||||
|
}
|
||||||
|
if (keycode == HPT_FBK && record->event.pressed) {
|
||||||
|
haptic_feedback_toggle();
|
||||||
|
}
|
||||||
|
if (keycode == HPT_BUZ && record->event.pressed) {
|
||||||
|
haptic_buzz_toggle();
|
||||||
|
}
|
||||||
|
if (keycode == HPT_MODI && record->event.pressed) {
|
||||||
|
haptic_mode_increase();
|
||||||
|
}
|
||||||
|
if (keycode == HPT_MODD && record->event.pressed) {
|
||||||
|
haptic_mode_decrease();
|
||||||
|
}
|
||||||
|
if (keycode == HPT_DWLI && record->event.pressed) {
|
||||||
|
haptic_dwell_increase();
|
||||||
|
}
|
||||||
|
if (keycode == HPT_DWLD && record->event.pressed) {
|
||||||
|
haptic_dwell_decrease();
|
||||||
|
}
|
||||||
if (haptic_config.enable) {
|
if (haptic_config.enable) {
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
// keypress
|
// keypress
|
||||||
@ -244,5 +263,4 @@ void haptic_shutdown(void) {
|
|||||||
#ifdef SOLENOID_ENABLE
|
#ifdef SOLENOID_ENABLE
|
||||||
solenoid_shutdown();
|
solenoid_shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,6 @@
|
|||||||
# include "DRV2605L.h"
|
# include "DRV2605L.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef HAPTIC_FEEDBACK_DEFAULT
|
#ifndef HAPTIC_FEEDBACK_DEFAULT
|
||||||
# define HAPTIC_FEEDBACK_DEFAULT 0
|
# define HAPTIC_FEEDBACK_DEFAULT 0
|
||||||
#endif
|
#endif
|
||||||
@ -75,8 +74,3 @@ void haptic_dwell_decrease(void);
|
|||||||
|
|
||||||
void haptic_play(void);
|
void haptic_play(void);
|
||||||
void haptic_shutdown(void);
|
void haptic_shutdown(void);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,19 +26,11 @@ uint8_t solenoid_dwell = SOLENOID_DEFAULT_DWELL;
|
|||||||
|
|
||||||
extern haptic_config_t haptic_config;
|
extern haptic_config_t haptic_config;
|
||||||
|
|
||||||
|
void solenoid_buzz_on(void) { haptic_set_buzz(1); }
|
||||||
|
|
||||||
void solenoid_buzz_on(void) {
|
void solenoid_buzz_off(void) { haptic_set_buzz(0); }
|
||||||
haptic_set_buzz(1);
|
|
||||||
}
|
|
||||||
|
|
||||||
void solenoid_buzz_off(void) {
|
|
||||||
haptic_set_buzz(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void solenoid_set_buzz(int buzz) {
|
|
||||||
haptic_set_buzz(buzz);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
void solenoid_set_buzz(int buzz) { haptic_set_buzz(buzz); }
|
||||||
|
|
||||||
void solenoid_dwell_minus(uint8_t solenoid_dwell) {
|
void solenoid_dwell_minus(uint8_t solenoid_dwell) {
|
||||||
if (solenoid_dwell > 0) solenoid_dwell--;
|
if (solenoid_dwell > 0) solenoid_dwell--;
|
||||||
@ -48,9 +40,7 @@ void solenoid_dwell_plus(uint8_t solenoid_dwell) {
|
|||||||
if (solenoid_dwell < SOLENOID_MAX_DWELL) solenoid_dwell++;
|
if (solenoid_dwell < SOLENOID_MAX_DWELL) solenoid_dwell++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void solenoid_set_dwell(uint8_t dwell) {
|
void solenoid_set_dwell(uint8_t dwell) { solenoid_dwell = dwell; }
|
||||||
solenoid_dwell = dwell;
|
|
||||||
}
|
|
||||||
|
|
||||||
void solenoid_stop(void) {
|
void solenoid_stop(void) {
|
||||||
writePinLow(SOLENOID_PIN);
|
writePinLow(SOLENOID_PIN);
|
||||||
@ -88,8 +78,7 @@ void solenoid_check(void) {
|
|||||||
solenoid_buzzing = true;
|
solenoid_buzzing = true;
|
||||||
writePinHigh(SOLENOID_PIN);
|
writePinHigh(SOLENOID_PIN);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
if (solenoid_buzzing) {
|
if (solenoid_buzzing) {
|
||||||
solenoid_buzzing = false;
|
solenoid_buzzing = false;
|
||||||
writePinLow(SOLENOID_PIN);
|
writePinLow(SOLENOID_PIN);
|
||||||
@ -103,7 +92,4 @@ void solenoid_setup(void) {
|
|||||||
solenoid_fire();
|
solenoid_fire();
|
||||||
}
|
}
|
||||||
|
|
||||||
void solenoid_shutdown(void) {
|
void solenoid_shutdown(void) { writePinLow(SOLENOID_PIN); }
|
||||||
writePinLow(SOLENOID_PIN);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
@ -37,15 +37,13 @@ uint8_t g_twi_transfer_buffer[20];
|
|||||||
uint8_t g_pwm_buffer[18];
|
uint8_t g_pwm_buffer[18];
|
||||||
bool g_pwm_buffer_update_required = false;
|
bool g_pwm_buffer_update_required = false;
|
||||||
|
|
||||||
void IS31FL3218_write_register( uint8_t reg, uint8_t data )
|
void IS31FL3218_write_register(uint8_t reg, uint8_t data) {
|
||||||
{
|
|
||||||
g_twi_transfer_buffer[0] = reg;
|
g_twi_transfer_buffer[0] = reg;
|
||||||
g_twi_transfer_buffer[1] = data;
|
g_twi_transfer_buffer[1] = data;
|
||||||
i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3218_write_pwm_buffer( uint8_t *pwm_buffer )
|
void IS31FL3218_write_pwm_buffer(uint8_t *pwm_buffer) {
|
||||||
{
|
|
||||||
g_twi_transfer_buffer[0] = ISSI_REG_PWM;
|
g_twi_transfer_buffer[0] = ISSI_REG_PWM;
|
||||||
for (int i = 0; i < 18; i++) {
|
for (int i = 0; i < 18; i++) {
|
||||||
g_twi_transfer_buffer[1 + i] = pwm_buffer[i];
|
g_twi_transfer_buffer[1 + i] = pwm_buffer[i];
|
||||||
@ -54,8 +52,7 @@ void IS31FL3218_write_pwm_buffer( uint8_t *pwm_buffer )
|
|||||||
i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 19, ISSI_TIMEOUT);
|
i2c_transmit(ISSI_ADDRESS, g_twi_transfer_buffer, 19, ISSI_TIMEOUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3218_init(void)
|
void IS31FL3218_init(void) {
|
||||||
{
|
|
||||||
// In case we ever want to reinitialize (?)
|
// In case we ever want to reinitialize (?)
|
||||||
IS31FL3218_write_register(ISSI_REG_RESET, 0x00);
|
IS31FL3218_write_register(ISSI_REG_RESET, 0x00);
|
||||||
|
|
||||||
@ -76,23 +73,20 @@ void IS31FL3218_init(void)
|
|||||||
IS31FL3218_write_register(ISSI_REG_UPDATE, 0x01);
|
IS31FL3218_write_register(ISSI_REG_UPDATE, 0x01);
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3218_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3218_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
|
||||||
g_pwm_buffer[index * 3 + 0] = red;
|
g_pwm_buffer[index * 3 + 0] = red;
|
||||||
g_pwm_buffer[index * 3 + 1] = green;
|
g_pwm_buffer[index * 3 + 1] = green;
|
||||||
g_pwm_buffer[index * 3 + 2] = blue;
|
g_pwm_buffer[index * 3 + 2] = blue;
|
||||||
g_pwm_buffer_update_required = true;
|
g_pwm_buffer_update_required = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3218_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3218_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
|
||||||
for (int i = 0; i < 6; i++) {
|
for (int i = 0; i < 6; i++) {
|
||||||
IS31FL3218_set_color(i, red, green, blue);
|
IS31FL3218_set_color(i, red, green, blue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3218_update_pwm_buffers(void)
|
void IS31FL3218_update_pwm_buffers(void) {
|
||||||
{
|
|
||||||
if (g_pwm_buffer_update_required) {
|
if (g_pwm_buffer_update_required) {
|
||||||
IS31FL3218_write_pwm_buffer(g_pwm_buffer);
|
IS31FL3218_write_pwm_buffer(g_pwm_buffer);
|
||||||
// Load PWM registers and LED Control register data
|
// Load PWM registers and LED Control register data
|
||||||
|
@ -103,7 +103,6 @@ bool g_led_control_registers_update_required = false;
|
|||||||
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
||||||
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
||||||
|
|
||||||
|
|
||||||
void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||||
g_twi_transfer_buffer[0] = reg;
|
g_twi_transfer_buffer[0] = reg;
|
||||||
g_twi_transfer_buffer[1] = data;
|
g_twi_transfer_buffer[1] = data;
|
||||||
@ -138,8 +137,7 @@ void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
|
|||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||||
@ -196,7 +194,6 @@ void IS31FL3731_init(uint8_t addr) {
|
|||||||
// most usage after initialization is just writing PWM buffers in bank 0
|
// most usage after initialization is just writing PWM buffers in bank 0
|
||||||
// as there's not much point in double-buffering
|
// as there's not much point in double-buffering
|
||||||
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_set_value(int index, uint8_t value) {
|
void IS31FL3731_set_value(int index, uint8_t value) {
|
||||||
|
@ -16,11 +16,9 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef IS31FL3731_DRIVER_H
|
#ifndef IS31FL3731_DRIVER_H
|
||||||
#define IS31FL3731_DRIVER_H
|
#define IS31FL3731_DRIVER_H
|
||||||
|
|
||||||
|
|
||||||
typedef struct is31_led {
|
typedef struct is31_led {
|
||||||
uint8_t driver : 2;
|
uint8_t driver : 2;
|
||||||
uint8_t v;
|
uint8_t v;
|
||||||
@ -206,5 +204,4 @@ void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index);
|
|||||||
#define C9_15 0xB2
|
#define C9_15 0xB2
|
||||||
#define C9_16 0xB3
|
#define C9_16 0xB3
|
||||||
|
|
||||||
|
|
||||||
#endif // IS31FL3731_DRIVER_H
|
#endif // IS31FL3731_DRIVER_H
|
||||||
|
@ -90,24 +90,20 @@ bool g_led_control_registers_update_required[DRIVER_COUNT] = { false };
|
|||||||
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
// 0x0E - R17,G15,G14,G13,G12,G11,G10,G09
|
||||||
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
// 0x10 - R16,R15,R14,R13,R12,R11,R10,R09
|
||||||
|
|
||||||
|
void IS31FL3731_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||||
void IS31FL3731_write_register( uint8_t addr, uint8_t reg, uint8_t data )
|
|
||||||
{
|
|
||||||
g_twi_transfer_buffer[0] = reg;
|
g_twi_transfer_buffer[0] = reg;
|
||||||
g_twi_transfer_buffer[1] = data;
|
g_twi_transfer_buffer[1] = data;
|
||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
void IS31FL3731_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
|
||||||
{
|
|
||||||
// assumes bank is already selected
|
// assumes bank is already selected
|
||||||
|
|
||||||
// transmit PWM registers in 9 transfers of 16 bytes
|
// transmit PWM registers in 9 transfers of 16 bytes
|
||||||
@ -126,8 +122,7 @@ void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||||
@ -135,8 +130,7 @@ void IS31FL3731_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_init( uint8_t addr )
|
void IS31FL3731_init(uint8_t addr) {
|
||||||
{
|
|
||||||
// In order to avoid the LEDs being driven with garbage data
|
// In order to avoid the LEDs being driven with garbage data
|
||||||
// in the LED driver's PWM registers, first enable software shutdown,
|
// in the LED driver's PWM registers, first enable software shutdown,
|
||||||
// then set up the mode and other settings, clear the PWM registers,
|
// then set up the mode and other settings, clear the PWM registers,
|
||||||
@ -165,20 +159,17 @@ void IS31FL3731_init( uint8_t addr )
|
|||||||
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
||||||
|
|
||||||
// turn off all LEDs in the LED control register
|
// turn off all LEDs in the LED control register
|
||||||
for ( int i = 0x00; i <= 0x11; i++ )
|
for (int i = 0x00; i <= 0x11; i++) {
|
||||||
{
|
|
||||||
IS31FL3731_write_register(addr, i, 0x00);
|
IS31FL3731_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
// turn off all LEDs in the blink control register (not really needed)
|
// turn off all LEDs in the blink control register (not really needed)
|
||||||
for ( int i = 0x12; i <= 0x23; i++ )
|
for (int i = 0x12; i <= 0x23; i++) {
|
||||||
{
|
|
||||||
IS31FL3731_write_register(addr, i, 0x00);
|
IS31FL3731_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
// set PWM on all LEDs to 0
|
// set PWM on all LEDs to 0
|
||||||
for ( int i = 0x24; i <= 0xB3; i++ )
|
for (int i = 0x24; i <= 0xB3; i++) {
|
||||||
{
|
|
||||||
IS31FL3731_write_register(addr, i, 0x00);
|
IS31FL3731_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,11 +183,9 @@ void IS31FL3731_init( uint8_t addr )
|
|||||||
// most usage after initialization is just writing PWM buffers in bank 0
|
// most usage after initialization is just writing PWM buffers in bank 0
|
||||||
// as there's not much point in double-buffering
|
// as there's not much point in double-buffering
|
||||||
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
IS31FL3731_write_register(addr, ISSI_COMMANDREGISTER, 0);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3731_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
|
||||||
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
@ -208,16 +197,13 @@ void IS31FL3731_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3731_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||||
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
|
|
||||||
{
|
|
||||||
IS31FL3731_set_color(i, red, green, blue);
|
IS31FL3731_set_color(i, red, green, blue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
|
void IS31FL3731_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
|
||||||
{
|
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
uint8_t control_register_r = (led.r - 0x24) / 8;
|
uint8_t control_register_r = (led.r - 0x24) / 8;
|
||||||
@ -244,24 +230,18 @@ void IS31FL3731_set_led_control_register( uint8_t index, bool red, bool green, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_led_control_registers_update_required[led.driver] = true;
|
g_led_control_registers_update_required[led.driver] = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_update_pwm_buffers( uint8_t addr, uint8_t index )
|
void IS31FL3731_update_pwm_buffers(uint8_t addr, uint8_t index) {
|
||||||
{
|
if (g_pwm_buffer_update_required[index]) {
|
||||||
if ( g_pwm_buffer_update_required[index] )
|
|
||||||
{
|
|
||||||
IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
|
IS31FL3731_write_pwm_buffer(addr, g_pwm_buffer[index]);
|
||||||
}
|
}
|
||||||
g_pwm_buffer_update_required[index] = false;
|
g_pwm_buffer_update_required[index] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3731_update_led_control_registers( uint8_t addr, uint8_t index )
|
void IS31FL3731_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||||
{
|
if (g_led_control_registers_update_required[index]) {
|
||||||
if ( g_led_control_registers_update_required[index] )
|
for (int i = 0; i < 18; i++) {
|
||||||
{
|
|
||||||
for ( int i=0; i<18; i++ )
|
|
||||||
{
|
|
||||||
IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]);
|
IS31FL3731_write_register(addr, i, g_led_control_registers[index][i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef IS31FL3731_DRIVER_H
|
#ifndef IS31FL3731_DRIVER_H
|
||||||
#define IS31FL3731_DRIVER_H
|
#define IS31FL3731_DRIVER_H
|
||||||
|
|
||||||
@ -209,6 +208,4 @@ void IS31FL3731_update_led_control_registers( uint8_t addr, uint8_t index );
|
|||||||
#define C9_15 0xB2
|
#define C9_15 0xB2
|
||||||
#define C9_16 0xB3
|
#define C9_16 0xB3
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // IS31FL3731_DRIVER_H
|
#endif // IS31FL3731_DRIVER_H
|
||||||
|
@ -80,23 +80,20 @@ bool g_pwm_buffer_update_required[DRIVER_COUNT] = { false };
|
|||||||
uint8_t g_led_control_registers[DRIVER_COUNT][24] = {{0}, {0}};
|
uint8_t g_led_control_registers[DRIVER_COUNT][24] = {{0}, {0}};
|
||||||
bool g_led_control_registers_update_required[DRIVER_COUNT] = {false};
|
bool g_led_control_registers_update_required[DRIVER_COUNT] = {false};
|
||||||
|
|
||||||
void IS31FL3733_write_register( uint8_t addr, uint8_t reg, uint8_t data )
|
void IS31FL3733_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||||
{
|
|
||||||
g_twi_transfer_buffer[0] = reg;
|
g_twi_transfer_buffer[0] = reg;
|
||||||
g_twi_transfer_buffer[1] = data;
|
g_twi_transfer_buffer[1] = data;
|
||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
void IS31FL3733_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
|
||||||
{
|
|
||||||
// assumes PG1 is already selected
|
// assumes PG1 is already selected
|
||||||
|
|
||||||
// transmit PWM registers in 12 transfers of 16 bytes
|
// transmit PWM registers in 12 transfers of 16 bytes
|
||||||
@ -114,8 +111,7 @@ void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||||
@ -123,8 +119,7 @@ void IS31FL3733_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3733_init( uint8_t addr, uint8_t sync)
|
void IS31FL3733_init(uint8_t addr, uint8_t sync) {
|
||||||
{
|
|
||||||
// In order to avoid the LEDs being driven with garbage data
|
// In order to avoid the LEDs being driven with garbage data
|
||||||
// in the LED driver's PWM registers, shutdown is enabled last.
|
// in the LED driver's PWM registers, shutdown is enabled last.
|
||||||
// Set up the mode and other settings, clear the PWM registers,
|
// Set up the mode and other settings, clear the PWM registers,
|
||||||
@ -137,8 +132,7 @@ void IS31FL3733_init( uint8_t addr, uint8_t sync)
|
|||||||
// Select PG0
|
// Select PG0
|
||||||
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
||||||
// Turn off all LEDs.
|
// Turn off all LEDs.
|
||||||
for ( int i = 0x00; i <= 0x17; i++ )
|
for (int i = 0x00; i <= 0x17; i++) {
|
||||||
{
|
|
||||||
IS31FL3733_write_register(addr, i, 0x00);
|
IS31FL3733_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,8 +143,7 @@ void IS31FL3733_init( uint8_t addr, uint8_t sync)
|
|||||||
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
||||||
// Set PWM on all LEDs to 0
|
// Set PWM on all LEDs to 0
|
||||||
// No need to setup Breath registers to PWM as that is the default.
|
// No need to setup Breath registers to PWM as that is the default.
|
||||||
for ( int i = 0x00; i <= 0xBF; i++ )
|
for (int i = 0x00; i <= 0xBF; i++) {
|
||||||
{
|
|
||||||
IS31FL3733_write_register(addr, i, 0x00);
|
IS31FL3733_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +165,7 @@ void IS31FL3733_init( uint8_t addr, uint8_t sync)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3733_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3733_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
|
||||||
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
@ -184,16 +176,13 @@ void IS31FL3733_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3733_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3733_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||||
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
|
|
||||||
{
|
|
||||||
IS31FL3733_set_color(i, red, green, blue);
|
IS31FL3733_set_color(i, red, green, blue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
|
void IS31FL3733_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
|
||||||
{
|
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
uint8_t control_register_r = led.r / 8;
|
uint8_t control_register_r = led.r / 8;
|
||||||
@ -220,13 +209,10 @@ void IS31FL3733_set_led_control_register( uint8_t index, bool red, bool green, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_led_control_registers_update_required[led.driver] = true;
|
g_led_control_registers_update_required[led.driver] = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3733_update_pwm_buffers( uint8_t addr, uint8_t index )
|
void IS31FL3733_update_pwm_buffers(uint8_t addr, uint8_t index) {
|
||||||
{
|
if (g_pwm_buffer_update_required[index]) {
|
||||||
if ( g_pwm_buffer_update_required[index] )
|
|
||||||
{
|
|
||||||
// Firstly we need to unlock the command register and select PG1
|
// Firstly we need to unlock the command register and select PG1
|
||||||
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
||||||
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
||||||
@ -236,15 +222,12 @@ void IS31FL3733_update_pwm_buffers( uint8_t addr, uint8_t index )
|
|||||||
g_pwm_buffer_update_required[index] = false;
|
g_pwm_buffer_update_required[index] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3733_update_led_control_registers( uint8_t addr, uint8_t index )
|
void IS31FL3733_update_led_control_registers(uint8_t addr, uint8_t index) {
|
||||||
{
|
if (g_led_control_registers_update_required[index]) {
|
||||||
if ( g_led_control_registers_update_required[index] )
|
|
||||||
{
|
|
||||||
// Firstly we need to unlock the command register and select PG0
|
// Firstly we need to unlock the command register and select PG0
|
||||||
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
||||||
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
IS31FL3733_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
||||||
for ( int i=0; i<24; i++ )
|
for (int i = 0; i < 24; i++) {
|
||||||
{
|
|
||||||
IS31FL3733_write_register(addr, i, g_led_control_registers[index][i]);
|
IS31FL3733_write_register(addr, i, g_led_control_registers[index][i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef IS31FL3733_DRIVER_H
|
#ifndef IS31FL3733_DRIVER_H
|
||||||
#define IS31FL3733_DRIVER_H
|
#define IS31FL3733_DRIVER_H
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifdef __AVR__
|
#ifdef __AVR__
|
||||||
# include <avr/interrupt.h>
|
# include <avr/interrupt.h>
|
||||||
# include <avr/io.h>
|
# include <avr/io.h>
|
||||||
@ -28,8 +27,6 @@
|
|||||||
#include "i2c_master.h"
|
#include "i2c_master.h"
|
||||||
#include "progmem.h"
|
#include "progmem.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// This is a 7-bit address, that gets left-shifted and bit 0
|
// This is a 7-bit address, that gets left-shifted and bit 0
|
||||||
// set to 0 for write, 1 for read (as per I2C protocol)
|
// set to 0 for write, 1 for read (as per I2C protocol)
|
||||||
// The address will vary depending on your wiring:
|
// The address will vary depending on your wiring:
|
||||||
@ -81,23 +78,20 @@ bool g_pwm_buffer_update_required = false;
|
|||||||
uint8_t g_led_control_registers[DRIVER_COUNT][24] = {{0}, {0}};
|
uint8_t g_led_control_registers[DRIVER_COUNT][24] = {{0}, {0}};
|
||||||
bool g_led_control_registers_update_required = false;
|
bool g_led_control_registers_update_required = false;
|
||||||
|
|
||||||
void IS31FL3736_write_register( uint8_t addr, uint8_t reg, uint8_t data )
|
void IS31FL3736_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||||
{
|
|
||||||
g_twi_transfer_buffer[0] = reg;
|
g_twi_transfer_buffer[0] = reg;
|
||||||
g_twi_transfer_buffer[1] = data;
|
g_twi_transfer_buffer[1] = data;
|
||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
void IS31FL3736_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
|
||||||
{
|
|
||||||
// assumes PG1 is already selected
|
// assumes PG1 is already selected
|
||||||
|
|
||||||
// transmit PWM registers in 12 transfers of 16 bytes
|
// transmit PWM registers in 12 transfers of 16 bytes
|
||||||
@ -115,8 +109,7 @@ void IS31FL3736_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||||
@ -124,8 +117,7 @@ void IS31FL3736_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_init( uint8_t addr )
|
void IS31FL3736_init(uint8_t addr) {
|
||||||
{
|
|
||||||
// In order to avoid the LEDs being driven with garbage data
|
// In order to avoid the LEDs being driven with garbage data
|
||||||
// in the LED driver's PWM registers, shutdown is enabled last.
|
// in the LED driver's PWM registers, shutdown is enabled last.
|
||||||
// Set up the mode and other settings, clear the PWM registers,
|
// Set up the mode and other settings, clear the PWM registers,
|
||||||
@ -137,8 +129,7 @@ void IS31FL3736_init( uint8_t addr )
|
|||||||
// Select PG0
|
// Select PG0
|
||||||
IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
||||||
// Turn off all LEDs.
|
// Turn off all LEDs.
|
||||||
for ( int i = 0x00; i <= 0x17; i++ )
|
for (int i = 0x00; i <= 0x17; i++) {
|
||||||
{
|
|
||||||
IS31FL3736_write_register(addr, i, 0x00);
|
IS31FL3736_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,8 +140,7 @@ void IS31FL3736_init( uint8_t addr )
|
|||||||
IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
IS31FL3736_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
||||||
// Set PWM on all LEDs to 0
|
// Set PWM on all LEDs to 0
|
||||||
// No need to setup Breath registers to PWM as that is the default.
|
// No need to setup Breath registers to PWM as that is the default.
|
||||||
for ( int i = 0x00; i <= 0xBF; i++ )
|
for (int i = 0x00; i <= 0xBF; i++) {
|
||||||
{
|
|
||||||
IS31FL3736_write_register(addr, i, 0x00);
|
IS31FL3736_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +162,7 @@ void IS31FL3736_init( uint8_t addr )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3736_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
|
||||||
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
@ -184,16 +173,13 @@ void IS31FL3736_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3736_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||||
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
|
|
||||||
{
|
|
||||||
IS31FL3736_set_color(i, red, green, blue);
|
IS31FL3736_set_color(i, red, green, blue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
|
void IS31FL3736_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
|
||||||
{
|
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
// IS31FL3733
|
// IS31FL3733
|
||||||
@ -234,11 +220,9 @@ void IS31FL3736_set_led_control_register( uint8_t index, bool red, bool green, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_led_control_registers_update_required = true;
|
g_led_control_registers_update_required = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_mono_set_brightness( int index, uint8_t value )
|
void IS31FL3736_mono_set_brightness(int index, uint8_t value) {
|
||||||
{
|
|
||||||
if (index >= 0 && index < 96) {
|
if (index >= 0 && index < 96) {
|
||||||
// Index in range 0..95 -> A1..A8, B1..B8, etc.
|
// Index in range 0..95 -> A1..A8, B1..B8, etc.
|
||||||
// Map index 0..95 to registers 0x00..0xBE (interleaved)
|
// Map index 0..95 to registers 0x00..0xBE (interleaved)
|
||||||
@ -248,16 +232,13 @@ void IS31FL3736_mono_set_brightness( int index, uint8_t value )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_mono_set_brightness_all( uint8_t value )
|
void IS31FL3736_mono_set_brightness_all(uint8_t value) {
|
||||||
{
|
for (int i = 0; i < 96; i++) {
|
||||||
for ( int i = 0; i < 96; i++ )
|
|
||||||
{
|
|
||||||
IS31FL3736_mono_set_brightness(i, value);
|
IS31FL3736_mono_set_brightness(i, value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_mono_set_led_control_register( uint8_t index, bool enabled )
|
void IS31FL3736_mono_set_led_control_register(uint8_t index, bool enabled) {
|
||||||
{
|
|
||||||
// Index in range 0..95 -> A1..A8, B1..B8, etc.
|
// Index in range 0..95 -> A1..A8, B1..B8, etc.
|
||||||
|
|
||||||
// Map index 0..95 to registers 0x00..0xBE (interleaved)
|
// Map index 0..95 to registers 0x00..0xBE (interleaved)
|
||||||
@ -275,10 +256,8 @@ void IS31FL3736_mono_set_led_control_register( uint8_t index, bool enabled )
|
|||||||
g_led_control_registers_update_required = true;
|
g_led_control_registers_update_required = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
|
void IS31FL3736_update_pwm_buffers(uint8_t addr1, uint8_t addr2) {
|
||||||
{
|
if (g_pwm_buffer_update_required) {
|
||||||
if ( g_pwm_buffer_update_required )
|
|
||||||
{
|
|
||||||
// Firstly we need to unlock the command register and select PG1
|
// Firstly we need to unlock the command register and select PG1
|
||||||
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
||||||
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
||||||
@ -289,18 +268,14 @@ void IS31FL3736_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
|
|||||||
g_pwm_buffer_update_required = false;
|
g_pwm_buffer_update_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3736_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
|
void IS31FL3736_update_led_control_registers(uint8_t addr1, uint8_t addr2) {
|
||||||
{
|
if (g_led_control_registers_update_required) {
|
||||||
if ( g_led_control_registers_update_required )
|
|
||||||
{
|
|
||||||
// Firstly we need to unlock the command register and select PG0
|
// Firstly we need to unlock the command register and select PG0
|
||||||
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
||||||
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
IS31FL3736_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
||||||
for ( int i=0; i<24; i++ )
|
for (int i = 0; i < 24; i++) {
|
||||||
{
|
|
||||||
IS31FL3736_write_register(addr1, i, g_led_control_registers[0][i]);
|
IS31FL3736_write_register(addr1, i, g_led_control_registers[0][i]);
|
||||||
// IS31FL3736_write_register(addr2, i, g_led_control_registers[1][i] );
|
// IS31FL3736_write_register(addr2, i, g_led_control_registers[1][i] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,11 +19,9 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
|
||||||
// Simple interface option.
|
// Simple interface option.
|
||||||
// If these aren't defined, just define them to make it compile
|
// If these aren't defined, just define them to make it compile
|
||||||
|
|
||||||
|
|
||||||
#ifndef DRIVER_COUNT
|
#ifndef DRIVER_COUNT
|
||||||
# define DRIVER_COUNT 2
|
# define DRIVER_COUNT 2
|
||||||
#endif
|
#endif
|
||||||
@ -32,7 +30,6 @@
|
|||||||
# define DRIVER_LED_TOTAL 96
|
# define DRIVER_LED_TOTAL 96
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
typedef struct is31_led {
|
typedef struct is31_led {
|
||||||
uint8_t driver : 2;
|
uint8_t driver : 2;
|
||||||
uint8_t r;
|
uint8_t r;
|
||||||
@ -169,4 +166,3 @@ void IS31FL3736_update_led_control_registers( uint8_t addr1, uint8_t addr2 );
|
|||||||
#define L_6 0xBA
|
#define L_6 0xBA
|
||||||
#define L_7 0xBC
|
#define L_7 0xBC
|
||||||
#define L_8 0xBE
|
#define L_8 0xBE
|
||||||
|
|
||||||
|
@ -80,23 +80,20 @@ bool g_pwm_buffer_update_required = false;
|
|||||||
uint8_t g_led_control_registers[DRIVER_COUNT][24] = {{0}};
|
uint8_t g_led_control_registers[DRIVER_COUNT][24] = {{0}};
|
||||||
bool g_led_control_registers_update_required = false;
|
bool g_led_control_registers_update_required = false;
|
||||||
|
|
||||||
void IS31FL3737_write_register( uint8_t addr, uint8_t reg, uint8_t data )
|
void IS31FL3737_write_register(uint8_t addr, uint8_t reg, uint8_t data) {
|
||||||
{
|
|
||||||
g_twi_transfer_buffer[0] = reg;
|
g_twi_transfer_buffer[0] = reg;
|
||||||
g_twi_transfer_buffer[1] = data;
|
g_twi_transfer_buffer[1] = data;
|
||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 2, ISSI_TIMEOUT);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
void IS31FL3737_write_pwm_buffer(uint8_t addr, uint8_t *pwm_buffer) {
|
||||||
{
|
|
||||||
// assumes PG1 is already selected
|
// assumes PG1 is already selected
|
||||||
|
|
||||||
// transmit PWM registers in 12 transfers of 16 bytes
|
// transmit PWM registers in 12 transfers of 16 bytes
|
||||||
@ -114,8 +111,7 @@ void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
|
|
||||||
#if ISSI_PERSISTENCE > 0
|
#if ISSI_PERSISTENCE > 0
|
||||||
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
for (uint8_t i = 0; i < ISSI_PERSISTENCE; i++) {
|
||||||
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0)
|
if (i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT) == 0) break;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
i2c_transmit(addr << 1, g_twi_transfer_buffer, 17, ISSI_TIMEOUT);
|
||||||
@ -123,8 +119,7 @@ void IS31FL3737_write_pwm_buffer( uint8_t addr, uint8_t *pwm_buffer )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3737_init( uint8_t addr )
|
void IS31FL3737_init(uint8_t addr) {
|
||||||
{
|
|
||||||
// In order to avoid the LEDs being driven with garbage data
|
// In order to avoid the LEDs being driven with garbage data
|
||||||
// in the LED driver's PWM registers, shutdown is enabled last.
|
// in the LED driver's PWM registers, shutdown is enabled last.
|
||||||
// Set up the mode and other settings, clear the PWM registers,
|
// Set up the mode and other settings, clear the PWM registers,
|
||||||
@ -136,8 +131,7 @@ void IS31FL3737_init( uint8_t addr )
|
|||||||
// Select PG0
|
// Select PG0
|
||||||
IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
||||||
// Turn off all LEDs.
|
// Turn off all LEDs.
|
||||||
for ( int i = 0x00; i <= 0x17; i++ )
|
for (int i = 0x00; i <= 0x17; i++) {
|
||||||
{
|
|
||||||
IS31FL3737_write_register(addr, i, 0x00);
|
IS31FL3737_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -148,8 +142,7 @@ void IS31FL3737_init( uint8_t addr )
|
|||||||
IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
IS31FL3737_write_register(addr, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
||||||
// Set PWM on all LEDs to 0
|
// Set PWM on all LEDs to 0
|
||||||
// No need to setup Breath registers to PWM as that is the default.
|
// No need to setup Breath registers to PWM as that is the default.
|
||||||
for ( int i = 0x00; i <= 0xBF; i++ )
|
for (int i = 0x00; i <= 0xBF; i++) {
|
||||||
{
|
|
||||||
IS31FL3737_write_register(addr, i, 0x00);
|
IS31FL3737_write_register(addr, i, 0x00);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,8 +164,7 @@ void IS31FL3737_init( uint8_t addr )
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3737_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
|
||||||
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
if (index >= 0 && index < DRIVER_LED_TOTAL) {
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
@ -183,16 +175,13 @@ void IS31FL3737_set_color( int index, uint8_t red, uint8_t green, uint8_t blue )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3737_set_color_all( uint8_t red, uint8_t green, uint8_t blue )
|
void IS31FL3737_set_color_all(uint8_t red, uint8_t green, uint8_t blue) {
|
||||||
{
|
for (int i = 0; i < DRIVER_LED_TOTAL; i++) {
|
||||||
for ( int i = 0; i < DRIVER_LED_TOTAL; i++ )
|
|
||||||
{
|
|
||||||
IS31FL3737_set_color(i, red, green, blue);
|
IS31FL3737_set_color(i, red, green, blue);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, bool blue )
|
void IS31FL3737_set_led_control_register(uint8_t index, bool red, bool green, bool blue) {
|
||||||
{
|
|
||||||
is31_led led = g_is31_leds[index];
|
is31_led led = g_is31_leds[index];
|
||||||
|
|
||||||
uint8_t control_register_r = led.r / 8;
|
uint8_t control_register_r = led.r / 8;
|
||||||
@ -219,13 +208,10 @@ void IS31FL3737_set_led_control_register( uint8_t index, bool red, bool green, b
|
|||||||
}
|
}
|
||||||
|
|
||||||
g_led_control_registers_update_required = true;
|
g_led_control_registers_update_required = true;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
|
void IS31FL3737_update_pwm_buffers(uint8_t addr1, uint8_t addr2) {
|
||||||
{
|
if (g_pwm_buffer_update_required) {
|
||||||
if ( g_pwm_buffer_update_required )
|
|
||||||
{
|
|
||||||
// Firstly we need to unlock the command register and select PG1
|
// Firstly we need to unlock the command register and select PG1
|
||||||
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
||||||
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_PWM);
|
||||||
@ -236,15 +222,12 @@ void IS31FL3737_update_pwm_buffers( uint8_t addr1, uint8_t addr2 )
|
|||||||
g_pwm_buffer_update_required = false;
|
g_pwm_buffer_update_required = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void IS31FL3737_update_led_control_registers( uint8_t addr1, uint8_t addr2 )
|
void IS31FL3737_update_led_control_registers(uint8_t addr1, uint8_t addr2) {
|
||||||
{
|
if (g_led_control_registers_update_required) {
|
||||||
if ( g_led_control_registers_update_required )
|
|
||||||
{
|
|
||||||
// Firstly we need to unlock the command register and select PG0
|
// Firstly we need to unlock the command register and select PG0
|
||||||
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER_WRITELOCK, 0xC5);
|
||||||
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
IS31FL3737_write_register(addr1, ISSI_COMMANDREGISTER, ISSI_PAGE_LEDCONTROL);
|
||||||
for ( int i=0; i<24; i++ )
|
for (int i = 0; i < 24; i++) {
|
||||||
{
|
|
||||||
IS31FL3737_write_register(addr1, i, g_led_control_registers[0][i]);
|
IS31FL3737_write_register(addr1, i, g_led_control_registers[0][i]);
|
||||||
// IS31FL3737_write_register(addr2, i, g_led_control_registers[1][i] );
|
// IS31FL3737_write_register(addr2, i, g_led_control_registers[1][i] );
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#ifndef IS31FL3737_DRIVER_H
|
#ifndef IS31FL3737_DRIVER_H
|
||||||
#define IS31FL3737_DRIVER_H
|
#define IS31FL3737_DRIVER_H
|
||||||
|
|
||||||
|
@ -13,228 +13,13 @@
|
|||||||
// Online editor: http://teripom.x0.com/
|
// Online editor: http://teripom.x0.com/
|
||||||
|
|
||||||
static const unsigned char font[] PROGMEM = {
|
static const unsigned char font[] PROGMEM = {
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, 0x00, 0x18, 0x3C, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, 0x00, 0x18, 0x24, 0x18, 0x00, 0x00, 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00, 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00, 0x26, 0x29, 0x79, 0x29, 0x26, 0x00, 0x40, 0x7F, 0x05, 0x05, 0x07, 0x00, 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00, 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00, 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x00, 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00, 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, 0x00, 0x66, 0x89, 0x95, 0x6A, 0x00, 0x60, 0x60, 0x60, 0x60, 0x60, 0x00, 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
|
||||||
0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x00,
|
0x10, 0x20, 0x7E, 0x20, 0x10, 0x00, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00, 0x1E, 0x10, 0x10, 0x10, 0x10, 0x00, 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00, 0x30, 0x38, 0x3E, 0x38, 0x30, 0x00, 0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00, 0x23, 0x13, 0x08, 0x64, 0x62, 0x00, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x80, 0x70, 0x30, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x60, 0x60, 0x00, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x00, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
|
||||||
0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x00,
|
0x72, 0x49, 0x49, 0x49, 0x46, 0x00, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x00, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x00, 0x27, 0x45, 0x45, 0x45, 0x39, 0x00, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00, 0x41, 0x21, 0x11, 0x09, 0x07, 0x00, 0x36, 0x49, 0x49, 0x49, 0x36, 0x00, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x41, 0x00, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x00, 0x41, 0x22, 0x14, 0x08, 0x00, 0x02, 0x01, 0x59, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x00, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x00, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
|
||||||
0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x00,
|
0x7F, 0x08, 0x14, 0x22, 0x41, 0x00, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x00, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x00, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x00, 0x26, 0x49, 0x49, 0x49, 0x32, 0x00, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x00, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00, 0x63, 0x14, 0x08, 0x14, 0x63, 0x00, 0x03, 0x04, 0x78, 0x04, 0x03, 0x00, 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x04, 0x02, 0x01, 0x02, 0x04, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x03, 0x07, 0x08, 0x00, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x00, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x00, 0x38, 0x44, 0x44, 0x44, 0x28, 0x00,
|
||||||
0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x00,
|
0x38, 0x44, 0x44, 0x28, 0x7F, 0x00, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x00, 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0xFC, 0x18, 0x24, 0x24, 0x18, 0x00, 0x18, 0x24, 0x24, 0x18, 0xFC, 0x00, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x00, 0x48, 0x54, 0x54, 0x54, 0x24, 0x00, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x00, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00, 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00,
|
||||||
0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x00,
|
0x00, 0x41, 0x36, 0x08, 0x00, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x00, 0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F, 0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xF0, 0xF8, 0xFC, 0x3E,
|
||||||
0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00,
|
0x1E, 0x06, 0x01, 0x00, 0x00, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B, 0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00, 0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE, 0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF, 0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00, 0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF, 0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, 0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00, 0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E, 0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F, 0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F, 0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E, 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E, 0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F,
|
||||||
0x00, 0x18, 0x3C, 0x18, 0x00, 0x00,
|
0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70, 0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49, 0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69, 0x69, 0x6F, 0x26, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x3F, 0x3C, 0x78, 0x70, 0x60, 0x00, 0x00, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00, 0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20, 0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00, 0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F, 0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E, 0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x07, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x18, 0x24, 0x18, 0x00, 0x00,
|
|
||||||
0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x00,
|
|
||||||
0x30, 0x48, 0x3A, 0x06, 0x0E, 0x00,
|
|
||||||
0x26, 0x29, 0x79, 0x29, 0x26, 0x00,
|
|
||||||
0x40, 0x7F, 0x05, 0x05, 0x07, 0x00,
|
|
||||||
0x40, 0x7F, 0x05, 0x25, 0x3F, 0x00,
|
|
||||||
0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x00,
|
|
||||||
0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x00,
|
|
||||||
0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x00,
|
|
||||||
0x14, 0x22, 0x7F, 0x22, 0x14, 0x00,
|
|
||||||
0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x00,
|
|
||||||
0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00,
|
|
||||||
0x00, 0x66, 0x89, 0x95, 0x6A, 0x00,
|
|
||||||
0x60, 0x60, 0x60, 0x60, 0x60, 0x00,
|
|
||||||
0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x00,
|
|
||||||
0x08, 0x04, 0x7E, 0x04, 0x08, 0x00,
|
|
||||||
0x10, 0x20, 0x7E, 0x20, 0x10, 0x00,
|
|
||||||
0x08, 0x08, 0x2A, 0x1C, 0x08, 0x00,
|
|
||||||
0x08, 0x1C, 0x2A, 0x08, 0x08, 0x00,
|
|
||||||
0x1E, 0x10, 0x10, 0x10, 0x10, 0x00,
|
|
||||||
0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x00,
|
|
||||||
0x30, 0x38, 0x3E, 0x38, 0x30, 0x00,
|
|
||||||
0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x5F, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x07, 0x00, 0x00,
|
|
||||||
0x14, 0x7F, 0x14, 0x7F, 0x14, 0x00,
|
|
||||||
0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x00,
|
|
||||||
0x23, 0x13, 0x08, 0x64, 0x62, 0x00,
|
|
||||||
0x36, 0x49, 0x56, 0x20, 0x50, 0x00,
|
|
||||||
0x00, 0x08, 0x07, 0x03, 0x00, 0x00,
|
|
||||||
0x00, 0x1C, 0x22, 0x41, 0x00, 0x00,
|
|
||||||
0x00, 0x41, 0x22, 0x1C, 0x00, 0x00,
|
|
||||||
0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x00,
|
|
||||||
0x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
|
|
||||||
0x00, 0x80, 0x70, 0x30, 0x00, 0x00,
|
|
||||||
0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
|
|
||||||
0x00, 0x00, 0x60, 0x60, 0x00, 0x00,
|
|
||||||
0x20, 0x10, 0x08, 0x04, 0x02, 0x00,
|
|
||||||
0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00,
|
|
||||||
0x00, 0x42, 0x7F, 0x40, 0x00, 0x00,
|
|
||||||
0x72, 0x49, 0x49, 0x49, 0x46, 0x00,
|
|
||||||
0x21, 0x41, 0x49, 0x4D, 0x33, 0x00,
|
|
||||||
0x18, 0x14, 0x12, 0x7F, 0x10, 0x00,
|
|
||||||
0x27, 0x45, 0x45, 0x45, 0x39, 0x00,
|
|
||||||
0x3C, 0x4A, 0x49, 0x49, 0x31, 0x00,
|
|
||||||
0x41, 0x21, 0x11, 0x09, 0x07, 0x00,
|
|
||||||
0x36, 0x49, 0x49, 0x49, 0x36, 0x00,
|
|
||||||
0x46, 0x49, 0x49, 0x29, 0x1E, 0x00,
|
|
||||||
0x00, 0x00, 0x14, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x40, 0x34, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x08, 0x14, 0x22, 0x41, 0x00,
|
|
||||||
0x14, 0x14, 0x14, 0x14, 0x14, 0x00,
|
|
||||||
0x00, 0x41, 0x22, 0x14, 0x08, 0x00,
|
|
||||||
0x02, 0x01, 0x59, 0x09, 0x06, 0x00,
|
|
||||||
0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x00,
|
|
||||||
0x7C, 0x12, 0x11, 0x12, 0x7C, 0x00,
|
|
||||||
0x7F, 0x49, 0x49, 0x49, 0x36, 0x00,
|
|
||||||
0x3E, 0x41, 0x41, 0x41, 0x22, 0x00,
|
|
||||||
0x7F, 0x41, 0x41, 0x41, 0x3E, 0x00,
|
|
||||||
0x7F, 0x49, 0x49, 0x49, 0x41, 0x00,
|
|
||||||
0x7F, 0x09, 0x09, 0x09, 0x01, 0x00,
|
|
||||||
0x3E, 0x41, 0x41, 0x51, 0x73, 0x00,
|
|
||||||
0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00,
|
|
||||||
0x00, 0x41, 0x7F, 0x41, 0x00, 0x00,
|
|
||||||
0x20, 0x40, 0x41, 0x3F, 0x01, 0x00,
|
|
||||||
0x7F, 0x08, 0x14, 0x22, 0x41, 0x00,
|
|
||||||
0x7F, 0x40, 0x40, 0x40, 0x40, 0x00,
|
|
||||||
0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x00,
|
|
||||||
0x7F, 0x04, 0x08, 0x10, 0x7F, 0x00,
|
|
||||||
0x3E, 0x41, 0x41, 0x41, 0x3E, 0x00,
|
|
||||||
0x7F, 0x09, 0x09, 0x09, 0x06, 0x00,
|
|
||||||
0x3E, 0x41, 0x51, 0x21, 0x5E, 0x00,
|
|
||||||
0x7F, 0x09, 0x19, 0x29, 0x46, 0x00,
|
|
||||||
0x26, 0x49, 0x49, 0x49, 0x32, 0x00,
|
|
||||||
0x03, 0x01, 0x7F, 0x01, 0x03, 0x00,
|
|
||||||
0x3F, 0x40, 0x40, 0x40, 0x3F, 0x00,
|
|
||||||
0x1F, 0x20, 0x40, 0x20, 0x1F, 0x00,
|
|
||||||
0x3F, 0x40, 0x38, 0x40, 0x3F, 0x00,
|
|
||||||
0x63, 0x14, 0x08, 0x14, 0x63, 0x00,
|
|
||||||
0x03, 0x04, 0x78, 0x04, 0x03, 0x00,
|
|
||||||
0x61, 0x59, 0x49, 0x4D, 0x43, 0x00,
|
|
||||||
0x00, 0x7F, 0x41, 0x41, 0x41, 0x00,
|
|
||||||
0x02, 0x04, 0x08, 0x10, 0x20, 0x00,
|
|
||||||
0x00, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
|
||||||
0x04, 0x02, 0x01, 0x02, 0x04, 0x00,
|
|
||||||
0x40, 0x40, 0x40, 0x40, 0x40, 0x00,
|
|
||||||
0x00, 0x03, 0x07, 0x08, 0x00, 0x00,
|
|
||||||
0x20, 0x54, 0x54, 0x78, 0x40, 0x00,
|
|
||||||
0x7F, 0x28, 0x44, 0x44, 0x38, 0x00,
|
|
||||||
0x38, 0x44, 0x44, 0x44, 0x28, 0x00,
|
|
||||||
0x38, 0x44, 0x44, 0x28, 0x7F, 0x00,
|
|
||||||
0x38, 0x54, 0x54, 0x54, 0x18, 0x00,
|
|
||||||
0x00, 0x08, 0x7E, 0x09, 0x02, 0x00,
|
|
||||||
0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x00,
|
|
||||||
0x7F, 0x08, 0x04, 0x04, 0x78, 0x00,
|
|
||||||
0x00, 0x44, 0x7D, 0x40, 0x00, 0x00,
|
|
||||||
0x20, 0x40, 0x40, 0x3D, 0x00, 0x00,
|
|
||||||
0x7F, 0x10, 0x28, 0x44, 0x00, 0x00,
|
|
||||||
0x00, 0x41, 0x7F, 0x40, 0x00, 0x00,
|
|
||||||
0x7C, 0x04, 0x78, 0x04, 0x78, 0x00,
|
|
||||||
0x7C, 0x08, 0x04, 0x04, 0x78, 0x00,
|
|
||||||
0x38, 0x44, 0x44, 0x44, 0x38, 0x00,
|
|
||||||
0xFC, 0x18, 0x24, 0x24, 0x18, 0x00,
|
|
||||||
0x18, 0x24, 0x24, 0x18, 0xFC, 0x00,
|
|
||||||
0x7C, 0x08, 0x04, 0x04, 0x08, 0x00,
|
|
||||||
0x48, 0x54, 0x54, 0x54, 0x24, 0x00,
|
|
||||||
0x04, 0x04, 0x3F, 0x44, 0x24, 0x00,
|
|
||||||
0x3C, 0x40, 0x40, 0x20, 0x7C, 0x00,
|
|
||||||
0x1C, 0x20, 0x40, 0x20, 0x1C, 0x00,
|
|
||||||
0x3C, 0x40, 0x30, 0x40, 0x3C, 0x00,
|
|
||||||
0x44, 0x28, 0x10, 0x28, 0x44, 0x00,
|
|
||||||
0x4C, 0x90, 0x90, 0x90, 0x7C, 0x00,
|
|
||||||
0x44, 0x64, 0x54, 0x4C, 0x44, 0x00,
|
|
||||||
0x00, 0x08, 0x36, 0x41, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x77, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x41, 0x36, 0x08, 0x00, 0x00,
|
|
||||||
0x02, 0x01, 0x02, 0x04, 0x02, 0x00,
|
|
||||||
0x3C, 0x26, 0x23, 0x26, 0x3C, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x40, 0x40, 0x40, 0xF0, 0xF8, 0xF8,
|
|
||||||
0xFF, 0x38, 0xFF, 0xF8, 0xF8, 0x3F,
|
|
||||||
0xF8, 0xF8, 0xFF, 0x38, 0xFF, 0xF8,
|
|
||||||
0xF8, 0xF0, 0x40, 0x40, 0x40, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x80,
|
|
||||||
0xC0, 0xC0, 0xC0, 0x80, 0x00, 0x00,
|
|
||||||
0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00,
|
|
||||||
0x80, 0xC0, 0xC0, 0x00, 0xC0, 0xC0,
|
|
||||||
0x00, 0x00, 0x80, 0xC0, 0xC0, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0,
|
|
||||||
0xC0, 0xC0, 0xC0, 0x00, 0xC0, 0xC0,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0xC0, 0xF0, 0xF8, 0xFC, 0x3E,
|
|
||||||
0x1E, 0x06, 0x01, 0x00, 0x00, 0x00,
|
|
||||||
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
|
||||||
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
|
||||||
0x00, 0x80, 0xC0, 0xE0, 0x7E, 0x5B,
|
|
||||||
0x4F, 0x5B, 0xFE, 0xC0, 0x00, 0x00,
|
|
||||||
0xC0, 0x00, 0xDC, 0xD7, 0xDE, 0xDE,
|
|
||||||
0xDE, 0xD7, 0xDC, 0x00, 0xC0, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x49, 0x49, 0x49, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xE0, 0xDF, 0xBF, 0xBF, 0x00,
|
|
||||||
0xBF, 0xBF, 0xDF, 0xE0, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0x49, 0x49, 0x49, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F,
|
|
||||||
0x60, 0x60, 0xE0, 0xBF, 0x1F, 0x00,
|
|
||||||
0x7F, 0x7F, 0x07, 0x1E, 0x38, 0x1E,
|
|
||||||
0x07, 0x7F, 0x7F, 0x00, 0x7F, 0x7F,
|
|
||||||
0x0E, 0x1F, 0x3B, 0x71, 0x60, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x7F, 0x7F,
|
|
||||||
0x0C, 0x0C, 0x0C, 0x00, 0x7E, 0x7E,
|
|
||||||
0x00, 0x7F, 0x7E, 0x03, 0x03, 0x00,
|
|
||||||
0x7F, 0x7E, 0x03, 0x03, 0x7E, 0x7E,
|
|
||||||
0x03, 0x03, 0x7F, 0x7E, 0x00, 0x0F,
|
|
||||||
0x3E, 0x70, 0x3C, 0x06, 0x3C, 0x70,
|
|
||||||
0x3E, 0x0F, 0x00, 0x32, 0x7B, 0x49,
|
|
||||||
0x49, 0x3F, 0x7E, 0x00, 0x7F, 0x7E,
|
|
||||||
0x03, 0x03, 0x00, 0x1E, 0x3F, 0x69,
|
|
||||||
0x69, 0x6F, 0x26, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x03, 0x0F, 0x1F, 0x3F, 0x3C,
|
|
||||||
0x78, 0x70, 0x60, 0x00, 0x00, 0x00,
|
|
||||||
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
|
||||||
0x7F, 0x41, 0x41, 0x41, 0x7F, 0x00,
|
|
||||||
0x30, 0x7B, 0x7F, 0x78, 0x30, 0x20,
|
|
||||||
0x20, 0x30, 0x78, 0x7F, 0x3B, 0x00,
|
|
||||||
0x03, 0x00, 0x0F, 0x7F, 0x0F, 0x0F,
|
|
||||||
0x0F, 0x7F, 0x0F, 0x00, 0x03, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x01, 0x01, 0x01, 0x07, 0x0F, 0x0F,
|
|
||||||
0x7F, 0x0F, 0x7F, 0x0F, 0x0F, 0x7E,
|
|
||||||
0x0F, 0x0F, 0x7F, 0x0F, 0x7F, 0x0F,
|
|
||||||
0x0F, 0x07, 0x01, 0x01, 0x01, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
};
|
};
|
||||||
|
@ -83,7 +83,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
#define CHARGE_PUMP 0x8D
|
#define CHARGE_PUMP 0x8D
|
||||||
|
|
||||||
// Misc defines
|
// Misc defines
|
||||||
#define OLED_TIMEOUT 60000
|
|
||||||
#define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8)
|
#define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8)
|
||||||
#define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT)
|
#define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT)
|
||||||
|
|
||||||
@ -114,8 +113,11 @@ bool oled_active = false;
|
|||||||
bool oled_scrolling = false;
|
bool oled_scrolling = false;
|
||||||
uint8_t oled_rotation = 0;
|
uint8_t oled_rotation = 0;
|
||||||
uint8_t oled_rotation_width = 0;
|
uint8_t oled_rotation_width = 0;
|
||||||
#if !defined(OLED_DISABLE_TIMEOUT)
|
#if OLED_TIMEOUT > 0
|
||||||
uint16_t oled_last_activity;
|
uint32_t oled_timeout;
|
||||||
|
#endif
|
||||||
|
#if OLED_SCROLL_TIMEOUT > 0
|
||||||
|
uint32_t oled_scroll_timeout;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Internal variables to reduce math instructions
|
// Internal variables to reduce math instructions
|
||||||
@ -138,8 +140,7 @@ static i2c_status_t i2c_transmit_P(uint8_t address, const uint8_t* data, uint16_
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Flips the rendering bits for a character at the current cursor position
|
// Flips the rendering bits for a character at the current cursor position
|
||||||
static void InvertCharacter(uint8_t *cursor)
|
static void InvertCharacter(uint8_t *cursor) {
|
||||||
{
|
|
||||||
const uint8_t *end = cursor + OLED_FONT_WIDTH;
|
const uint8_t *end = cursor + OLED_FONT_WIDTH;
|
||||||
while (cursor < end) {
|
while (cursor < end) {
|
||||||
*cursor = ~(*cursor);
|
*cursor = ~(*cursor);
|
||||||
@ -159,14 +160,19 @@ bool oled_init(uint8_t rotation) {
|
|||||||
static const uint8_t PROGMEM display_setup1[] = {
|
static const uint8_t PROGMEM display_setup1[] = {
|
||||||
I2C_CMD,
|
I2C_CMD,
|
||||||
DISPLAY_OFF,
|
DISPLAY_OFF,
|
||||||
DISPLAY_CLOCK, 0x80,
|
DISPLAY_CLOCK,
|
||||||
MULTIPLEX_RATIO, OLED_DISPLAY_HEIGHT - 1,
|
0x80,
|
||||||
DISPLAY_OFFSET, 0x00,
|
MULTIPLEX_RATIO,
|
||||||
|
OLED_DISPLAY_HEIGHT - 1,
|
||||||
|
DISPLAY_OFFSET,
|
||||||
|
0x00,
|
||||||
DISPLAY_START_LINE | 0x00,
|
DISPLAY_START_LINE | 0x00,
|
||||||
CHARGE_PUMP, 0x14,
|
CHARGE_PUMP,
|
||||||
|
0x14,
|
||||||
#if (OLED_IC != OLED_IC_SH1106)
|
#if (OLED_IC != OLED_IC_SH1106)
|
||||||
// MEMORY_MODE is unsupported on SH1106 (Page Addressing only)
|
// MEMORY_MODE is unsupported on SH1106 (Page Addressing only)
|
||||||
MEMORY_MODE, 0x00, // Horizontal addressing mode
|
MEMORY_MODE,
|
||||||
|
0x00, // Horizontal addressing mode
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_setup1) != I2C_STATUS_SUCCESS) {
|
||||||
@ -175,40 +181,32 @@ bool oled_init(uint8_t rotation) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) {
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_180)) {
|
||||||
static const uint8_t PROGMEM display_normal[] = {
|
static const uint8_t PROGMEM display_normal[] = {I2C_CMD, SEGMENT_REMAP_INV, COM_SCAN_DEC};
|
||||||
I2C_CMD,
|
|
||||||
SEGMENT_REMAP_INV,
|
|
||||||
COM_SCAN_DEC };
|
|
||||||
if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_normal) != I2C_STATUS_SUCCESS) {
|
||||||
print("oled_init cmd normal rotation failed\n");
|
print("oled_init cmd normal rotation failed\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
static const uint8_t PROGMEM display_flipped[] = {
|
static const uint8_t PROGMEM display_flipped[] = {I2C_CMD, SEGMENT_REMAP, COM_SCAN_INC};
|
||||||
I2C_CMD,
|
|
||||||
SEGMENT_REMAP,
|
|
||||||
COM_SCAN_INC };
|
|
||||||
if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_flipped) != I2C_STATUS_SUCCESS) {
|
||||||
print("display_flipped failed\n");
|
print("display_flipped failed\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static const uint8_t PROGMEM display_setup2[] = {
|
static const uint8_t PROGMEM display_setup2[] = {I2C_CMD, COM_PINS, OLED_COM_PINS, CONTRAST, 0x8F, PRE_CHARGE_PERIOD, 0xF1, VCOM_DETECT, 0x40, DISPLAY_ALL_ON_RESUME, NORMAL_DISPLAY, DEACTIVATE_SCROLL, DISPLAY_ON};
|
||||||
I2C_CMD,
|
|
||||||
COM_PINS, OLED_COM_PINS,
|
|
||||||
CONTRAST, 0x8F,
|
|
||||||
PRE_CHARGE_PERIOD, 0xF1,
|
|
||||||
VCOM_DETECT, 0x40,
|
|
||||||
DISPLAY_ALL_ON_RESUME,
|
|
||||||
NORMAL_DISPLAY,
|
|
||||||
DEACTIVATE_SCROLL,
|
|
||||||
DISPLAY_ON };
|
|
||||||
if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_setup2) != I2C_STATUS_SUCCESS) {
|
||||||
print("display_setup2 failed\n");
|
print("display_setup2 failed\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if OLED_TIMEOUT > 0
|
||||||
|
oled_timeout = timer_read32() + OLED_TIMEOUT;
|
||||||
|
#endif
|
||||||
|
#if OLED_SCROLL_TIMEOUT > 0
|
||||||
|
oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT;
|
||||||
|
#endif
|
||||||
|
|
||||||
oled_clear();
|
oled_clear();
|
||||||
oled_initialized = true;
|
oled_initialized = true;
|
||||||
oled_active = true;
|
oled_active = true;
|
||||||
@ -216,10 +214,7 @@ bool oled_init(uint8_t rotation) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak))
|
__attribute__((weak)) oled_rotation_t oled_init_user(oled_rotation_t rotation) { return rotation; }
|
||||||
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
|
||||||
return rotation;
|
|
||||||
}
|
|
||||||
|
|
||||||
void oled_clear(void) {
|
void oled_clear(void) {
|
||||||
memset(oled_buffer, 0, sizeof(oled_buffer));
|
memset(oled_buffer, 0, sizeof(oled_buffer));
|
||||||
@ -227,8 +222,7 @@ void oled_clear(void) {
|
|||||||
oled_dirty = -1; // -1 will be max value as long as display_dirty is unsigned type
|
oled_dirty = -1; // -1 will be max value as long as display_dirty is unsigned type
|
||||||
}
|
}
|
||||||
|
|
||||||
static void calc_bounds(uint8_t update_start, uint8_t* cmd_array)
|
static void calc_bounds(uint8_t update_start, uint8_t *cmd_array) {
|
||||||
{
|
|
||||||
// Calculate commands to set memory addressing bounds.
|
// Calculate commands to set memory addressing bounds.
|
||||||
uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH;
|
uint8_t start_page = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_WIDTH;
|
||||||
uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH;
|
uint8_t start_column = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_WIDTH;
|
||||||
@ -250,23 +244,21 @@ static void calc_bounds(uint8_t update_start, uint8_t* cmd_array)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void calc_bounds_90(uint8_t update_start, uint8_t* cmd_array)
|
static void calc_bounds_90(uint8_t update_start, uint8_t *cmd_array) {
|
||||||
{
|
|
||||||
cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8;
|
cmd_array[1] = OLED_BLOCK_SIZE * update_start / OLED_DISPLAY_HEIGHT * 8;
|
||||||
cmd_array[4] = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT;
|
cmd_array[4] = OLED_BLOCK_SIZE * update_start % OLED_DISPLAY_HEIGHT;
|
||||||
cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1];;
|
cmd_array[2] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) / OLED_DISPLAY_HEIGHT * 8 - 1 + cmd_array[1];
|
||||||
|
;
|
||||||
cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8;
|
cmd_array[5] = (OLED_BLOCK_SIZE + OLED_DISPLAY_HEIGHT - 1) % OLED_DISPLAY_HEIGHT / 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t crot(uint8_t a, int8_t n)
|
uint8_t crot(uint8_t a, int8_t n) {
|
||||||
{
|
|
||||||
const uint8_t mask = 0x7;
|
const uint8_t mask = 0x7;
|
||||||
n &= mask;
|
n &= mask;
|
||||||
return a << n | a >> (-n & mask);
|
return a << n | a >> (-n & mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rotate_90(const uint8_t* src, uint8_t* dest)
|
static void rotate_90(const uint8_t *src, uint8_t *dest) {
|
||||||
{
|
|
||||||
for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) {
|
for (uint8_t i = 0, shift = 7; i < 8; ++i, --shift) {
|
||||||
uint8_t selector = (1 << i);
|
uint8_t selector = (1 << i);
|
||||||
for (uint8_t j = 0; j < 8; ++j) {
|
for (uint8_t j = 0; j < 8; ++j) {
|
||||||
@ -283,13 +275,12 @@ void oled_render(void) {
|
|||||||
|
|
||||||
// Find first dirty block
|
// Find first dirty block
|
||||||
uint8_t update_start = 0;
|
uint8_t update_start = 0;
|
||||||
while (!(oled_dirty & (1 << update_start))) { ++update_start; }
|
while (!(oled_dirty & (1 << update_start))) {
|
||||||
|
++update_start;
|
||||||
|
}
|
||||||
|
|
||||||
// Set column & page position
|
// Set column & page position
|
||||||
static uint8_t display_start[] = {
|
static uint8_t display_start[] = {I2C_CMD, COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1, PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1};
|
||||||
I2C_CMD,
|
|
||||||
COLUMN_ADDR, 0, OLED_DISPLAY_WIDTH - 1,
|
|
||||||
PAGE_ADDR, 0, OLED_DISPLAY_HEIGHT / 8 - 1 };
|
|
||||||
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
if (!HAS_FLAGS(oled_rotation, OLED_ROTATION_90)) {
|
||||||
calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start
|
calc_bounds(update_start, &display_start[1]); // Offset from I2C_CMD byte at the start
|
||||||
} else {
|
} else {
|
||||||
@ -353,8 +344,7 @@ void oled_advance_page(bool clearPageRemainder) {
|
|||||||
remaining = remaining / OLED_FONT_WIDTH;
|
remaining = remaining / OLED_FONT_WIDTH;
|
||||||
|
|
||||||
// Write empty character until next line
|
// Write empty character until next line
|
||||||
while (remaining--)
|
while (remaining--) oled_write_char(' ', false);
|
||||||
oled_write_char(' ', false);
|
|
||||||
} else {
|
} else {
|
||||||
// Next page index out of bounds?
|
// Next page index out of bounds?
|
||||||
if (index + remaining >= OLED_MATRIX_SIZE) {
|
if (index + remaining >= OLED_MATRIX_SIZE) {
|
||||||
@ -457,8 +447,8 @@ void oled_write_ln_P(const char *data, bool invert) {
|
|||||||
#endif // defined(__AVR__)
|
#endif // defined(__AVR__)
|
||||||
|
|
||||||
bool oled_on(void) {
|
bool oled_on(void) {
|
||||||
#if !defined(OLED_DISABLE_TIMEOUT)
|
#if OLED_TIMEOUT > 0
|
||||||
oled_last_activity = timer_read();
|
oled_timeout = timer_read32() + OLED_TIMEOUT;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static const uint8_t PROGMEM display_on[] = {I2C_CMD, DISPLAY_ON};
|
static const uint8_t PROGMEM display_on[] = {I2C_CMD, DISPLAY_ON};
|
||||||
@ -488,8 +478,7 @@ bool oled_scroll_right(void) {
|
|||||||
// Dont enable scrolling if we need to update the display
|
// Dont enable scrolling if we need to update the display
|
||||||
// This prevents scrolling of bad data from starting the scroll too early after init
|
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||||
if (!oled_dirty && !oled_scrolling) {
|
if (!oled_dirty && !oled_scrolling) {
|
||||||
static const uint8_t PROGMEM display_scroll_right[] = {
|
static const uint8_t PROGMEM display_scroll_right[] = {I2C_CMD, SCROLL_RIGHT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL};
|
||||||
I2C_CMD, SCROLL_RIGHT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL };
|
|
||||||
if (I2C_TRANSMIT_P(display_scroll_right) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_scroll_right) != I2C_STATUS_SUCCESS) {
|
||||||
print("oled_scroll_right cmd failed\n");
|
print("oled_scroll_right cmd failed\n");
|
||||||
return oled_scrolling;
|
return oled_scrolling;
|
||||||
@ -503,8 +492,7 @@ bool oled_scroll_left(void) {
|
|||||||
// Dont enable scrolling if we need to update the display
|
// Dont enable scrolling if we need to update the display
|
||||||
// This prevents scrolling of bad data from starting the scroll too early after init
|
// This prevents scrolling of bad data from starting the scroll too early after init
|
||||||
if (!oled_dirty && !oled_scrolling) {
|
if (!oled_dirty && !oled_scrolling) {
|
||||||
static const uint8_t PROGMEM display_scroll_left[] = {
|
static const uint8_t PROGMEM display_scroll_left[] = {I2C_CMD, SCROLL_LEFT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL};
|
||||||
I2C_CMD, SCROLL_LEFT, 0x00, 0x00, 0x00, 0x0F, 0x00, 0xFF, ACTIVATE_SCROLL };
|
|
||||||
if (I2C_TRANSMIT_P(display_scroll_left) != I2C_STATUS_SUCCESS) {
|
if (I2C_TRANSMIT_P(display_scroll_left) != I2C_STATUS_SUCCESS) {
|
||||||
print("oled_scroll_left cmd failed\n");
|
print("oled_scroll_left cmd failed\n");
|
||||||
return oled_scrolling;
|
return oled_scrolling;
|
||||||
@ -522,6 +510,7 @@ bool oled_scroll_off(void) {
|
|||||||
return oled_scrolling;
|
return oled_scrolling;
|
||||||
}
|
}
|
||||||
oled_scrolling = false;
|
oled_scrolling = false;
|
||||||
|
oled_dirty = -1;
|
||||||
}
|
}
|
||||||
return !oled_scrolling;
|
return !oled_scrolling;
|
||||||
}
|
}
|
||||||
@ -549,17 +538,32 @@ void oled_task(void) {
|
|||||||
|
|
||||||
oled_task_user();
|
oled_task_user();
|
||||||
|
|
||||||
|
#if OLED_SCROLL_TIMEOUT > 0
|
||||||
|
if (oled_dirty && oled_scrolling) {
|
||||||
|
oled_scroll_timeout = timer_read32() + OLED_SCROLL_TIMEOUT;
|
||||||
|
oled_scroll_off();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Smart render system, no need to check for dirty
|
// Smart render system, no need to check for dirty
|
||||||
oled_render();
|
oled_render();
|
||||||
|
|
||||||
// Display timeout check
|
// Display timeout check
|
||||||
#if !defined(OLED_DISABLE_TIMEOUT)
|
#if OLED_TIMEOUT > 0
|
||||||
if (oled_active && timer_elapsed(oled_last_activity) > OLED_TIMEOUT) {
|
if (oled_active && timer_expired32(timer_read32(), oled_timeout)) {
|
||||||
oled_off();
|
oled_off();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if OLED_SCROLL_TIMEOUT > 0
|
||||||
|
if (!oled_scrolling && timer_expired32(timer_read32(), oled_scroll_timeout)) {
|
||||||
|
# ifdef OLED_SCROLL_TIMEOUT_RIGHT
|
||||||
|
oled_scroll_right();
|
||||||
|
# else
|
||||||
|
oled_scroll_left();
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
__attribute__((weak))
|
__attribute__((weak)) void oled_task_user(void) {}
|
||||||
void oled_task_user(void) {
|
|
||||||
}
|
|
||||||
|
@ -52,10 +52,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||||
# ifndef OLED_SOURCE_MAP
|
# ifndef OLED_SOURCE_MAP
|
||||||
#define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
|
# define OLED_SOURCE_MAP \
|
||||||
|
{ 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||||
# endif
|
# endif
|
||||||
# ifndef OLED_TARGET_MAP
|
# ifndef OLED_TARGET_MAP
|
||||||
#define OLED_TARGET_MAP { 56, 48, 40, 32, 24, 16, 8, 0 }
|
# define OLED_TARGET_MAP \
|
||||||
|
{ 56, 48, 40, 32, 24, 16, 8, 0 }
|
||||||
# endif
|
# endif
|
||||||
// If OLED_BLOCK_TYPE is uint32_t, these tables would look like:
|
// If OLED_BLOCK_TYPE is uint32_t, these tables would look like:
|
||||||
// #define OLED_SOURCE_MAP { 32, 40, 48, 56 }
|
// #define OLED_SOURCE_MAP { 32, 40, 48, 56 }
|
||||||
@ -93,10 +95,12 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
// For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
|
||||||
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
// The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
|
||||||
# ifndef OLED_SOURCE_MAP
|
# ifndef OLED_SOURCE_MAP
|
||||||
#define OLED_SOURCE_MAP { 0, 8, 16, 24 }
|
# define OLED_SOURCE_MAP \
|
||||||
|
{ 0, 8, 16, 24 }
|
||||||
# endif
|
# endif
|
||||||
# ifndef OLED_TARGET_MAP
|
# ifndef OLED_TARGET_MAP
|
||||||
#define OLED_TARGET_MAP { 24, 16, 8, 0 }
|
# define OLED_TARGET_MAP \
|
||||||
|
{ 24, 16, 8, 0 }
|
||||||
# endif
|
# endif
|
||||||
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
|
// If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
|
||||||
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
|
// #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
|
||||||
@ -138,6 +142,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
# define OLED_FONT_HEIGHT 8
|
# define OLED_FONT_HEIGHT 8
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(OLED_TIMEOUT)
|
||||||
|
# if defined(OLED_DISABLE_TIMEOUT)
|
||||||
|
# define OLED_TIMEOUT 0
|
||||||
|
# else
|
||||||
|
# define OLED_TIMEOUT 60000
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
// OLED Rotation enum values are flags
|
// OLED Rotation enum values are flags
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OLED_ROTATION_0 = 0,
|
OLED_ROTATION_0 = 0,
|
||||||
|
@ -41,7 +41,12 @@ uint8_t foreColor,drawMode,fontWidth, fontHeight, fontType, fontStartChar, fontT
|
|||||||
uint16_t fontMapWidth;
|
uint16_t fontMapWidth;
|
||||||
|
|
||||||
#define _BV(x) (1 << (x))
|
#define _BV(x) (1 << (x))
|
||||||
#define swap(a, b) { uint8_t t = a; a = b; b = t; }
|
#define swap(a, b) \
|
||||||
|
{ \
|
||||||
|
uint8_t t = a; \
|
||||||
|
a = b; \
|
||||||
|
b = t; \
|
||||||
|
}
|
||||||
|
|
||||||
uint8_t micro_oled_transfer_buffer[20];
|
uint8_t micro_oled_transfer_buffer[20];
|
||||||
static uint8_t micro_oled_screen_current[LCDWIDTH * LCDWIDTH / 8] = {0};
|
static uint8_t micro_oled_screen_current[LCDWIDTH * LCDWIDTH / 8] = {0};
|
||||||
@ -68,243 +73,28 @@ static uint8_t micro_oled_screen_current[LCDWIDTH*LCDWIDTH/8] = { 0 };
|
|||||||
static uint8_t micro_oled_screen_buffer[] = {
|
static uint8_t micro_oled_screen_buffer[] = {
|
||||||
// QMK Logo - generated at http://www.majer.ch/lcd/adf_bitmap.php
|
// QMK Logo - generated at http://www.majer.ch/lcd/adf_bitmap.php
|
||||||
// 64x48 image
|
// 64x48 image
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60, 0xF8, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFE, 0xFE, 0xF8, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x8C, 0x8C, 0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0x8C, 0x8C, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xF1, 0xE3, 0xE7, 0xCF, 0xCF, 0xCF, 0xCF, 0x00, 0x00, 0xCF, 0xCF, 0xCF, 0xC7, 0xE7, 0xE3, 0xF1, 0xF8, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x06, 0x1F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF8, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x7F, 0x1F, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0x00, 0x00,
|
|
||||||
0x00, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x60, 0x60, 0x60,
|
|
||||||
0xF8, 0xFE, 0xFE, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x1F, 0xFF, 0xFF, 0xFF, 0xFE,
|
|
||||||
0xFE, 0xF8, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x8C, 0x8C, 0x8C, 0x8C, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
|
|
||||||
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x8C, 0x8C, 0x8C, 0x8C,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x31, 0x31, 0x31, 0x31, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xF1, 0xE3, 0xE7, 0xCF,
|
|
||||||
0xCF, 0xCF, 0xCF, 0x00, 0x00, 0xCF, 0xCF, 0xCF, 0xC7, 0xE7,
|
|
||||||
0xE3, 0xF1, 0xF8, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0x31, 0x31, 0x31, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06,
|
|
||||||
0x06, 0x06, 0x1F, 0x7F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF8, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0x7F, 0x7F, 0x1F, 0x06, 0x06, 0x06, 0x06, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00,
|
|
||||||
0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x0F, 0x0F, 0x00, 0x00,
|
|
||||||
0x00, 0x0F, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00
|
|
||||||
};
|
|
||||||
# endif
|
# endif
|
||||||
#elif LCDWIDTH == 128
|
#elif LCDWIDTH == 128
|
||||||
# if LCDHEIGHT == 32
|
# if LCDHEIGHT == 32
|
||||||
static uint8_t micro_oled_screen_buffer[LCDWIDTH * LCDWIDTH / 8] = {
|
static uint8_t micro_oled_screen_buffer[LCDWIDTH * LCDWIDTH / 8] = {
|
||||||
// 128x32 qmk image
|
// 128x32 qmk image
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0xE0, 0xFC, 0xFC, 0xE0, 0xFC, 0xFC, 0xE0, 0xF0, 0xFC, 0xE0, 0xE0, 0xFC, 0xE0, 0xE0, 0xFC, 0xFC, 0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0x10, 0x30, 0xE0, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0xB2, 0xB2, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF, 0x03, 0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF, 0xFF, 0xB7, 0xB2, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x02, 0x02, 0x03, 0x01, 0x00, 0x06, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x06, 0x00, 0x03, 0x1E, 0x18, 0x0F, 0x01, 0x0F, 0x18, 0x1E, 0x01, 0x00, 0x0F, 0x1F, 0x12, 0x02, 0x12, 0x13, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x0E, 0x1F, 0x12, 0x02, 0x12, 0x13, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x80, 0xC0, 0xE0, 0xE0, 0xFC, 0xFC, 0xE0, 0xFC, 0xFC,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x4D, 0x4D, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xF8, 0xF9, 0xF3, 0xF3, 0xC0, 0x80, 0xF3, 0xF3, 0xF3, 0xF9, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED, 0x4D, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0xC0, 0x00, 0x70, 0xC0, 0x00, 0x80, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0C, 0x04, 0x04, 0x04, 0x04, 0x1C, 0xF0, 0x00, 0x00, 0xFC, 0x0C, 0x38, 0xE0, 0x00, 0x00, 0xC0, 0x38, 0x0C, 0xFC, 0x00, 0x00, 0xFC, 0xFC, 0x60, 0x90, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0xE0, 0xF0, 0xFC, 0xE0, 0xE0, 0xFC, 0xE0, 0xE0, 0xFC, 0xFC,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x3F, 0x3F, 0x07, 0x3F, 0x3F, 0x07, 0x0F, 0x3F, 0x07, 0x07, 0x3F, 0x07, 0x07, 0x3F, 0x3F, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x06, 0x04, 0x04, 0x07, 0x01, 0x00, 0x00, 0x13, 0x1E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x04, 0x04, 0x04, 0x04, 0x07, 0x0D, 0x08, 0x00, 0x07, 0x00, 0x00, 0x01, 0x07, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x07, 0x00, 0x01, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
0xE0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0xF0, 0x10, 0x10, 0x30, 0xE0, 0x00, 0x00,
|
|
||||||
0x80, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x80, 0x00, 0x00,
|
|
||||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x80, 0x80,
|
|
||||||
0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x00, 0x00,
|
|
||||||
0x80, 0x80, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80,
|
|
||||||
0x80, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x12, 0xB2, 0xB2, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF, 0x03,
|
|
||||||
0x01, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x03, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xB7, 0xB2, 0xB2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x1F, 0x02, 0x02, 0x03, 0x01, 0x00, 0x06, 0x1F, 0x10,
|
|
||||||
0x10, 0x10, 0x1F, 0x06, 0x00, 0x03, 0x1E, 0x18, 0x0F, 0x01,
|
|
||||||
0x0F, 0x18, 0x1E, 0x01, 0x00, 0x0F, 0x1F, 0x12, 0x02, 0x12,
|
|
||||||
0x13, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x0E, 0x1F, 0x12,
|
|
||||||
0x02, 0x12, 0x13, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x1F,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x48, 0x4D, 0x4D, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFE, 0xF8, 0xF9, 0xF3, 0xF3, 0xC0, 0x80, 0xF3,
|
|
||||||
0xF3, 0xF3, 0xF9, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xED,
|
|
||||||
0x4D, 0x4D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0xC0, 0x00, 0x70, 0xC0,
|
|
||||||
0x00, 0x80, 0x70, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x0C,
|
|
||||||
0x04, 0x04, 0x04, 0x04, 0x1C, 0xF0, 0x00, 0x00, 0xFC, 0x0C,
|
|
||||||
0x38, 0xE0, 0x00, 0x00, 0xC0, 0x38, 0x0C, 0xFC, 0x00, 0x00,
|
|
||||||
0xFC, 0xFC, 0x60, 0x90, 0x0C, 0x04, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x3F,
|
|
||||||
0x3F, 0x07, 0x3F, 0x3F, 0x07, 0x0F, 0x3F, 0x07, 0x07, 0x3F,
|
|
||||||
0x07, 0x07, 0x3F, 0x3F, 0x07, 0x07, 0x03, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07,
|
|
||||||
0x06, 0x04, 0x04, 0x07, 0x01, 0x00, 0x00, 0x13, 0x1E, 0x03,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x04, 0x04,
|
|
||||||
0x04, 0x04, 0x07, 0x0D, 0x08, 0x00, 0x07, 0x00, 0x00, 0x01,
|
|
||||||
0x07, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x07,
|
|
||||||
0x00, 0x01, 0x03, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00
|
|
||||||
};
|
|
||||||
# elif LCDHEIGHT == 64
|
# elif LCDHEIGHT == 64
|
||||||
static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = {
|
static uint8_t micro_oled_screen_buffer[LCDWIDTH * LCDWIDTH / 8] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0, 0xC0, 0xC0, 0xF8, 0xFC, 0xFC, 0xFE, 0xFE, 0xFF, 0x7F, 0x7E, 0xFE, 0xFF, 0xFF, 0xFE, 0xFE, 0x7F, 0x7F, 0xFE, 0xFE, 0xFF, 0xFF, 0xFE, 0x7E, 0x7F, 0xFF, 0xFE, 0xFE, 0xFC, 0xFC, 0xF8, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x88, 0x88, 0x88, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xDD, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xF8, 0xF0, 0xF3, 0xF3, 0xE7, 0xE7, 0x00, 0x00, 0xE7, 0xE7, 0xF3, 0xF3, 0xF0, 0xF8, 0xFE, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x1F, 0x3F, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0x3F, 0x1F, 0x0F, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00, 0x80, 0x03, 0x03, 0x00, 0x00, 0x01, 0x03, 0x00, 0x80, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x11, 0x11, 0x11, 0x0E, 0x00, 0x70, 0x88, 0x04, 0x04, 0x04, 0xF8, 0x00, 0x00, 0x3C, 0xE0, 0xC0, 0x38, 0x1C, 0xE0, 0x80, 0x70, 0x0C, 0x00, 0xF8, 0xAC, 0x24, 0x24, 0x3C, 0x30, 0x00, 0x00, 0xFC, 0x0C, 0x04, 0x00, 0xF8, 0xAC, 0x24, 0x24, 0x2C, 0x30, 0x00, 0x70, 0xDC, 0x04, 0x04, 0x88, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x8C, 0x04, 0x04, 0xF8, 0x00, 0x04, 0x3C, 0xE0, 0x80, 0xF0, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x83, 0x01, 0x01, 0x01, 0x81, 0xFE, 0x3C, 0x00, 0x00, 0xFF, 0x03, 0x0E, 0x70, 0xC0, 0xE0, 0x38, 0x06, 0x03, 0xFF, 0x00, 0x00, 0xFF, 0x18, 0x38, 0x66, 0xC3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xC0,
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00,
|
|
||||||
0xC0, 0xC0, 0x00, 0x00, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0xC0, 0xC0, 0xC0, 0xC0, 0xF8, 0xFC, 0xFC, 0xFE, 0xFE, 0xFF,
|
|
||||||
0x7F, 0x7E, 0xFE, 0xFF, 0xFF, 0xFE, 0xFE, 0x7F, 0x7F, 0xFE,
|
|
||||||
0xFE, 0xFF, 0xFF, 0xFE, 0x7E, 0x7F, 0xFF, 0xFE, 0xFE, 0xFC,
|
|
||||||
0xFC, 0xF8, 0xC0, 0xC0, 0xC0, 0xC0, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x88, 0x88, 0x88, 0xDD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xDD, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x99, 0x99, 0x99, 0x99, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFE, 0xF8, 0xF0, 0xF3, 0xF3, 0xE7, 0xE7, 0x00,
|
|
||||||
0x00, 0xE7, 0xE7, 0xF3, 0xF3, 0xF0, 0xF8, 0xFE, 0xFF, 0xFF,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0x99, 0x99, 0x99, 0x99, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x0F, 0x1F, 0x3F,
|
|
||||||
0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F,
|
|
||||||
0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF, 0x3F, 0x3F, 0xFF, 0xFF,
|
|
||||||
0x3F, 0x3F, 0x3F, 0x1F, 0x0F, 0x01, 0x01, 0x01, 0x01, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x03, 0x01, 0x00, 0x00, 0x03, 0x01, 0x00,
|
|
||||||
0x80, 0x03, 0x03, 0x00, 0x00, 0x01, 0x03, 0x00, 0x80, 0x01,
|
|
||||||
0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x11, 0x11, 0x11, 0x0E, 0x00, 0x70,
|
|
||||||
0x88, 0x04, 0x04, 0x04, 0xF8, 0x00, 0x00, 0x3C, 0xE0, 0xC0,
|
|
||||||
0x38, 0x1C, 0xE0, 0x80, 0x70, 0x0C, 0x00, 0xF8, 0xAC, 0x24,
|
|
||||||
0x24, 0x3C, 0x30, 0x00, 0x00, 0xFC, 0x0C, 0x04, 0x00, 0xF8,
|
|
||||||
0xAC, 0x24, 0x24, 0x2C, 0x30, 0x00, 0x70, 0xDC, 0x04, 0x04,
|
|
||||||
0x88, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
|
|
||||||
0x8C, 0x04, 0x04, 0xF8, 0x00, 0x04, 0x3C, 0xE0, 0x80, 0xF0,
|
|
||||||
0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x83, 0x01, 0x01,
|
|
||||||
0x01, 0x81, 0xFE, 0x3C, 0x00, 0x00, 0xFF, 0x03, 0x0E, 0x70,
|
|
||||||
0xC0, 0xE0, 0x38, 0x06, 0x03, 0xFF, 0x00, 0x00, 0xFF, 0x18,
|
|
||||||
0x38, 0x66, 0xC3, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
|
||||||
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01,
|
|
||||||
0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01,
|
|
||||||
0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x04, 0x03,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
|
||||||
0x01, 0x01, 0x01, 0x01, 0x03, 0x02, 0x00, 0x01, 0x00, 0x00,
|
|
||||||
0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
||||||
};
|
|
||||||
// TODO: generate bitmap of QMK logo here
|
// TODO: generate bitmap of QMK logo here
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
@ -312,8 +102,6 @@ static uint8_t micro_oled_screen_buffer[] = {
|
|||||||
static uint8_t micro_oled_screen_buffer[LCDWIDTH * LCDWIDTH / 8] = {0};
|
static uint8_t micro_oled_screen_buffer[LCDWIDTH * LCDWIDTH / 8] = {0};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void micro_oled_init(void) {
|
void micro_oled_init(void) {
|
||||||
i2c_init();
|
i2c_init();
|
||||||
i2c_start(I2C_ADDRESS_SA0_1);
|
i2c_start(I2C_ADDRESS_SA0_1);
|
||||||
@ -468,12 +256,10 @@ void send_buffer(void) {
|
|||||||
Draw color pixel in the screen buffer's x,y position with NORM or XOR draw mode.
|
Draw color pixel in the screen buffer's x,y position with NORM or XOR draw mode.
|
||||||
*/
|
*/
|
||||||
void draw_pixel(uint8_t x, uint8_t y, uint8_t color, uint8_t mode) {
|
void draw_pixel(uint8_t x, uint8_t y, uint8_t color, uint8_t mode) {
|
||||||
if ((x<0) || (x>=LCDWIDTH) || (y<0) || (y>=LCDHEIGHT))
|
if ((x < 0) || (x >= LCDWIDTH) || (y < 0) || (y >= LCDHEIGHT)) return;
|
||||||
return;
|
|
||||||
|
|
||||||
if (mode == XOR) {
|
if (mode == XOR) {
|
||||||
if (color == PIXEL_ON)
|
if (color == PIXEL_ON) micro_oled_screen_buffer[x + (y / 8) * LCDWIDTH] ^= _BV((y % 8));
|
||||||
micro_oled_screen_buffer[x + (y/8)*LCDWIDTH] ^= _BV((y%8));
|
|
||||||
} else {
|
} else {
|
||||||
if (color == PIXEL_ON)
|
if (color == PIXEL_ON)
|
||||||
micro_oled_screen_buffer[x + (y / 8) * LCDWIDTH] |= _BV((y % 8));
|
micro_oled_screen_buffer[x + (y / 8) * LCDWIDTH] |= _BV((y % 8));
|
||||||
@ -507,7 +293,8 @@ void draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, ui
|
|||||||
if (y0 < y1) {
|
if (y0 < y1) {
|
||||||
ystep = 1;
|
ystep = 1;
|
||||||
} else {
|
} else {
|
||||||
ystep = -1;}
|
ystep = -1;
|
||||||
|
}
|
||||||
|
|
||||||
for (; x0 < x1; x0++) {
|
for (; x0 < x1; x0++) {
|
||||||
if (steep) {
|
if (steep) {
|
||||||
@ -526,16 +313,12 @@ void draw_line(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, uint8_t color, ui
|
|||||||
/** \brief Draw horizontal line with color and mode.
|
/** \brief Draw horizontal line with color and mode.
|
||||||
Draw horizontal line using color and mode from x,y to x+width,y of the screen buffer.
|
Draw horizontal line using color and mode from x,y to x+width,y of the screen buffer.
|
||||||
*/
|
*/
|
||||||
void draw_line_hori(uint8_t x, uint8_t y, uint8_t width, uint8_t color, uint8_t mode) {
|
void draw_line_hori(uint8_t x, uint8_t y, uint8_t width, uint8_t color, uint8_t mode) { draw_line(x, y, x + width, y, color, mode); }
|
||||||
draw_line(x,y,x+width,y,color,mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Draw vertical line.
|
/** \brief Draw vertical line.
|
||||||
Draw vertical line using current fore color and current draw mode from x,y to x,y+height of the screen buffer.
|
Draw vertical line using current fore color and current draw mode from x,y to x,y+height of the screen buffer.
|
||||||
*/
|
*/
|
||||||
void draw_line_vert(uint8_t x, uint8_t y, uint8_t height, bool color, uint8_t mode) {
|
void draw_line_vert(uint8_t x, uint8_t y, uint8_t height, bool color, uint8_t mode) { draw_line(x, y, x, y + height, color, mode); }
|
||||||
draw_line(x,y,x,y+height,color,mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** \brief Draw rectangle with color and mode.
|
/** \brief Draw rectangle with color and mode.
|
||||||
Draw rectangle using color and mode from x,y to x+width,y+height of the screen buffer.
|
Draw rectangle using color and mode from x,y to x+width,y+height of the screen buffer.
|
||||||
@ -608,8 +391,7 @@ void draw_char(uint8_t x, uint8_t y, uint8_t c, uint8_t color, uint8_t mode, uin
|
|||||||
uint8_t i, j, temp;
|
uint8_t i, j, temp;
|
||||||
uint16_t charPerBitmapRow, charColPositionOnBitmap, charRowPositionOnBitmap, charBitmapStartPosition;
|
uint16_t charPerBitmapRow, charColPositionOnBitmap, charRowPositionOnBitmap, charBitmapStartPosition;
|
||||||
|
|
||||||
if ((font>=TOTALFONTS) || (font<0))
|
if ((font >= TOTALFONTS) || (font < 0)) return;
|
||||||
return;
|
|
||||||
|
|
||||||
uint8_t fontType = font;
|
uint8_t fontType = font;
|
||||||
uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType] + 0);
|
uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType] + 0);
|
||||||
@ -638,8 +420,7 @@ void draw_char(uint8_t x, uint8_t y, uint8_t c, uint8_t color, uint8_t mode, uin
|
|||||||
for (j = 0; j < 8; j++) { // 8 is the LCD's page height (see datasheet for explanation)
|
for (j = 0; j < 8; j++) { // 8 is the LCD's page height (see datasheet for explanation)
|
||||||
if (temp & 0x1) {
|
if (temp & 0x1) {
|
||||||
draw_pixel(x + i, y + j, color, mode);
|
draw_pixel(x + i, y + j, color, mode);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
draw_pixel(x + i, y + j, !color, mode);
|
draw_pixel(x + i, y + j, !color, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -663,21 +444,17 @@ void draw_char(uint8_t x, uint8_t y, uint8_t c, uint8_t color, uint8_t mode, uin
|
|||||||
for (j = 0; j < 8; j++) { // 8 is the LCD's page height (see datasheet for explanation)
|
for (j = 0; j < 8; j++) { // 8 is the LCD's page height (see datasheet for explanation)
|
||||||
if (temp & 0x1) {
|
if (temp & 0x1) {
|
||||||
draw_pixel(x + i, y + j + (row * 8), color, mode);
|
draw_pixel(x + i, y + j + (row * 8), color, mode);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
draw_pixel(x + i, y + j + (row * 8), !color, mode);
|
draw_pixel(x + i, y + j + (row * 8), !color, mode);
|
||||||
}
|
}
|
||||||
temp >>= 1;
|
temp >>= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_string(uint8_t x, uint8_t y, char* string, uint8_t color, uint8_t mode, uint8_t font) {
|
void draw_string(uint8_t x, uint8_t y, char* string, uint8_t color, uint8_t mode, uint8_t font) {
|
||||||
|
if ((font >= TOTALFONTS) || (font < 0)) return;
|
||||||
if ((font>=TOTALFONTS) || (font<0))
|
|
||||||
return;
|
|
||||||
|
|
||||||
uint8_t fontType = font;
|
uint8_t fontType = font;
|
||||||
uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType] + 0);
|
uint8_t fontWidth = pgm_read_byte(fonts_pointer[fontType] + 0);
|
||||||
@ -687,5 +464,4 @@ void draw_string(uint8_t x, uint8_t y, char * string, uint8_t color, uint8_t mod
|
|||||||
draw_char(cur_x, y, string[i], color, mode, font);
|
draw_char(cur_x, y, string[i], color, mode, font);
|
||||||
cur_x += fontWidth + 1;
|
cur_x += fontWidth + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -29,260 +29,11 @@ https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/
|
|||||||
// Standard ASCII 5x7 font
|
// Standard ASCII 5x7 font
|
||||||
static const unsigned char font5x7[] PROGMEM = {
|
static const unsigned char font5x7[] PROGMEM = {
|
||||||
// first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256)
|
// first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256)
|
||||||
5,8,0,255,12,75,
|
5, 8, 0, 255, 12, 75, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x5B, 0x4F, 0x5B, 0x3E, 0x3E, 0x6B, 0x4F, 0x6B, 0x3E, 0x1C, 0x3E, 0x7C, 0x3E, 0x1C, 0x18, 0x3C, 0x7E, 0x3C, 0x18, 0x1C, 0x57, 0x7D, 0x57, 0x1C, 0x1C, 0x5E, 0x7F, 0x5E, 0x1C, 0x00, 0x18, 0x3C, 0x18, 0x00, 0xFF, 0xE7, 0xC3, 0xE7, 0xFF, 0x00, 0x18, 0x24, 0x18, 0x00, 0xFF, 0xE7, 0xDB, 0xE7, 0xFF, 0x30, 0x48, 0x3A, 0x06, 0x0E, 0x26, 0x29, 0x79, 0x29, 0x26, 0x40, 0x7F, 0x05, 0x05, 0x07, 0x40, 0x7F, 0x05, 0x25, 0x3F, 0x5A, 0x3C, 0xE7, 0x3C, 0x5A, 0x7F, 0x3E, 0x1C, 0x1C, 0x08, 0x08, 0x1C, 0x1C, 0x3E, 0x7F, 0x14, 0x22, 0x7F, 0x22, 0x14, 0x5F, 0x5F, 0x00, 0x5F, 0x5F, 0x06, 0x09, 0x7F, 0x01, 0x7F, 0x00, 0x66, 0x89, 0x95, 0x6A, 0x60, 0x60, 0x60, 0x60, 0x60, 0x94, 0xA2, 0xFF, 0xA2, 0x94, 0x08, 0x04, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x20, 0x10, 0x08, 0x08, 0x2A, 0x1C, 0x08, 0x08, 0x1C, 0x2A, 0x08, 0x08, 0x1E, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x1E, 0x0C, 0x1E, 0x0C, 0x30, 0x38, 0x3E, 0x38, 0x30,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
0x06, 0x0E, 0x3E, 0x0E, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x14, 0x7F, 0x14, 0x7F, 0x14, 0x24, 0x2A, 0x7F, 0x2A, 0x12, 0x23, 0x13, 0x08, 0x64, 0x62, 0x36, 0x49, 0x56, 0x20, 0x50, 0x00, 0x08, 0x07, 0x03, 0x00, 0x00, 0x1C, 0x22, 0x41, 0x00, 0x00, 0x41, 0x22, 0x1C, 0x00, 0x2A, 0x1C, 0x7F, 0x1C, 0x2A, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x80, 0x70, 0x30, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x60, 0x60, 0x00, 0x20, 0x10, 0x08, 0x04, 0x02, 0x3E, 0x51, 0x49, 0x45, 0x3E, 0x00, 0x42, 0x7F, 0x40, 0x00, 0x72, 0x49, 0x49, 0x49, 0x46, 0x21, 0x41, 0x49, 0x4D, 0x33, 0x18, 0x14, 0x12, 0x7F, 0x10, 0x27, 0x45, 0x45, 0x45, 0x39, 0x3C, 0x4A, 0x49, 0x49, 0x31, 0x41, 0x21, 0x11, 0x09, 0x07, 0x36, 0x49, 0x49, 0x49, 0x36, 0x46, 0x49, 0x49, 0x29, 0x1E, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x40, 0x34, 0x00, 0x00, 0x00, 0x08, 0x14, 0x22, 0x41, 0x14, 0x14, 0x14, 0x14, 0x14, 0x00, 0x41, 0x22, 0x14, 0x08, 0x02,
|
||||||
0x3E, 0x5B, 0x4F, 0x5B, 0x3E,
|
0x01, 0x59, 0x09, 0x06, 0x3E, 0x41, 0x5D, 0x59, 0x4E, 0x7C, 0x12, 0x11, 0x12, 0x7C, 0x7F, 0x49, 0x49, 0x49, 0x36, 0x3E, 0x41, 0x41, 0x41, 0x22, 0x7F, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x49, 0x49, 0x49, 0x41, 0x7F, 0x09, 0x09, 0x09, 0x01, 0x3E, 0x41, 0x41, 0x51, 0x73, 0x7F, 0x08, 0x08, 0x08, 0x7F, 0x00, 0x41, 0x7F, 0x41, 0x00, 0x20, 0x40, 0x41, 0x3F, 0x01, 0x7F, 0x08, 0x14, 0x22, 0x41, 0x7F, 0x40, 0x40, 0x40, 0x40, 0x7F, 0x02, 0x1C, 0x02, 0x7F, 0x7F, 0x04, 0x08, 0x10, 0x7F, 0x3E, 0x41, 0x41, 0x41, 0x3E, 0x7F, 0x09, 0x09, 0x09, 0x06, 0x3E, 0x41, 0x51, 0x21, 0x5E, 0x7F, 0x09, 0x19, 0x29, 0x46, 0x26, 0x49, 0x49, 0x49, 0x32, 0x03, 0x01, 0x7F, 0x01, 0x03, 0x3F, 0x40, 0x40, 0x40, 0x3F, 0x1F, 0x20, 0x40, 0x20, 0x1F, 0x3F, 0x40, 0x38, 0x40, 0x3F, 0x63, 0x14, 0x08, 0x14, 0x63, 0x03, 0x04, 0x78, 0x04, 0x03, 0x61, 0x59, 0x49, 0x4D, 0x43, 0x00, 0x7F, 0x41, 0x41, 0x41, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x41, 0x41, 0x41, 0x7F, 0x04, 0x02, 0x01, 0x02, 0x04, 0x40, 0x40,
|
||||||
0x3E, 0x6B, 0x4F, 0x6B, 0x3E,
|
0x40, 0x40, 0x40, 0x00, 0x03, 0x07, 0x08, 0x00, 0x20, 0x54, 0x54, 0x78, 0x40, 0x7F, 0x28, 0x44, 0x44, 0x38, 0x38, 0x44, 0x44, 0x44, 0x28, 0x38, 0x44, 0x44, 0x28, 0x7F, 0x38, 0x54, 0x54, 0x54, 0x18, 0x00, 0x08, 0x7E, 0x09, 0x02, 0x18, 0xA4, 0xA4, 0x9C, 0x78, 0x7F, 0x08, 0x04, 0x04, 0x78, 0x00, 0x44, 0x7D, 0x40, 0x00, 0x20, 0x40, 0x40, 0x3D, 0x00, 0x7F, 0x10, 0x28, 0x44, 0x00, 0x00, 0x41, 0x7F, 0x40, 0x00, 0x7C, 0x04, 0x78, 0x04, 0x78, 0x7C, 0x08, 0x04, 0x04, 0x78, 0x38, 0x44, 0x44, 0x44, 0x38, 0xFC, 0x18, 0x24, 0x24, 0x18, 0x18, 0x24, 0x24, 0x18, 0xFC, 0x7C, 0x08, 0x04, 0x04, 0x08, 0x48, 0x54, 0x54, 0x54, 0x24, 0x04, 0x04, 0x3F, 0x44, 0x24, 0x3C, 0x40, 0x40, 0x20, 0x7C, 0x1C, 0x20, 0x40, 0x20, 0x1C, 0x3C, 0x40, 0x30, 0x40, 0x3C, 0x44, 0x28, 0x10, 0x28, 0x44, 0x4C, 0x90, 0x90, 0x90, 0x7C, 0x44, 0x64, 0x54, 0x4C, 0x44, 0x00, 0x08, 0x36, 0x41, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x41, 0x36, 0x08, 0x00, 0x02, 0x01, 0x02, 0x04, 0x02, 0x3C, 0x26, 0x23,
|
||||||
0x1C, 0x3E, 0x7C, 0x3E, 0x1C,
|
0x26, 0x3C, 0x1E, 0xA1, 0xA1, 0x61, 0x12, 0x3A, 0x40, 0x40, 0x20, 0x7A, 0x38, 0x54, 0x54, 0x55, 0x59, 0x21, 0x55, 0x55, 0x79, 0x41, 0x21, 0x54, 0x54, 0x78, 0x41, 0x21, 0x55, 0x54, 0x78, 0x40, 0x20, 0x54, 0x55, 0x79, 0x40, 0x0C, 0x1E, 0x52, 0x72, 0x12, 0x39, 0x55, 0x55, 0x55, 0x59, 0x39, 0x54, 0x54, 0x54, 0x59, 0x39, 0x55, 0x54, 0x54, 0x58, 0x00, 0x00, 0x45, 0x7C, 0x41, 0x00, 0x02, 0x45, 0x7D, 0x42, 0x00, 0x01, 0x45, 0x7C, 0x40, 0xF0, 0x29, 0x24, 0x29, 0xF0, 0xF0, 0x28, 0x25, 0x28, 0xF0, 0x7C, 0x54, 0x55, 0x45, 0x00, 0x20, 0x54, 0x54, 0x7C, 0x54, 0x7C, 0x0A, 0x09, 0x7F, 0x49, 0x32, 0x49, 0x49, 0x49, 0x32, 0x32, 0x48, 0x48, 0x48, 0x32, 0x32, 0x4A, 0x48, 0x48, 0x30, 0x3A, 0x41, 0x41, 0x21, 0x7A, 0x3A, 0x42, 0x40, 0x20, 0x78, 0x00, 0x9D, 0xA0, 0xA0, 0x7D, 0x39, 0x44, 0x44, 0x44, 0x39, 0x3D, 0x40, 0x40, 0x40, 0x3D, 0x3C, 0x24, 0xFF, 0x24, 0x24, 0x48, 0x7E, 0x49, 0x43, 0x66, 0x2B, 0x2F, 0xFC, 0x2F, 0x2B, 0xFF, 0x09, 0x29, 0xF6, 0x20, 0xC0, 0x88, 0x7E, 0x09,
|
||||||
0x18, 0x3C, 0x7E, 0x3C, 0x18,
|
0x03, 0x20, 0x54, 0x54, 0x79, 0x41, 0x00, 0x00, 0x44, 0x7D, 0x41, 0x30, 0x48, 0x48, 0x4A, 0x32, 0x38, 0x40, 0x40, 0x22, 0x7A, 0x00, 0x7A, 0x0A, 0x0A, 0x72, 0x7D, 0x0D, 0x19, 0x31, 0x7D, 0x26, 0x29, 0x29, 0x2F, 0x28, 0x26, 0x29, 0x29, 0x29, 0x26, 0x30, 0x48, 0x4D, 0x40, 0x20, 0x38, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x38, 0x2F, 0x10, 0xC8, 0xAC, 0xBA, 0x2F, 0x10, 0x28, 0x34, 0xFA, 0x00, 0x00, 0x7B, 0x00, 0x00, 0x08, 0x14, 0x2A, 0x14, 0x22, 0x22, 0x14, 0x2A, 0x14, 0x08, 0xAA, 0x00, 0x55, 0x00, 0xAA, 0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x10, 0x10, 0x10, 0xFF, 0x00, 0x14, 0x14, 0x14, 0xFF, 0x00, 0x10, 0x10, 0xFF, 0x00, 0xFF, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x14, 0x14, 0x14, 0xFC, 0x00, 0x14, 0x14, 0xF7, 0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x14, 0x14, 0xF4, 0x04, 0xFC, 0x14, 0x14, 0x17, 0x10, 0x1F, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x14, 0x14, 0x14, 0x1F, 0x00, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10,
|
||||||
0x1C, 0x57, 0x7D, 0x57, 0x1C,
|
0x10, 0x10, 0x10, 0x1F, 0x10, 0x10, 0x10, 0x10, 0xF0, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xFF, 0x10, 0x00, 0x00, 0x00, 0xFF, 0x14, 0x00, 0x00, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x1F, 0x10, 0x17, 0x00, 0x00, 0xFC, 0x04, 0xF4, 0x14, 0x14, 0x17, 0x10, 0x17, 0x14, 0x14, 0xF4, 0x04, 0xF4, 0x00, 0x00, 0xFF, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0xF7, 0x00, 0xF7, 0x14, 0x14, 0x14, 0x17, 0x14, 0x10, 0x10, 0x1F, 0x10, 0x1F, 0x14, 0x14, 0x14, 0xF4, 0x14, 0x10, 0x10, 0xF0, 0x10, 0xF0, 0x00, 0x00, 0x1F, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x1F, 0x14, 0x00, 0x00, 0x00, 0xFC, 0x14, 0x00, 0x00, 0xF0, 0x10, 0xF0, 0x10, 0x10, 0xFF, 0x10, 0xFF, 0x14, 0x14, 0x14, 0xFF, 0x14, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x10, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF0, 0xF0, 0xF0, 0xF0, 0xF0, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x0F, 0x0F, 0x0F, 0x0F, 0x0F, 0x38, 0x44, 0x44, 0x38, 0x44, 0x7C,
|
||||||
0x1C, 0x5E, 0x7F, 0x5E, 0x1C,
|
0x2A, 0x2A, 0x3E, 0x14, 0x7E, 0x02, 0x02, 0x06, 0x06, 0x02, 0x7E, 0x02, 0x7E, 0x02, 0x63, 0x55, 0x49, 0x41, 0x63, 0x38, 0x44, 0x44, 0x3C, 0x04, 0x40, 0x7E, 0x20, 0x1E, 0x20, 0x06, 0x02, 0x7E, 0x02, 0x02, 0x99, 0xA5, 0xE7, 0xA5, 0x99, 0x1C, 0x2A, 0x49, 0x2A, 0x1C, 0x4C, 0x72, 0x01, 0x72, 0x4C, 0x30, 0x4A, 0x4D, 0x4D, 0x30, 0x30, 0x48, 0x78, 0x48, 0x30, 0xBC, 0x62, 0x5A, 0x46, 0x3D, 0x3E, 0x49, 0x49, 0x49, 0x00, 0x7E, 0x01, 0x01, 0x01, 0x7E, 0x2A, 0x2A, 0x2A, 0x2A, 0x2A, 0x44, 0x44, 0x5F, 0x44, 0x44, 0x40, 0x51, 0x4A, 0x44, 0x40, 0x40, 0x44, 0x4A, 0x51, 0x40, 0x00, 0x00, 0xFF, 0x01, 0x03, 0xE0, 0x80, 0xFF, 0x00, 0x00, 0x08, 0x08, 0x6B, 0x6B, 0x08, 0x36, 0x12, 0x36, 0x24, 0x36, 0x06, 0x0F, 0x09, 0x0F, 0x06, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x10, 0x10, 0x00, 0x30, 0x40, 0xFF, 0x01, 0x01, 0x00, 0x1F, 0x01, 0x01, 0x1E, 0x00, 0x19, 0x1D, 0x17, 0x12, 0x00, 0x3C, 0x3C, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
0x00, 0x18, 0x3C, 0x18, 0x00,
|
|
||||||
0xFF, 0xE7, 0xC3, 0xE7, 0xFF,
|
|
||||||
0x00, 0x18, 0x24, 0x18, 0x00,
|
|
||||||
0xFF, 0xE7, 0xDB, 0xE7, 0xFF,
|
|
||||||
0x30, 0x48, 0x3A, 0x06, 0x0E,
|
|
||||||
0x26, 0x29, 0x79, 0x29, 0x26,
|
|
||||||
0x40, 0x7F, 0x05, 0x05, 0x07,
|
|
||||||
0x40, 0x7F, 0x05, 0x25, 0x3F,
|
|
||||||
0x5A, 0x3C, 0xE7, 0x3C, 0x5A,
|
|
||||||
0x7F, 0x3E, 0x1C, 0x1C, 0x08,
|
|
||||||
0x08, 0x1C, 0x1C, 0x3E, 0x7F,
|
|
||||||
0x14, 0x22, 0x7F, 0x22, 0x14,
|
|
||||||
0x5F, 0x5F, 0x00, 0x5F, 0x5F,
|
|
||||||
0x06, 0x09, 0x7F, 0x01, 0x7F,
|
|
||||||
0x00, 0x66, 0x89, 0x95, 0x6A,
|
|
||||||
0x60, 0x60, 0x60, 0x60, 0x60,
|
|
||||||
0x94, 0xA2, 0xFF, 0xA2, 0x94,
|
|
||||||
0x08, 0x04, 0x7E, 0x04, 0x08,
|
|
||||||
0x10, 0x20, 0x7E, 0x20, 0x10,
|
|
||||||
0x08, 0x08, 0x2A, 0x1C, 0x08,
|
|
||||||
0x08, 0x1C, 0x2A, 0x08, 0x08,
|
|
||||||
0x1E, 0x10, 0x10, 0x10, 0x10,
|
|
||||||
0x0C, 0x1E, 0x0C, 0x1E, 0x0C,
|
|
||||||
0x30, 0x38, 0x3E, 0x38, 0x30,
|
|
||||||
0x06, 0x0E, 0x3E, 0x0E, 0x06,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x5F, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x07, 0x00,
|
|
||||||
0x14, 0x7F, 0x14, 0x7F, 0x14,
|
|
||||||
0x24, 0x2A, 0x7F, 0x2A, 0x12,
|
|
||||||
0x23, 0x13, 0x08, 0x64, 0x62,
|
|
||||||
0x36, 0x49, 0x56, 0x20, 0x50,
|
|
||||||
0x00, 0x08, 0x07, 0x03, 0x00,
|
|
||||||
0x00, 0x1C, 0x22, 0x41, 0x00,
|
|
||||||
0x00, 0x41, 0x22, 0x1C, 0x00,
|
|
||||||
0x2A, 0x1C, 0x7F, 0x1C, 0x2A,
|
|
||||||
0x08, 0x08, 0x3E, 0x08, 0x08,
|
|
||||||
0x00, 0x80, 0x70, 0x30, 0x00,
|
|
||||||
0x08, 0x08, 0x08, 0x08, 0x08,
|
|
||||||
0x00, 0x00, 0x60, 0x60, 0x00,
|
|
||||||
0x20, 0x10, 0x08, 0x04, 0x02,
|
|
||||||
0x3E, 0x51, 0x49, 0x45, 0x3E,
|
|
||||||
0x00, 0x42, 0x7F, 0x40, 0x00,
|
|
||||||
0x72, 0x49, 0x49, 0x49, 0x46,
|
|
||||||
0x21, 0x41, 0x49, 0x4D, 0x33,
|
|
||||||
0x18, 0x14, 0x12, 0x7F, 0x10,
|
|
||||||
0x27, 0x45, 0x45, 0x45, 0x39,
|
|
||||||
0x3C, 0x4A, 0x49, 0x49, 0x31,
|
|
||||||
0x41, 0x21, 0x11, 0x09, 0x07,
|
|
||||||
0x36, 0x49, 0x49, 0x49, 0x36,
|
|
||||||
0x46, 0x49, 0x49, 0x29, 0x1E,
|
|
||||||
0x00, 0x00, 0x14, 0x00, 0x00,
|
|
||||||
0x00, 0x40, 0x34, 0x00, 0x00,
|
|
||||||
0x00, 0x08, 0x14, 0x22, 0x41,
|
|
||||||
0x14, 0x14, 0x14, 0x14, 0x14,
|
|
||||||
0x00, 0x41, 0x22, 0x14, 0x08,
|
|
||||||
0x02, 0x01, 0x59, 0x09, 0x06,
|
|
||||||
0x3E, 0x41, 0x5D, 0x59, 0x4E,
|
|
||||||
0x7C, 0x12, 0x11, 0x12, 0x7C,
|
|
||||||
0x7F, 0x49, 0x49, 0x49, 0x36,
|
|
||||||
0x3E, 0x41, 0x41, 0x41, 0x22,
|
|
||||||
0x7F, 0x41, 0x41, 0x41, 0x3E,
|
|
||||||
0x7F, 0x49, 0x49, 0x49, 0x41,
|
|
||||||
0x7F, 0x09, 0x09, 0x09, 0x01,
|
|
||||||
0x3E, 0x41, 0x41, 0x51, 0x73,
|
|
||||||
0x7F, 0x08, 0x08, 0x08, 0x7F,
|
|
||||||
0x00, 0x41, 0x7F, 0x41, 0x00,
|
|
||||||
0x20, 0x40, 0x41, 0x3F, 0x01,
|
|
||||||
0x7F, 0x08, 0x14, 0x22, 0x41,
|
|
||||||
0x7F, 0x40, 0x40, 0x40, 0x40,
|
|
||||||
0x7F, 0x02, 0x1C, 0x02, 0x7F,
|
|
||||||
0x7F, 0x04, 0x08, 0x10, 0x7F,
|
|
||||||
0x3E, 0x41, 0x41, 0x41, 0x3E,
|
|
||||||
0x7F, 0x09, 0x09, 0x09, 0x06,
|
|
||||||
0x3E, 0x41, 0x51, 0x21, 0x5E,
|
|
||||||
0x7F, 0x09, 0x19, 0x29, 0x46,
|
|
||||||
0x26, 0x49, 0x49, 0x49, 0x32,
|
|
||||||
0x03, 0x01, 0x7F, 0x01, 0x03,
|
|
||||||
0x3F, 0x40, 0x40, 0x40, 0x3F,
|
|
||||||
0x1F, 0x20, 0x40, 0x20, 0x1F,
|
|
||||||
0x3F, 0x40, 0x38, 0x40, 0x3F,
|
|
||||||
0x63, 0x14, 0x08, 0x14, 0x63,
|
|
||||||
0x03, 0x04, 0x78, 0x04, 0x03,
|
|
||||||
0x61, 0x59, 0x49, 0x4D, 0x43,
|
|
||||||
0x00, 0x7F, 0x41, 0x41, 0x41,
|
|
||||||
0x02, 0x04, 0x08, 0x10, 0x20,
|
|
||||||
0x00, 0x41, 0x41, 0x41, 0x7F,
|
|
||||||
0x04, 0x02, 0x01, 0x02, 0x04,
|
|
||||||
0x40, 0x40, 0x40, 0x40, 0x40,
|
|
||||||
0x00, 0x03, 0x07, 0x08, 0x00,
|
|
||||||
0x20, 0x54, 0x54, 0x78, 0x40,
|
|
||||||
0x7F, 0x28, 0x44, 0x44, 0x38,
|
|
||||||
0x38, 0x44, 0x44, 0x44, 0x28,
|
|
||||||
0x38, 0x44, 0x44, 0x28, 0x7F,
|
|
||||||
0x38, 0x54, 0x54, 0x54, 0x18,
|
|
||||||
0x00, 0x08, 0x7E, 0x09, 0x02,
|
|
||||||
0x18, 0xA4, 0xA4, 0x9C, 0x78,
|
|
||||||
0x7F, 0x08, 0x04, 0x04, 0x78,
|
|
||||||
0x00, 0x44, 0x7D, 0x40, 0x00,
|
|
||||||
0x20, 0x40, 0x40, 0x3D, 0x00,
|
|
||||||
0x7F, 0x10, 0x28, 0x44, 0x00,
|
|
||||||
0x00, 0x41, 0x7F, 0x40, 0x00,
|
|
||||||
0x7C, 0x04, 0x78, 0x04, 0x78,
|
|
||||||
0x7C, 0x08, 0x04, 0x04, 0x78,
|
|
||||||
0x38, 0x44, 0x44, 0x44, 0x38,
|
|
||||||
0xFC, 0x18, 0x24, 0x24, 0x18,
|
|
||||||
0x18, 0x24, 0x24, 0x18, 0xFC,
|
|
||||||
0x7C, 0x08, 0x04, 0x04, 0x08,
|
|
||||||
0x48, 0x54, 0x54, 0x54, 0x24,
|
|
||||||
0x04, 0x04, 0x3F, 0x44, 0x24,
|
|
||||||
0x3C, 0x40, 0x40, 0x20, 0x7C,
|
|
||||||
0x1C, 0x20, 0x40, 0x20, 0x1C,
|
|
||||||
0x3C, 0x40, 0x30, 0x40, 0x3C,
|
|
||||||
0x44, 0x28, 0x10, 0x28, 0x44,
|
|
||||||
0x4C, 0x90, 0x90, 0x90, 0x7C,
|
|
||||||
0x44, 0x64, 0x54, 0x4C, 0x44,
|
|
||||||
0x00, 0x08, 0x36, 0x41, 0x00,
|
|
||||||
0x00, 0x00, 0x77, 0x00, 0x00,
|
|
||||||
0x00, 0x41, 0x36, 0x08, 0x00,
|
|
||||||
0x02, 0x01, 0x02, 0x04, 0x02,
|
|
||||||
0x3C, 0x26, 0x23, 0x26, 0x3C,
|
|
||||||
0x1E, 0xA1, 0xA1, 0x61, 0x12,
|
|
||||||
0x3A, 0x40, 0x40, 0x20, 0x7A,
|
|
||||||
0x38, 0x54, 0x54, 0x55, 0x59,
|
|
||||||
0x21, 0x55, 0x55, 0x79, 0x41,
|
|
||||||
0x21, 0x54, 0x54, 0x78, 0x41,
|
|
||||||
0x21, 0x55, 0x54, 0x78, 0x40,
|
|
||||||
0x20, 0x54, 0x55, 0x79, 0x40,
|
|
||||||
0x0C, 0x1E, 0x52, 0x72, 0x12,
|
|
||||||
0x39, 0x55, 0x55, 0x55, 0x59,
|
|
||||||
0x39, 0x54, 0x54, 0x54, 0x59,
|
|
||||||
0x39, 0x55, 0x54, 0x54, 0x58,
|
|
||||||
0x00, 0x00, 0x45, 0x7C, 0x41,
|
|
||||||
0x00, 0x02, 0x45, 0x7D, 0x42,
|
|
||||||
0x00, 0x01, 0x45, 0x7C, 0x40,
|
|
||||||
0xF0, 0x29, 0x24, 0x29, 0xF0,
|
|
||||||
0xF0, 0x28, 0x25, 0x28, 0xF0,
|
|
||||||
0x7C, 0x54, 0x55, 0x45, 0x00,
|
|
||||||
0x20, 0x54, 0x54, 0x7C, 0x54,
|
|
||||||
0x7C, 0x0A, 0x09, 0x7F, 0x49,
|
|
||||||
0x32, 0x49, 0x49, 0x49, 0x32,
|
|
||||||
0x32, 0x48, 0x48, 0x48, 0x32,
|
|
||||||
0x32, 0x4A, 0x48, 0x48, 0x30,
|
|
||||||
0x3A, 0x41, 0x41, 0x21, 0x7A,
|
|
||||||
0x3A, 0x42, 0x40, 0x20, 0x78,
|
|
||||||
0x00, 0x9D, 0xA0, 0xA0, 0x7D,
|
|
||||||
0x39, 0x44, 0x44, 0x44, 0x39,
|
|
||||||
0x3D, 0x40, 0x40, 0x40, 0x3D,
|
|
||||||
0x3C, 0x24, 0xFF, 0x24, 0x24,
|
|
||||||
0x48, 0x7E, 0x49, 0x43, 0x66,
|
|
||||||
0x2B, 0x2F, 0xFC, 0x2F, 0x2B,
|
|
||||||
0xFF, 0x09, 0x29, 0xF6, 0x20,
|
|
||||||
0xC0, 0x88, 0x7E, 0x09, 0x03,
|
|
||||||
0x20, 0x54, 0x54, 0x79, 0x41,
|
|
||||||
0x00, 0x00, 0x44, 0x7D, 0x41,
|
|
||||||
0x30, 0x48, 0x48, 0x4A, 0x32,
|
|
||||||
0x38, 0x40, 0x40, 0x22, 0x7A,
|
|
||||||
0x00, 0x7A, 0x0A, 0x0A, 0x72,
|
|
||||||
0x7D, 0x0D, 0x19, 0x31, 0x7D,
|
|
||||||
0x26, 0x29, 0x29, 0x2F, 0x28,
|
|
||||||
0x26, 0x29, 0x29, 0x29, 0x26,
|
|
||||||
0x30, 0x48, 0x4D, 0x40, 0x20,
|
|
||||||
0x38, 0x08, 0x08, 0x08, 0x08,
|
|
||||||
0x08, 0x08, 0x08, 0x08, 0x38,
|
|
||||||
0x2F, 0x10, 0xC8, 0xAC, 0xBA,
|
|
||||||
0x2F, 0x10, 0x28, 0x34, 0xFA,
|
|
||||||
0x00, 0x00, 0x7B, 0x00, 0x00,
|
|
||||||
0x08, 0x14, 0x2A, 0x14, 0x22,
|
|
||||||
0x22, 0x14, 0x2A, 0x14, 0x08,
|
|
||||||
0xAA, 0x00, 0x55, 0x00, 0xAA,
|
|
||||||
0xAA, 0x55, 0xAA, 0x55, 0xAA,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x00,
|
|
||||||
0x10, 0x10, 0x10, 0xFF, 0x00,
|
|
||||||
0x14, 0x14, 0x14, 0xFF, 0x00,
|
|
||||||
0x10, 0x10, 0xFF, 0x00, 0xFF,
|
|
||||||
0x10, 0x10, 0xF0, 0x10, 0xF0,
|
|
||||||
0x14, 0x14, 0x14, 0xFC, 0x00,
|
|
||||||
0x14, 0x14, 0xF7, 0x00, 0xFF,
|
|
||||||
0x00, 0x00, 0xFF, 0x00, 0xFF,
|
|
||||||
0x14, 0x14, 0xF4, 0x04, 0xFC,
|
|
||||||
0x14, 0x14, 0x17, 0x10, 0x1F,
|
|
||||||
0x10, 0x10, 0x1F, 0x10, 0x1F,
|
|
||||||
0x14, 0x14, 0x14, 0x1F, 0x00,
|
|
||||||
0x10, 0x10, 0x10, 0xF0, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x1F, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0x1F, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0xF0, 0x10,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0x10, 0x10,
|
|
||||||
0x10, 0x10, 0x10, 0xFF, 0x10,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0x14,
|
|
||||||
0x00, 0x00, 0xFF, 0x00, 0xFF,
|
|
||||||
0x00, 0x00, 0x1F, 0x10, 0x17,
|
|
||||||
0x00, 0x00, 0xFC, 0x04, 0xF4,
|
|
||||||
0x14, 0x14, 0x17, 0x10, 0x17,
|
|
||||||
0x14, 0x14, 0xF4, 0x04, 0xF4,
|
|
||||||
0x00, 0x00, 0xFF, 0x00, 0xF7,
|
|
||||||
0x14, 0x14, 0x14, 0x14, 0x14,
|
|
||||||
0x14, 0x14, 0xF7, 0x00, 0xF7,
|
|
||||||
0x14, 0x14, 0x14, 0x17, 0x14,
|
|
||||||
0x10, 0x10, 0x1F, 0x10, 0x1F,
|
|
||||||
0x14, 0x14, 0x14, 0xF4, 0x14,
|
|
||||||
0x10, 0x10, 0xF0, 0x10, 0xF0,
|
|
||||||
0x00, 0x00, 0x1F, 0x10, 0x1F,
|
|
||||||
0x00, 0x00, 0x00, 0x1F, 0x14,
|
|
||||||
0x00, 0x00, 0x00, 0xFC, 0x14,
|
|
||||||
0x00, 0x00, 0xF0, 0x10, 0xF0,
|
|
||||||
0x10, 0x10, 0xFF, 0x10, 0xFF,
|
|
||||||
0x14, 0x14, 0x14, 0xFF, 0x14,
|
|
||||||
0x10, 0x10, 0x10, 0x1F, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0xF0, 0x10,
|
|
||||||
0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
|
||||||
0xF0, 0xF0, 0xF0, 0xF0, 0xF0,
|
|
||||||
0xFF, 0xFF, 0xFF, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0xFF, 0xFF,
|
|
||||||
0x0F, 0x0F, 0x0F, 0x0F, 0x0F,
|
|
||||||
0x38, 0x44, 0x44, 0x38, 0x44,
|
|
||||||
0x7C, 0x2A, 0x2A, 0x3E, 0x14,
|
|
||||||
0x7E, 0x02, 0x02, 0x06, 0x06,
|
|
||||||
0x02, 0x7E, 0x02, 0x7E, 0x02,
|
|
||||||
0x63, 0x55, 0x49, 0x41, 0x63,
|
|
||||||
0x38, 0x44, 0x44, 0x3C, 0x04,
|
|
||||||
0x40, 0x7E, 0x20, 0x1E, 0x20,
|
|
||||||
0x06, 0x02, 0x7E, 0x02, 0x02,
|
|
||||||
0x99, 0xA5, 0xE7, 0xA5, 0x99,
|
|
||||||
0x1C, 0x2A, 0x49, 0x2A, 0x1C,
|
|
||||||
0x4C, 0x72, 0x01, 0x72, 0x4C,
|
|
||||||
0x30, 0x4A, 0x4D, 0x4D, 0x30,
|
|
||||||
0x30, 0x48, 0x78, 0x48, 0x30,
|
|
||||||
0xBC, 0x62, 0x5A, 0x46, 0x3D,
|
|
||||||
0x3E, 0x49, 0x49, 0x49, 0x00,
|
|
||||||
0x7E, 0x01, 0x01, 0x01, 0x7E,
|
|
||||||
0x2A, 0x2A, 0x2A, 0x2A, 0x2A,
|
|
||||||
0x44, 0x44, 0x5F, 0x44, 0x44,
|
|
||||||
0x40, 0x51, 0x4A, 0x44, 0x40,
|
|
||||||
0x40, 0x44, 0x4A, 0x51, 0x40,
|
|
||||||
0x00, 0x00, 0xFF, 0x01, 0x03,
|
|
||||||
0xE0, 0x80, 0xFF, 0x00, 0x00,
|
|
||||||
0x08, 0x08, 0x6B, 0x6B, 0x08,
|
|
||||||
0x36, 0x12, 0x36, 0x24, 0x36,
|
|
||||||
0x06, 0x0F, 0x09, 0x0F, 0x06,
|
|
||||||
0x00, 0x00, 0x18, 0x18, 0x00,
|
|
||||||
0x00, 0x00, 0x10, 0x10, 0x00,
|
|
||||||
0x30, 0x40, 0xFF, 0x01, 0x01,
|
|
||||||
0x00, 0x1F, 0x01, 0x01, 0x1E,
|
|
||||||
0x00, 0x19, 0x1D, 0x17, 0x12,
|
|
||||||
0x00, 0x3C, 0x3C, 0x3C, 0x3C,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00
|
|
||||||
};
|
|
||||||
|
@ -27,101 +27,13 @@ https://github.com/emil01/SparkFun_Micro_OLED_Arduino_Library/
|
|||||||
|
|
||||||
static const unsigned char font8x16[] PROGMEM = {
|
static const unsigned char font8x16[] PROGMEM = {
|
||||||
// first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256)
|
// first row defines - FONTWIDTH, FONTHEIGHT, ASCII START CHAR, TOTAL CHARACTERS, FONT MAP WIDTH HIGH, FONT MAP WIDTH LOW (2,56 meaning 256)
|
||||||
8,16,32,96,2,56,
|
8, 16, 32, 96, 2, 56, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xBE, 0x90, 0xD0, 0xBE, 0x90, 0x00, 0x00, 0x1C, 0x62, 0xFF, 0xC2, 0x80, 0x00, 0x00, 0x0C, 0x12, 0x92, 0x4C, 0xB0, 0x88, 0x06, 0x00, 0x80, 0x7C, 0x62, 0xB2, 0x1C, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x18, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x18, 0xE0, 0x00, 0x00, 0x00, 0x24, 0x18, 0x7E, 0x18, 0x24, 0x00, 0x00, 0x80, 0x80, 0x80, 0xF0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x06, 0x00, 0x00, 0xF8, 0x04, 0xC2, 0x32, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x04, 0x04, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x82, 0x42, 0x22,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00,
|
0x1C, 0x00, 0x00, 0x00, 0x02, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00, 0xC0, 0xA0, 0x98, 0x84, 0xFE, 0x80, 0x80, 0x00, 0x00, 0x1E, 0x12, 0x12, 0x22, 0xC2, 0x00, 0x00, 0xF8, 0x44, 0x22, 0x22, 0x22, 0xC0, 0x00, 0x00, 0x00, 0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x8C, 0x52, 0x22, 0x52, 0x8C, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x26, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00, 0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x02, 0x82, 0x42, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x0F, 0x04, 0x03, 0x00, 0x00, 0x04, 0x02, 0x01, 0x03, 0x04, 0x04, 0x03, 0x00,
|
||||||
0x00, 0x00, 0x0E, 0x00, 0x0E, 0x00, 0x00, 0x00, 0x00, 0xD0, 0xBE, 0x90, 0xD0, 0xBE, 0x90, 0x00,
|
0x03, 0x04, 0x04, 0x04, 0x05, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x08, 0x06, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04,
|
||||||
0x00, 0x1C, 0x62, 0xFF, 0xC2, 0x80, 0x00, 0x00, 0x0C, 0x12, 0x92, 0x4C, 0xB0, 0x88, 0x06, 0x00,
|
0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x04, 0x72, 0x8A, 0xFA, 0x84, 0x78, 0x00, 0x00, 0xC0, 0x38, 0x06, 0x38, 0xC0, 0x00, 0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x22, 0xE2, 0x00, 0x00, 0xFE, 0x20, 0x20, 0x20, 0x20, 0xFE, 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0xFE, 0x40, 0xB0, 0x08, 0x04, 0x02, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00,
|
||||||
0x80, 0x7C, 0x62, 0xB2, 0x1C, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x0E, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0xFE, 0x0C, 0x70, 0x80, 0x70, 0x0C, 0xFE, 0x00, 0xFE, 0x0C, 0x30, 0xC0, 0x00, 0xFE, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, 0xFE, 0x42, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x42, 0x42, 0xA2, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x42, 0x42, 0x80, 0x00, 0x00, 0x02, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x02, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x06, 0x38, 0xC0, 0x00, 0xC0, 0x38, 0x06, 0x00, 0x3E, 0xC0, 0xF0, 0x0E, 0xF0, 0xC0, 0x3E, 0x00, 0x00, 0x06, 0x98, 0x60, 0x98, 0x06, 0x00, 0x00, 0x00, 0x06, 0x18, 0xE0, 0x18, 0x06, 0x00, 0x00, 0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x06, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, 0x40, 0x30, 0x0C, 0x0C, 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
||||||
0x00, 0xE0, 0x18, 0x04, 0x02, 0x02, 0x00, 0x00, 0x00, 0x02, 0x02, 0x04, 0x18, 0xE0, 0x00, 0x00,
|
0x02, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0C, 0x12, 0x11, 0x10, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04,
|
||||||
0x00, 0x24, 0x18, 0x7E, 0x18, 0x24, 0x00, 0x00, 0x80, 0x80, 0x80, 0xF0, 0x80, 0x80, 0x80, 0x00,
|
0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x06, 0x01, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, 0xE0, 0x90, 0x90, 0x90, 0xE0, 0x00, 0x00, 0x00, 0x20, 0xFC, 0x22, 0x22, 0x22, 0x02,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00,
|
0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x80, 0x40, 0x20, 0x10, 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x20, 0x10, 0xF0, 0x20, 0x10, 0xF0, 0x00, 0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x20, 0x10, 0x10, 0x70, 0x00, 0x00, 0x00, 0x60, 0x90, 0x90, 0x90, 0x20, 0x00, 0x00, 0x00, 0x20, 0x20, 0xFC, 0x20, 0x20, 0x20, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x70, 0x80, 0x00, 0x80, 0x70, 0x00, 0x00, 0xF0, 0x00, 0xC0, 0x30, 0xC0, 0x00, 0xF0, 0x00, 0x00, 0x30, 0xC0, 0xC0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0xC0, 0x00, 0x80, 0x70, 0x00, 0x00, 0x00, 0x10,
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x60, 0x18, 0x06, 0x00, 0x00,
|
0x10, 0x90, 0x50, 0x30, 0x00, 0x00, 0x00, 0x80, 0x80, 0x7E, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x7E, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x24, 0x24, 0x22, 0x1F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00, 0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00,
|
||||||
0xF8, 0x04, 0xC2, 0x32, 0x0C, 0xF8, 0x00, 0x00, 0x00, 0x04, 0x04, 0xFE, 0x00, 0x00, 0x00, 0x00,
|
0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x3F, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x3F, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x01, 0x06, 0x01, 0x00, 0x00, 0x06, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x20, 0x20, 0x31, 0x0E, 0x03, 0x00, 0x00, 0x00, 0x00, 0x06, 0x05, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||||
0x00, 0x02, 0x82, 0x42, 0x22, 0x1C, 0x00, 0x00, 0x00, 0x02, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00,
|
|
||||||
0xC0, 0xA0, 0x98, 0x84, 0xFE, 0x80, 0x80, 0x00, 0x00, 0x1E, 0x12, 0x12, 0x22, 0xC2, 0x00, 0x00,
|
|
||||||
0xF8, 0x44, 0x22, 0x22, 0x22, 0xC0, 0x00, 0x00, 0x00, 0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00,
|
|
||||||
0x00, 0x8C, 0x52, 0x22, 0x52, 0x8C, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x26, 0xF8, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x30, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x00, 0x00,
|
|
||||||
0x10, 0x20, 0x20, 0x40, 0x40, 0x80, 0x80, 0x00, 0x00, 0x02, 0x82, 0x42, 0x22, 0x1C, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0x04, 0x0F, 0x04, 0x03, 0x00, 0x00, 0x04, 0x02, 0x01, 0x03, 0x04, 0x04, 0x03, 0x00,
|
|
||||||
0x03, 0x04, 0x04, 0x04, 0x05, 0x03, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x03, 0x06, 0x08, 0x10, 0x10, 0x00, 0x00, 0x00, 0x10, 0x10, 0x08, 0x06, 0x03, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x01, 0x03, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00,
|
|
||||||
0x01, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x16, 0x0E, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x04, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00,
|
|
||||||
0x04, 0x02, 0x02, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0xF8, 0x04, 0x72, 0x8A, 0xFA, 0x84, 0x78, 0x00, 0x00, 0xC0, 0x38, 0x06, 0x38, 0xC0, 0x00, 0x00,
|
|
||||||
0x00, 0xFE, 0x22, 0x22, 0x22, 0xDC, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00,
|
|
||||||
0xFE, 0x02, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00, 0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00,
|
|
||||||
0x00, 0xFE, 0x22, 0x22, 0x22, 0x22, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x22, 0xE2, 0x00, 0x00,
|
|
||||||
0xFE, 0x20, 0x20, 0x20, 0x20, 0xFE, 0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0xFE, 0x40, 0xB0, 0x08, 0x04, 0x02, 0x00, 0x00,
|
|
||||||
0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x0C, 0x70, 0x80, 0x70, 0x0C, 0xFE, 0x00,
|
|
||||||
0xFE, 0x0C, 0x30, 0xC0, 0x00, 0xFE, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00,
|
|
||||||
0xFE, 0x42, 0x42, 0x42, 0x22, 0x1C, 0x00, 0x00, 0xF8, 0x04, 0x02, 0x02, 0x04, 0xF8, 0x00, 0x00,
|
|
||||||
0x00, 0xFE, 0x42, 0x42, 0xA2, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x22, 0x42, 0x42, 0x80, 0x00, 0x00,
|
|
||||||
0x02, 0x02, 0x02, 0xFE, 0x02, 0x02, 0x02, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x00, 0x00,
|
|
||||||
0x06, 0x38, 0xC0, 0x00, 0xC0, 0x38, 0x06, 0x00, 0x3E, 0xC0, 0xF0, 0x0E, 0xF0, 0xC0, 0x3E, 0x00,
|
|
||||||
0x00, 0x06, 0x98, 0x60, 0x98, 0x06, 0x00, 0x00, 0x00, 0x06, 0x18, 0xE0, 0x18, 0x06, 0x00, 0x00,
|
|
||||||
0x02, 0x02, 0xC2, 0x32, 0x0A, 0x06, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x02, 0x02, 0x02, 0x02, 0x00,
|
|
||||||
0x00, 0x06, 0x18, 0x60, 0x80, 0x00, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00,
|
|
||||||
0x40, 0x30, 0x0C, 0x0C, 0x30, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x01, 0x02, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x06, 0x01, 0x01, 0x01, 0x01, 0x01, 0x06, 0x00,
|
|
||||||
0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
|
||||||
0x07, 0x04, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x04, 0x07, 0x00, 0x00,
|
|
||||||
0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x04, 0x04, 0x07, 0x04, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x01, 0x00, 0x00, 0x07, 0x00,
|
|
||||||
0x07, 0x00, 0x00, 0x00, 0x03, 0x07, 0x00, 0x00, 0x01, 0x02, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00,
|
|
||||||
0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x0C, 0x12, 0x11, 0x10, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,
|
|
||||||
0x00, 0x06, 0x01, 0x00, 0x01, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x06, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x10, 0x10, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x00, 0x10, 0x10, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00,
|
|
||||||
0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00,
|
|
||||||
0x00, 0xE0, 0x10, 0x10, 0x10, 0xFE, 0x00, 0x00, 0x00, 0xE0, 0x90, 0x90, 0x90, 0xE0, 0x00, 0x00,
|
|
||||||
0x00, 0x20, 0xFC, 0x22, 0x22, 0x22, 0x02, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00,
|
|
||||||
0x00, 0xFE, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x10, 0x10, 0x10, 0xF2, 0x00, 0x00, 0x00, 0x00, 0xFE, 0x80, 0x40, 0x20, 0x10, 0x00, 0x00,
|
|
||||||
0x00, 0x02, 0x02, 0xFE, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x20, 0x10, 0xF0, 0x20, 0x10, 0xF0, 0x00,
|
|
||||||
0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xE0, 0x00, 0x00,
|
|
||||||
0x00, 0xF0, 0x20, 0x10, 0x10, 0xE0, 0x00, 0x00, 0x00, 0xE0, 0x10, 0x10, 0x10, 0xF0, 0x00, 0x00,
|
|
||||||
0x00, 0xF0, 0x20, 0x10, 0x10, 0x70, 0x00, 0x00, 0x00, 0x60, 0x90, 0x90, 0x90, 0x20, 0x00, 0x00,
|
|
||||||
0x00, 0x20, 0x20, 0xFC, 0x20, 0x20, 0x20, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x00,
|
|
||||||
0x00, 0x70, 0x80, 0x00, 0x80, 0x70, 0x00, 0x00, 0xF0, 0x00, 0xC0, 0x30, 0xC0, 0x00, 0xF0, 0x00,
|
|
||||||
0x00, 0x30, 0xC0, 0xC0, 0x30, 0x00, 0x00, 0x00, 0x00, 0x30, 0xC0, 0x00, 0x80, 0x70, 0x00, 0x00,
|
|
||||||
0x00, 0x10, 0x10, 0x90, 0x50, 0x30, 0x00, 0x00, 0x00, 0x80, 0x80, 0x7E, 0x02, 0x02, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x02, 0x7E, 0x80, 0x80, 0x00, 0x00,
|
|
||||||
0x00, 0x80, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x24, 0x24, 0x22, 0x1F, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x00,
|
|
||||||
0x20, 0x20, 0x20, 0x20, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x01, 0x02, 0x04, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x07, 0x04, 0x04, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00, 0x00, 0x07, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00,
|
|
||||||
0x00, 0x3F, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x3F, 0x00, 0x00,
|
|
||||||
0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x04, 0x04, 0x04, 0x03, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x03, 0x04, 0x04, 0x04, 0x00, 0x00, 0x03, 0x04, 0x04, 0x02, 0x07, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x03, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x06, 0x01, 0x00, 0x01, 0x06, 0x01, 0x00,
|
|
||||||
0x00, 0x06, 0x01, 0x01, 0x06, 0x00, 0x00, 0x00, 0x20, 0x20, 0x31, 0x0E, 0x03, 0x00, 0x00, 0x00,
|
|
||||||
0x00, 0x06, 0x05, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x10, 0x10, 0x00, 0x00,
|
|
||||||
0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x1F, 0x00, 0x00, 0x00, 0x00,
|
|
||||||
0x01, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
|
||||||
};
|
|
||||||
|
@ -58,7 +58,6 @@ static const uint8_t led_mapping[GDISP_SCREEN_HEIGHT][GDISP_SCREEN_WIDTH] = {
|
|||||||
{NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0)},
|
{NA, NA, NA, NA, LA(6, 2), LA(6, 1), LA(6, 0)},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND
|
#define IS31_ADDR_DEFAULT 0x74 // AD connected to GND
|
||||||
#define IS31_TIMEOUT 5000
|
#define IS31_TIMEOUT 5000
|
||||||
|
|
||||||
@ -77,17 +76,14 @@ static GFXINLINE void init_board(GDisplay *g) {
|
|||||||
I2CD1.i2c->FLT = 4;
|
I2CD1.i2c->FLT = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GFXINLINE void post_init_board(GDisplay *g) {
|
static GFXINLINE void post_init_board(GDisplay* g) { (void)g; }
|
||||||
(void) g;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) {
|
static GFXINLINE const uint8_t* get_led_mask(GDisplay* g) {
|
||||||
(void)g;
|
(void)g;
|
||||||
return led_mask;
|
return led_mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y)
|
static GFXINLINE uint8_t get_led_address(GDisplay* g, uint16_t x, uint16_t y) {
|
||||||
{
|
|
||||||
(void)g;
|
(void)g;
|
||||||
return led_mapping[y][x];
|
return led_mapping[y][x];
|
||||||
}
|
}
|
||||||
@ -96,8 +92,7 @@ static GFXINLINE void set_hardware_shutdown(GDisplay* g, bool shutdown) {
|
|||||||
(void)g;
|
(void)g;
|
||||||
if (!shutdown) {
|
if (!shutdown) {
|
||||||
palSetPad(GPIOB, 16);
|
palSetPad(GPIOB, 16);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
palClearPad(GPIOB, 16);
|
palClearPad(GPIOB, 16);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||||||
|
|
||||||
# include "board_is31fl3731c.h"
|
# include "board_is31fl3731c.h"
|
||||||
|
|
||||||
|
|
||||||
// Can't include led_tables from here
|
// Can't include led_tables from here
|
||||||
extern const uint8_t CIE1931_CURVE[];
|
extern const uint8_t CIE1931_CURVE[];
|
||||||
|
|
||||||
@ -160,7 +159,6 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
|||||||
write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE);
|
write_ram(g, IS31_FUNCTIONREG, 0, IS31_FUNCTIONREG_SIZE);
|
||||||
gfxSleepMilliseconds(10);
|
gfxSleepMilliseconds(10);
|
||||||
|
|
||||||
|
|
||||||
// zero all LED registers on all 8 pages, and enable the mask
|
// zero all LED registers on all 8 pages, and enable the mask
|
||||||
__builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE);
|
__builtin_memcpy(PRIV(g)->write_buffer, get_led_mask(g), IS31_LED_MASK_SIZE);
|
||||||
for (uint8_t i = 0; i < 8; i++) {
|
for (uint8_t i = 0; i < 8; i++) {
|
||||||
@ -188,8 +186,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
|||||||
# if GDISP_HARDWARE_FLUSH
|
# if GDISP_HARDWARE_FLUSH
|
||||||
LLDSPEC void gdisp_lld_flush(GDisplay *g) {
|
LLDSPEC void gdisp_lld_flush(GDisplay *g) {
|
||||||
// Don't flush if we don't need it.
|
// Don't flush if we don't need it.
|
||||||
if (!(g->flags & GDISP_FLG_NEEDFLUSH))
|
if (!(g->flags & GDISP_FLG_NEEDFLUSH)) return;
|
||||||
return;
|
|
||||||
|
|
||||||
PRIV(g)->page++;
|
PRIV(g)->page++;
|
||||||
PRIV(g)->page %= 2;
|
PRIV(g)->page %= 2;
|
||||||
@ -256,8 +253,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch (g->p.x) {
|
switch (g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (powermode_t)g->p.ptr) return;
|
||||||
return;
|
|
||||||
switch ((powermode_t)g->p.ptr) {
|
switch ((powermode_t)g->p.ptr) {
|
||||||
case powerOff:
|
case powerOff:
|
||||||
case powerSleep:
|
case powerSleep:
|
||||||
@ -274,8 +270,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
if (g->g.Orientation == (orientation_t)g->p.ptr)
|
if (g->g.Orientation == (orientation_t)g->p.ptr) return;
|
||||||
return;
|
|
||||||
switch ((orientation_t)g->p.ptr) {
|
switch ((orientation_t)g->p.ptr) {
|
||||||
/* Rotation is handled by the drawing routines */
|
/* Rotation is handled by the drawing routines */
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
@ -295,8 +290,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_BACKLIGHT:
|
case GDISP_CONTROL_BACKLIGHT:
|
||||||
if (g->g.Backlight == (unsigned)g->p.ptr)
|
if (g->g.Backlight == (unsigned)g->p.ptr) return;
|
||||||
return;
|
|
||||||
unsigned val = (unsigned)g->p.ptr;
|
unsigned val = (unsigned)g->p.ptr;
|
||||||
g->g.Backlight = val > 100 ? 100 : val;
|
g->g.Backlight = val > 100 ? 100 : val;
|
||||||
g->flags |= GDISP_FLG_NEEDFLUSH;
|
g->flags |= GDISP_FLG_NEEDFLUSH;
|
||||||
|
@ -25,11 +25,9 @@
|
|||||||
#define ST7565_SLCK_PIN 5
|
#define ST7565_SLCK_PIN 5
|
||||||
#define ST7565_SS_PIN 4
|
#define ST7565_SS_PIN 4
|
||||||
|
|
||||||
#define palSetPadModeRaw(portname, bits) \
|
#define palSetPadModeRaw(portname, bits) ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits
|
||||||
ST7565_PORT->PCR[ST7565_##portname##_PIN] = bits
|
|
||||||
|
|
||||||
#define palSetPadModeNamed(portname, portmode) \
|
#define palSetPadModeNamed(portname, portmode) palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode)
|
||||||
palSetPadMode(ST7565_GPIOPORT, ST7565_##portname##_PIN, portmode)
|
|
||||||
|
|
||||||
#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2)
|
#define ST7565_SPI_MODE PORTx_PCRn_DSE | PORTx_PCRn_MUX(2)
|
||||||
// DSPI Clock and Transfer Attributes
|
// DSPI Clock and Transfer Attributes
|
||||||
@ -44,8 +42,7 @@ static const SPIConfig spi1config = {
|
|||||||
// brief The chip select line pad number - when not using pcs.
|
// brief The chip select line pad number - when not using pcs.
|
||||||
.sspad = ST7565_SS_PIN,
|
.sspad = ST7565_SS_PIN,
|
||||||
// SPI initialization data.
|
// SPI initialization data.
|
||||||
.tar0 =
|
.tar0 = SPIx_CTARn_FMSZ(7) // Frame size = 8 bytes
|
||||||
SPIx_CTARn_FMSZ(7) // Frame size = 8 bytes
|
|
||||||
| SPIx_CTARn_ASC(1) // After SCK Delay Scaler (min 50 ns) = 55.56ns
|
| SPIx_CTARn_ASC(1) // After SCK Delay Scaler (min 50 ns) = 55.56ns
|
||||||
| SPIx_CTARn_DT(0) // Delay After Transfer Scaler (no minimum)= 27.78ns
|
| SPIx_CTARn_DT(0) // Delay After Transfer Scaler (no minimum)= 27.78ns
|
||||||
| SPIx_CTARn_CSSCK(0) // PCS to SCK Delay Scaler (min 20 ns) = 27.78ns
|
| SPIx_CTARn_CSSCK(0) // PCS to SCK Delay Scaler (min 20 ns) = 27.78ns
|
||||||
@ -82,28 +79,20 @@ static GFXINLINE void init_board(GDisplay *g) {
|
|||||||
release_bus(g);
|
release_bus(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GFXINLINE void post_init_board(GDisplay *g) {
|
static GFXINLINE void post_init_board(GDisplay *g) { (void)g; }
|
||||||
(void) g;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
|
static GFXINLINE void setpin_reset(GDisplay *g, bool_t state) {
|
||||||
(void)g;
|
(void)g;
|
||||||
if (state) {
|
if (state) {
|
||||||
palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN);
|
palClearPad(ST7565_GPIOPORT, ST7565_RST_PIN);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN);
|
palSetPad(ST7565_GPIOPORT, ST7565_RST_PIN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GFXINLINE void enter_data_mode(GDisplay *g) {
|
static GFXINLINE void enter_data_mode(GDisplay *g) { palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN); }
|
||||||
palSetPad(ST7565_GPIOPORT, ST7565_A0_PIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
static GFXINLINE void enter_cmd_mode(GDisplay *g) {
|
|
||||||
palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
static GFXINLINE void enter_cmd_mode(GDisplay *g) { palClearPad(ST7565_GPIOPORT, ST7565_A0_PIN); }
|
||||||
|
|
||||||
static GFXINLINE void write_data(GDisplay *g, uint8_t *data, uint16_t length) {
|
static GFXINLINE void write_data(GDisplay *g, uint8_t *data, uint16_t length) {
|
||||||
(void)g;
|
(void)g;
|
||||||
|
@ -67,17 +67,24 @@ typedef struct{
|
|||||||
# define PRIV(g) ((PrivData *)g->priv)
|
# define PRIV(g) ((PrivData *)g->priv)
|
||||||
# define RAM(g) (PRIV(g)->ram)
|
# define RAM(g) (PRIV(g)->ram)
|
||||||
|
|
||||||
static GFXINLINE void write_cmd(GDisplay* g, uint8_t cmd) {
|
static GFXINLINE void write_cmd(GDisplay *g, uint8_t cmd) { PRIV(g)->data[PRIV(g)->data_pos++] = cmd; }
|
||||||
PRIV(g)->data[PRIV(g)->data_pos++] = cmd;
|
|
||||||
}
|
|
||||||
|
|
||||||
static GFXINLINE void flush_cmd(GDisplay *g) {
|
static GFXINLINE void flush_cmd(GDisplay *g) {
|
||||||
write_data(g, PRIV(g)->data, PRIV(g)->data_pos);
|
write_data(g, PRIV(g)->data, PRIV(g)->data_pos);
|
||||||
PRIV(g)->data_pos = 0;
|
PRIV(g)->data_pos = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define write_cmd2(g, cmd1, cmd2) { write_cmd(g, cmd1); write_cmd(g, cmd2); }
|
# define write_cmd2(g, cmd1, cmd2) \
|
||||||
#define write_cmd3(g, cmd1, cmd2, cmd3) { write_cmd(g, cmd1); write_cmd(g, cmd2); write_cmd(g, cmd3); }
|
{ \
|
||||||
|
write_cmd(g, cmd1); \
|
||||||
|
write_cmd(g, cmd2); \
|
||||||
|
}
|
||||||
|
# define write_cmd3(g, cmd1, cmd2, cmd3) \
|
||||||
|
{ \
|
||||||
|
write_cmd(g, cmd1); \
|
||||||
|
write_cmd(g, cmd2); \
|
||||||
|
write_cmd(g, cmd3); \
|
||||||
|
}
|
||||||
|
|
||||||
// Some common routines and macros
|
// Some common routines and macros
|
||||||
# define delay(us) gfxSleepMicroseconds(us)
|
# define delay(us) gfxSleepMicroseconds(us)
|
||||||
@ -153,8 +160,7 @@ LLDSPEC void gdisp_lld_flush(GDisplay *g) {
|
|||||||
unsigned p;
|
unsigned p;
|
||||||
|
|
||||||
// Don't flush if we don't need it.
|
// Don't flush if we don't need it.
|
||||||
if (!(g->flags & GDISP_FLG_NEEDFLUSH))
|
if (!(g->flags & GDISP_FLG_NEEDFLUSH)) return;
|
||||||
return;
|
|
||||||
|
|
||||||
acquire_bus(g);
|
acquire_bus(g);
|
||||||
enter_cmd_mode(g);
|
enter_cmd_mode(g);
|
||||||
@ -253,8 +259,7 @@ LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
|
|||||||
uint8_t *dst = &(RAM(g)[xyaddr(dstx, dsty)]);
|
uint8_t *dst = &(RAM(g)[xyaddr(dstx, dsty)]);
|
||||||
if (bitset) {
|
if (bitset) {
|
||||||
*dst |= xybit(dsty);
|
*dst |= xybit(dsty);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
*dst &= ~xybit(dsty);
|
*dst &= ~xybit(dsty);
|
||||||
}
|
}
|
||||||
dstx++;
|
dstx++;
|
||||||
@ -268,8 +273,7 @@ LLDSPEC void gdisp_lld_blit_area(GDisplay *g) {
|
|||||||
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
||||||
switch (g->p.x) {
|
switch (g->p.x) {
|
||||||
case GDISP_CONTROL_POWER:
|
case GDISP_CONTROL_POWER:
|
||||||
if (g->g.Powermode == (powermode_t)g->p.ptr)
|
if (g->g.Powermode == (powermode_t)g->p.ptr) return;
|
||||||
return;
|
|
||||||
switch ((powermode_t)g->p.ptr) {
|
switch ((powermode_t)g->p.ptr) {
|
||||||
case powerOff:
|
case powerOff:
|
||||||
case powerSleep:
|
case powerSleep:
|
||||||
@ -294,8 +298,7 @@ LLDSPEC void gdisp_lld_control(GDisplay *g) {
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
case GDISP_CONTROL_ORIENTATION:
|
case GDISP_CONTROL_ORIENTATION:
|
||||||
if (g->g.Orientation == (orientation_t)g->p.ptr)
|
if (g->g.Orientation == (orientation_t)g->p.ptr) return;
|
||||||
return;
|
|
||||||
switch ((orientation_t)g->p.ptr) {
|
switch ((orientation_t)g->p.ptr) {
|
||||||
/* Rotation is handled by the drawing routines */
|
/* Rotation is handled by the drawing routines */
|
||||||
case GDISP_ROTATE_0:
|
case GDISP_ROTATE_0:
|
||||||
|
1
keyboards/2key2crawl/2key2crawl.c
Normal file
1
keyboards/2key2crawl/2key2crawl.c
Normal file
@ -0,0 +1 @@
|
|||||||
|
#include "2key2crawl.h"
|
12
keyboards/2key2crawl/2key2crawl.h
Normal file
12
keyboards/2key2crawl/2key2crawl.h
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "quantum.h"
|
||||||
|
|
||||||
|
#define LAYOUT( \
|
||||||
|
K00, K01, K02, K03, K15, \
|
||||||
|
K10, K11, K12, K13, K14, K16 \
|
||||||
|
) { \
|
||||||
|
{ K00, K01, K02, K03, KC_NO, KC_NO, KC_NO }, \
|
||||||
|
{ K10, K11, K12, K13, K14, K15, K16 }, \
|
||||||
|
}
|
||||||
|
|
44
keyboards/2key2crawl/config.h
Normal file
44
keyboards/2key2crawl/config.h
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "config_common.h"
|
||||||
|
|
||||||
|
/* USB Device descriptor parameter */
|
||||||
|
#define VENDOR_ID 0xFEED
|
||||||
|
#define PRODUCT_ID 0x6090
|
||||||
|
#define DEVICE_VER 0x0002
|
||||||
|
#define MANUFACTURER WoodKeys.click
|
||||||
|
#define PRODUCT 2Key2Crawl
|
||||||
|
#define DESCRIPTION ATX Keycrawl 2018
|
||||||
|
|
||||||
|
/* key matrix size */
|
||||||
|
#define MATRIX_ROWS 2
|
||||||
|
#define MATRIX_COLS 7
|
||||||
|
|
||||||
|
/* key matrix pins */
|
||||||
|
#define MATRIX_ROW_PINS { C4, C5 }
|
||||||
|
#define MATRIX_COL_PINS { B3, B4, B5, B6, B7, C7, B2 }
|
||||||
|
#define UNUSED_PINS
|
||||||
|
|
||||||
|
|
||||||
|
#define ENCODERS_PAD_A { D0 }
|
||||||
|
#define ENCODERS_PAD_B { D1 }
|
||||||
|
#define ENCODER_RESOLUTION 1
|
||||||
|
|
||||||
|
/* COL2ROW or ROW2COL */
|
||||||
|
#define DIODE_DIRECTION COL2ROW
|
||||||
|
|
||||||
|
/* Set 0 if debouncing isn't needed */
|
||||||
|
#define DEBOUNCE 5
|
||||||
|
|
||||||
|
/* Mechanical locking support. Use KC_LCAP, KC_LNUM or KC_LSCR instead in keymap */
|
||||||
|
#define LOCKING_SUPPORT_ENABLE
|
||||||
|
|
||||||
|
/* Locking resynchronize hack */
|
||||||
|
#define LOCKING_RESYNC_ENABLE
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef RGBLIGHT_ENABLE
|
||||||
|
#define RGB_DI_PIN C6
|
||||||
|
#define RGBLIGHT_ANIMATIONS
|
||||||
|
#define RGBLED_NUM 3
|
||||||
|
#endif
|
28
keyboards/2key2crawl/keymaps/default/keymap.c
Normal file
28
keyboards/2key2crawl/keymaps/default/keymap.c
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||||
|
KC_6, KC_7, KC_8, KC_9, KC_0, KC_ENTER),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
debug_config.matrix = 1;
|
||||||
|
debug_config.keyboard = 1;
|
||||||
|
debug_config.enable = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void encoder_update_user(int8_t index, bool clockwise) {
|
||||||
|
if (index == 0) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_PGUP);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_PGDN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
26
keyboards/2key2crawl/keymaps/tabs/keymap.c
Normal file
26
keyboards/2key2crawl/keymaps/tabs/keymap.c
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||||
|
KC_6, KC_7, KC_8, KC_9, KC_0, KC_ENTER),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
debug_config.matrix = 1;
|
||||||
|
debug_config.keyboard = 1;
|
||||||
|
debug_config.enable = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void encoder_update_user(int8_t index, bool clockwise) {
|
||||||
|
if (index == 0) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code16(C(KC_T));
|
||||||
|
} else {
|
||||||
|
tap_code16(C(KC_W));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
25
keyboards/2key2crawl/keymaps/vol/keymap.c
Normal file
25
keyboards/2key2crawl/keymaps/vol/keymap.c
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
|
||||||
|
LAYOUT(
|
||||||
|
KC_1, KC_2, KC_3, KC_4, KC_5,
|
||||||
|
KC_6, KC_7, KC_8, KC_9, KC_0, KC_ENTER),
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
void matrix_init_user(void) {
|
||||||
|
debug_config.matrix = 1;
|
||||||
|
debug_config.keyboard = 1;
|
||||||
|
debug_config.enable = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void encoder_update_user(int8_t index, bool clockwise) {
|
||||||
|
if (index == 0) {
|
||||||
|
if (clockwise) {
|
||||||
|
tap_code(KC_VOLU);
|
||||||
|
} else {
|
||||||
|
tap_code(KC_VOLD);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
keyboards/2key2crawl/readme.md
Normal file
16
keyboards/2key2crawl/readme.md
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
# 2Key2CrawlPad
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
A 2x5 macropad/numpad with a rotary encoder, exclusively available at Austin Keycrawl 2018 (12-01-2018).
|
||||||
|
|
||||||
|
Keyboard Maintainer: QMK Community
|
||||||
|
Keyboard Designer: [Cole Markham](https://github.com/colemarkham)
|
||||||
|
Hardware Supported: Crawlpad
|
||||||
|
Hardware Availability: Exclusive to Keycrawl events, contact [awwwwwwyeaahhhhhh](https://www.reddit.com/user/awwwwwwyeaahhhhhh) for more details.
|
||||||
|
|
||||||
|
Make example for this keyboard (after setting up your build environment):
|
||||||
|
|
||||||
|
make 2key2crawl:default
|
||||||
|
|
||||||
|
See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_tools) and the [make instructions](https://docs.qmk.fm/#/getting_started_make_guide) for more information. Brand new to QMK? Start with our [Complete Newbs Guide](https://docs.qmk.fm/#/newbs).
|
29
keyboards/2key2crawl/rules.mk
Normal file
29
keyboards/2key2crawl/rules.mk
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# MCU name
|
||||||
|
MCU = atmega32u2
|
||||||
|
|
||||||
|
|
||||||
|
# Bootloader selection
|
||||||
|
# Teensy halfkay
|
||||||
|
# Pro Micro caterina
|
||||||
|
# Atmel DFU atmel-dfu
|
||||||
|
# LUFA DFU lufa-dfu
|
||||||
|
# QMK DFU qmk-dfu
|
||||||
|
# atmega32a bootloadHID
|
||||||
|
BOOTLOADER = atmel-dfu
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# Build Options
|
||||||
|
# comment out to disable the options.
|
||||||
|
#
|
||||||
|
BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000)
|
||||||
|
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
|
||||||
|
EXTRAKEY_ENABLE = no # Audio control and System control(+450)
|
||||||
|
CONSOLE_ENABLE = yes # Console for debug(+400)
|
||||||
|
COMMAND_ENABLE = no # Commands for debug and configuration
|
||||||
|
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
|
||||||
|
NKRO_ENABLE = no # USB Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
|
||||||
|
BACKLIGHT_ENABLE = no # [Crawlpad] Custom backlighting code is used, so this should not be enabled
|
||||||
|
AUDIO_ENABLE = no # [Crawlpad] This can be enabled if a speaker is connected to the expansion port. Not compatible with RGBLIGHT below
|
||||||
|
RGBLIGHT_ENABLE = no # [Crawlpad] This can be enabled if a ws2812 strip is connected to the expansion port.
|
||||||
|
ENCODER_ENABLE = yes # [2Key2crawl] Make the knobs turn
|
@ -18,46 +18,24 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
void matrix_init_user(void) {
|
void keyboard_pre_init_user(void) {
|
||||||
}
|
// Call the keyboard pre init code.
|
||||||
|
|
||||||
void matrix_scan_user(void) {
|
// Set our LED pins as output
|
||||||
}
|
setPinOutput(D5);
|
||||||
|
setPinOutput(B0);
|
||||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void led_set_user(uint8_t usb_led) {
|
void led_set_user(uint8_t usb_led) {
|
||||||
|
if (IS_LED_ON(usb_led, USB_LED_NUM_LOCK)) {
|
||||||
if (usb_led & (1 << USB_LED_NUM_LOCK)) {
|
writePinLow(D5);
|
||||||
DDRD |= (1 << 5); PORTD &= ~(1 << 5);
|
|
||||||
} else {
|
} else {
|
||||||
DDRD &= ~(1 << 5); PORTD &= ~(1 << 5);
|
writePinHigh(D5);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usb_led & (1 << USB_LED_CAPS_LOCK)) {
|
if (IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)) {
|
||||||
DDRB |= (1 << 0); PORTB &= ~(1 << 0);
|
writePinLow(B0);
|
||||||
} else {
|
} else {
|
||||||
DDRB &= ~(1 << 0); PORTB &= ~(1 << 0);
|
writePinHigh(B0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (usb_led & (1 << USB_LED_SCROLL_LOCK)) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (usb_led & (1 << USB_LED_COMPOSE)) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (usb_led & (1 << USB_LED_KANA)) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
3
keyboards/40percentclub/mf68/keymaps/emdarcher/config.h
Normal file
3
keyboards/40percentclub/mf68/keymaps/emdarcher/config.h
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#define GRAVE_ESC_ALT_OVERRIDE
|
55
keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c
Normal file
55
keyboards/40percentclub/mf68/keymaps/emdarcher/keymap.c
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
#include QMK_KEYBOARD_H
|
||||||
|
|
||||||
|
#define _QWERTY 0
|
||||||
|
#define _FN1 1
|
||||||
|
#define _FN2 2
|
||||||
|
#define X0 LT(_FN2, KC_CAPS)
|
||||||
|
#define X1 MO(_FN1)
|
||||||
|
|
||||||
|
|
||||||
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
|
/* Default layer */
|
||||||
|
[_QWERTY] = LAYOUT_68_ansi(
|
||||||
|
KC_GESC, KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_MINS, KC_EQL, KC_BSPC, KC_INS ,KC_PGUP,
|
||||||
|
KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_LBRC,KC_RBRC, KC_BSLS, KC_DEL ,KC_PGDN,
|
||||||
|
X0 , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN,KC_QUOT, KC_ENTER,
|
||||||
|
KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M ,KC_COMM,KC_DOT ,KC_SLSH, KC_RSFT, KC_UP ,
|
||||||
|
KC_LCTL ,KC_LALT ,KC_LGUI , KC_SPACE , X1 ,KC_RALT ,KC_RCTL , KC_LEFT,KC_DOWN,KC_RGHT
|
||||||
|
),
|
||||||
|
/* FN Layer */
|
||||||
|
[_FN1] = LAYOUT_68_ansi(
|
||||||
|
KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 , KC_BSPC, _______,KC_HOME,
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_PSCR,KC_SLCK,KC_PAUS,_______, _______,KC_END,
|
||||||
|
X0 ,_______,_______,_______,_______,_______,_______,_______,_______,_______,KC_MRWD,KC_MFFD, _______,
|
||||||
|
_______ ,_______,KC_MPLY,KC_MSTP,KC_MPRV,KC_MNXT,KC_VOLD,KC_VOLU,KC_MUTE,_______,_______, _______, _______,
|
||||||
|
_______ ,_______ ,_______ , _______, _______,_______,_______, _______,_______,_______
|
||||||
|
),
|
||||||
|
|
||||||
|
/* CAPS LOCK layer */
|
||||||
|
[_FN2] = LAYOUT_68_ansi(
|
||||||
|
KC_GRV , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 ,KC_F10 ,KC_F11 ,KC_F12 , KC_BSPC, KC_VOLU,KC_HOME,
|
||||||
|
_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_VOLD,KC_END,
|
||||||
|
_______,_______,_______,_______,_______,_______,KC_LEFT,KC_DOWN, KC_UP ,KC_RGHT,_______,_______, _______,
|
||||||
|
_______ ,_______,_______,_______,_______,_______,_______,_______,_______,_______,_______, _______, KC_MUTE,
|
||||||
|
_______ ,_______ ,_______ , _______, _______,_______,_______, KC_MPRV,KC_MPLY,KC_MNXT
|
||||||
|
)
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void led_set_user(uint8_t usb_led){
|
||||||
|
//turn on the Pro Micro's on board LEDs for CAPS LOCK
|
||||||
|
if(IS_LED_ON(usb_led, USB_LED_CAPS_LOCK)){
|
||||||
|
//set led pins to low
|
||||||
|
setPinOutput(B0);
|
||||||
|
writePinLow(B0);
|
||||||
|
setPinOutput(B5);
|
||||||
|
writePinLow(B5);
|
||||||
|
} else {
|
||||||
|
//set to Hi-Z
|
||||||
|
setPinInput(B0);
|
||||||
|
writePinLow(B0);
|
||||||
|
setPinInput(B5);
|
||||||
|
writePinLow(B5);
|
||||||
|
}
|
||||||
|
}
|
13
keyboards/40percentclub/mf68/keymaps/emdarcher/readme.md
Normal file
13
keyboards/40percentclub/mf68/keymaps/emdarcher/readme.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# emdarcher's MF68 Layout
|
||||||
|
|
||||||
|
A layout mostly based off the factory layout, but with some modifications. Designed for use in a MAC or Unix environment, and has some VIM inspiration.
|
||||||
|
|
||||||
|
- Utilizes the Pro Micro's on board LED's to show the CAPS LOCK status.
|
||||||
|
- Added Caps Lock for an extra FN layer with VIM like control on hjlk keys.
|
||||||
|
- Made the ESC key use GESC for functionality for Grave and Tilde with shift or GUI modifiers.
|
||||||
|
- Added Print Screen, Scroll Lock, and Pause keys on P,[,] keys to add Mac screen brightness control.
|
||||||
|
* On Mac, Scroll Lock is Brightness Down and Pause is Brightness Up, so with this FN+[ = brighness down, FN+] = brightness up
|
||||||
|
- Has Mac Fast-forward and Rewind keys mapped for changing media tracks. FN+; = Rewind, FN+' = Fast-forward
|
||||||
|
- Moved LGUI to the default MAC Command key position.
|
||||||
|
|
||||||
|
Note: By default, this keymap doesn't utilize the backlighting.
|
3
keyboards/40percentclub/mf68/keymaps/emdarcher/rules.mk
Normal file
3
keyboards/40percentclub/mf68/keymaps/emdarcher/rules.mk
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
BACKLIGHT_ENABLE = no
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user