Compare commits
48 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
d7754a19b9 | ||
![]() |
3a3de84e40 | ||
![]() |
c22f3ba3a2 | ||
![]() |
cc5c6b449a | ||
![]() |
40e67a3074 | ||
![]() |
85022f8bb5 | ||
![]() |
9e4ac6cf29 | ||
![]() |
d5bc7fc157 | ||
![]() |
a08be85780 | ||
![]() |
1e6797b4e7 | ||
![]() |
ce465c084b | ||
![]() |
54f18ce0f7 | ||
![]() |
9841c64de9 | ||
![]() |
6471273149 | ||
![]() |
31b75c75fd | ||
![]() |
8cd6cfcb77 | ||
![]() |
918a52da61 | ||
![]() |
9a05c5d787 | ||
![]() |
6b4549da8c | ||
![]() |
7d8c629939 | ||
![]() |
562c0d702a | ||
![]() |
503e02db79 | ||
![]() |
10cc423515 | ||
![]() |
d30d5eeb27 | ||
![]() |
039dde3a51 | ||
![]() |
7cb8d3c7a7 | ||
![]() |
b5b119544a | ||
![]() |
cce8dfab39 | ||
![]() |
14ed96aa06 | ||
![]() |
5b7fc758d7 | ||
![]() |
574fc6444b | ||
![]() |
4d8733591f | ||
![]() |
123608fb31 | ||
![]() |
d0b691df0e | ||
![]() |
3949ab322d | ||
![]() |
39ca330f10 | ||
![]() |
c9ba618654 | ||
![]() |
d977daa8dc | ||
![]() |
2bb2977c13 | ||
![]() |
47c91fc7f7 | ||
![]() |
a55c838961 | ||
![]() |
e8e6268765 | ||
![]() |
4db27a2c76 | ||
![]() |
3cf7f7322c | ||
![]() |
ac9b88e8cc | ||
![]() |
714e0da960 | ||
![]() |
c796944354 | ||
![]() |
2758158a4b |
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
31
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -2,30 +2,31 @@
|
||||
name: Bug report
|
||||
about: Create a report to help us improve the QMK Firmware
|
||||
---
|
||||
<!-- Provide a general summary of the bug in the Title above -->
|
||||
<!-- Provide a general summary of the bug in the title above. -->
|
||||
|
||||
<!-- This template is entirely option and can be removed, but is here to help both you and us. -->
|
||||
<!-- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. -->
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
||||
**Describe the bug**
|
||||
## Describe the Bug
|
||||
|
||||
<!-- A clear and concise description of what the bug is. -->
|
||||
|
||||
**System Information**
|
||||
## System Information
|
||||
|
||||
- Keyboard:
|
||||
- Revision (if applicable):
|
||||
- Operating System:
|
||||
- avr-gcc version:
|
||||
<!-- Run `avr-gcc --version` to find out -->
|
||||
- arm gcc version:
|
||||
<!-- Run `arm-none-eabi-gcc --version` to find out -->
|
||||
- Operating system:
|
||||
- AVR GCC version:
|
||||
<!-- Run `avr-gcc --version` to find this out. -->
|
||||
- ARM GCC version:
|
||||
<!-- Run `arm-none-eabi-gcc --version` to find this out. -->
|
||||
- QMK Firmware version:
|
||||
<!-- You can run `git describe --abbrev=0 --tags` to find this out -->
|
||||
<!-- Run `git describe --abbrev=0 --tags` to find this out. -->
|
||||
- Any keyboard related software installed?
|
||||
- [ ] Auto Hot Key
|
||||
- [ ] AutoHotKey
|
||||
- [ ] Karabiner
|
||||
- [ ] Other
|
||||
- [ ] Other:
|
||||
|
||||
**Additional context**
|
||||
## Additional Context
|
||||
|
||||
<!-- Add any other context about the problem here. -->
|
||||
<!-- Add any other relevant information about the problem here. -->
|
||||
|
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
16
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -2,18 +2,18 @@
|
||||
name: Feature request
|
||||
about: Suggest a new feature or changes to existing features
|
||||
---
|
||||
<!--- Provide a general summary of the changes you want in the Title above -->
|
||||
<!--- Provide a general summary of the changes you want in the title above. -->
|
||||
|
||||
<!-- This template is entirely option and can be removed, but is here to help both you and us. -->
|
||||
<!-- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. -->
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
||||
## Feature Request Type
|
||||
|
||||
- [ ] Core Functionality
|
||||
- [ ] Add-on hardware support (e.g. audio, RGB, OLED screen, etc.)
|
||||
- [ ] Alteration (enhancement/optimization) of existing Feature(s)
|
||||
- [ ] Core functionality
|
||||
- [ ] Add-on hardware support (eg. audio, RGB, OLED screen, etc.)
|
||||
- [ ] Alteration (enhancement/optimization) of existing feature(s)
|
||||
- [ ] New behavior
|
||||
|
||||
## Description
|
||||
## Description
|
||||
|
||||
<!-- A few sentences describing what it is that you'd like to see. Additional information (such as links to spec sheets, licensing info, other related issues or PR's, etc) would be helpful. -->
|
||||
<!-- A few sentences describing what it is that you'd like to see in QMK. Additional information (such as links to spec sheets, licensing info, other related issues or PRs, etc) would be helpful. -->
|
||||
|
6
.github/ISSUE_TEMPLATE/other_issues.md
vendored
6
.github/ISSUE_TEMPLATE/other_issues.md
vendored
@@ -2,8 +2,8 @@
|
||||
name: Other issues
|
||||
about: Anything else that doesn't fall into the above categories.
|
||||
---
|
||||
<!--- Provide a general summary of the changes you want in the Title above -->
|
||||
<!--- Provide a general summary of the changes you want in the title above. -->
|
||||
|
||||
<!-- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. -->
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
||||
<!-- Please check https://docs.qmk.fm/#/support for additional resources first. If that doesn't answer your question, check the bug report option, as that may be more appropriate. -->
|
||||
<!-- Please check https://docs.qmk.fm/#/support for additional resources first. If that doesn't answer your question, choose the bug report template instead, as that may be more appropriate. -->
|
||||
|
28
.github/PULL_REQUEST_TEMPLATE.md
vendored
28
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,32 +1,34 @@
|
||||
<!--- Provide a general summary of your changes in the Title above -->
|
||||
<!--- Provide a general summary of your changes in the title above. -->
|
||||
|
||||
<!--- This template is entirely option and can be removed, but is here to help both you and us. -->
|
||||
<!--- This text and anything on lines wrapped like this one will not show up in the final text. This text is to help us and you. -->
|
||||
<!--- This template is entirely optional and can be removed, but is here to help both you and us. -->
|
||||
<!--- Anything on lines wrapped in comments like these will not show up in the final text. -->
|
||||
|
||||
## Description
|
||||
<!--- Describe your changes in detail -->
|
||||
|
||||
## Types of changes
|
||||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
|
||||
<!--- Describe your changes in detail here. -->
|
||||
|
||||
## Types of Changes
|
||||
|
||||
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply. -->
|
||||
- [ ] Core
|
||||
- [ ] Bugfix
|
||||
- [ ] New Feature
|
||||
- [ ] Enhancement/Optimization
|
||||
- [ ] New feature
|
||||
- [ ] Enhancement/optimization
|
||||
- [ ] Keyboard (addition or update)
|
||||
- [ ] Keymap/Layout/Userspace (addition or update)
|
||||
- [ ] Keymap/layout/userspace (addition or update)
|
||||
- [ ] Documentation
|
||||
|
||||
|
||||
## Issues Fixed or Closed by this PR
|
||||
## Issues Fixed or Closed by This PR
|
||||
|
||||
*
|
||||
|
||||
## Checklist:
|
||||
## Checklist
|
||||
|
||||
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
|
||||
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
|
||||
- [ ] My code follows the code style of this project.
|
||||
- [ ] My change requires a change to the documentation.
|
||||
- [ ] I have updated the documentation accordingly.
|
||||
- [ ] I have read the **CONTRIBUTING** document. (https://docs.qmk.fm/#/contributing)
|
||||
- [ ] I have read the [**CONTRIBUTING** document](https://docs.qmk.fm/#/contributing).
|
||||
- [ ] I have added tests to cover my changes.
|
||||
- [ ] I have tested the changes and verified that they work and don't break anything (as well as I can manage).
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.history/
|
||||
.dep
|
||||
*.o
|
||||
*.bin
|
||||
|
@@ -135,6 +135,10 @@ ifeq ($(strip $(CONVERT_TO_PROTON_C)), yes)
|
||||
OPT_DEFS += -DCONVERT_TO_PROTON_C
|
||||
endif
|
||||
|
||||
ifneq ($(FORCE_LAYOUT),)
|
||||
TARGET := $(TARGET)_$(FORCE_LAYOUT)
|
||||
endif
|
||||
|
||||
include quantum/mcu_selection.mk
|
||||
|
||||
ifdef MCU_FAMILY
|
||||
@@ -371,4 +375,5 @@ all: build check-size
|
||||
build: elf cpfirmware
|
||||
check-size: build
|
||||
|
||||
include show_options.mk
|
||||
include $(TMK_PATH)/rules.mk
|
||||
|
@@ -15,4 +15,13 @@ define SEARCH_LAYOUTS
|
||||
$$(foreach LAYOUTS_REPO,$$(LAYOUTS_REPOS),$$(eval $$(call SEARCH_LAYOUTS_REPO)))
|
||||
endef
|
||||
|
||||
ifneq ($(FORCE_LAYOUT),)
|
||||
ifneq (,$(findstring $(FORCE_LAYOUT),$(LAYOUTS)))
|
||||
$(info Forcing layout: $(FORCE_LAYOUT))
|
||||
LAYOUTS := $(FORCE_LAYOUT)
|
||||
else
|
||||
$(error Forced layout does not exist)
|
||||
endif
|
||||
endif
|
||||
|
||||
$(foreach LAYOUT,$(LAYOUTS),$(eval $(call SEARCH_LAYOUTS)))
|
@@ -282,10 +282,20 @@ ifneq ($(strip $(CUSTOM_MATRIX)), yes)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Include the standard debounce code if needed
|
||||
ifneq ($(strip $(CUSTOM_DEBOUNCE)), yes)
|
||||
QUANTUM_SRC += $(QUANTUM_DIR)/debounce.c
|
||||
DEBOUNCE_DIR:= $(QUANTUM_DIR)/debounce
|
||||
# Debounce Modules. If implemented in matrix.c, don't use these.
|
||||
DEBOUNCE_TYPE?= sym_g
|
||||
VALID_DEBOUNCE_TYPES := sym_g eager_pk custom
|
||||
ifeq ($(filter $(DEBOUNCE_TYPE),$(VALID_DEBOUNCE_TYPES)),)
|
||||
$(error DEBOUNCE_TYPE="$(DEBOUNCE_TYPE)" is not a valid debounce algorithm)
|
||||
endif
|
||||
ifeq ($(strip $(DEBOUNCE_TYPE)), sym_g)
|
||||
QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c
|
||||
else ifeq ($(strip $(DEBOUNCE_TYPE)), eager_pk)
|
||||
QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_eager_pk.c
|
||||
endif
|
||||
|
||||
|
||||
|
||||
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
|
||||
OPT_DEFS += -DSPLIT_KEYBOARD
|
||||
|
@@ -165,18 +165,35 @@ In addition, it is possible to specify the brightness level of all LEDs with `er
|
||||
|
||||
Ergodox boards also define `LED_BRIGHTNESS_LO` for the lowest brightness and `LED_BRIGHTNESS_HI` for the highest brightness (which is the default).
|
||||
|
||||
# Matrix Initialization Code
|
||||
# Keyboard Initialization Code
|
||||
|
||||
Before a keyboard can be used the hardware must be initialized. QMK handles initialization of the keyboard matrix itself, but if you have other hardware like LEDs or i²c controllers you will need to set up that hardware before it can be used.
|
||||
There are several steps in the keyboard initialization process. Depending on what you want to do, it will influence which function you should use.
|
||||
|
||||
These are the three main initialization functions, listed in the order that they're called.
|
||||
|
||||
### Example `matrix_init_user()` Implementation
|
||||
* `keyboard_pre_init_*` - Happens before most anything is started. Good for hardware setup that you want running very early.
|
||||
* `matrix_init_*` - Happens midway through the firmware's startup process. Hardware is initialized, but features may not be yet.
|
||||
* `keyboard_post_init_*` - Happens at the end of the firmware's startup process. This is where you'd want to put "customization" code, for the most part.
|
||||
|
||||
!> For most people, the `keyboard_post_init_user` function is what you want to call. For instance, this is where you want to set up things for RGB Underglow.
|
||||
|
||||
## Keyboard Pre Initialization code
|
||||
|
||||
This runs very early during startup, even before the USB has been started.
|
||||
|
||||
Shortly after this, the matrix is initialized.
|
||||
|
||||
For most users, this shouldn't be used, as it's primarily for hardware oriented initialization.
|
||||
|
||||
However, if you have hardware stuff that you need initialized, this is the best place for it (such as initializing LED pins).
|
||||
|
||||
### Example `keyboard_pre_init_user()` Implementation
|
||||
|
||||
This example, at the keyboard level, sets up B1, B2, and B3 as LED pins.
|
||||
|
||||
```c
|
||||
void matrix_init_user(void) {
|
||||
// Call the keymap level matrix init.
|
||||
void keyboard_pre_init_user(void) {
|
||||
// Call the keyboard pre init code.
|
||||
|
||||
// Set our LED pins as output
|
||||
DDRB |= (1<<1);
|
||||
@@ -185,11 +202,47 @@ void matrix_init_user(void) {
|
||||
}
|
||||
```
|
||||
|
||||
### `keyboard_pre_init_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void keyboard_pre_init_kb(void)`
|
||||
* Keymap: `void keyboard_pre_init_user(void)`
|
||||
|
||||
## Matrix Initialization Code
|
||||
|
||||
This is called when the matrix is initialized, and after some of the hardware has been set up, but before many of the features have been initialized.
|
||||
|
||||
This is useful for setting up stuff that you may need elsewhere, but isn't hardware related nor is dependant on where it's started.
|
||||
|
||||
|
||||
### `matrix_init_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void matrix_init_kb(void)`
|
||||
* Keymap: `void matrix_init_user(void)`
|
||||
|
||||
|
||||
## Keyboard Post Initialization code
|
||||
|
||||
This is ran as the very last task in the keyboard initialization process. This is useful if you want to make changes to certain features, as they should be initialized by this point.
|
||||
|
||||
|
||||
### Example `keyboard_post_init_user()` Implementation
|
||||
|
||||
This example, running after everything else has initialized, sets up the rgb underglow configuration.
|
||||
|
||||
```c
|
||||
void keyboard_post_init_user(void) {
|
||||
// Call the post init code.
|
||||
rgblight_enable_noeeprom(); // enables Rgb, without saving settings
|
||||
rgblight_sethsv_noeeprom(180, 255, 255): // sets the color to teal/cyan without saving
|
||||
rgblight_mode_noeeprom(RGBLIGHT_MODE_BREATHING + 3); // sets mode to Fast breathing without saving
|
||||
}
|
||||
```
|
||||
|
||||
### `keyboard_post_init_*` Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void keyboard_post_init_kb(void)`
|
||||
* Keymap: `void keyboard_post_init_user(void)`
|
||||
|
||||
# Matrix Scanning Code
|
||||
|
||||
Whenever possible you should customize your keyboard by using `process_record_*()` and hooking into events that way, to ensure that your code does not have a negative performance impact on your keyboard. However, in rare cases it is necessary to hook into the matrix scanning. Be extremely careful with the performance of code in these functions, as it will be called at least 10 times per second.
|
||||
@@ -229,10 +282,9 @@ void suspend_wakeup_init_user(void)
|
||||
{
|
||||
rgb_matrix_set_suspend_state(false);
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
### `keyboard_init_*` Function Documentation
|
||||
### Keyboard suspend/wake Function Documentation
|
||||
|
||||
* Keyboard/Revision: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)`
|
||||
* Keymap: `void suspend_power_down_kb(void)` and `void suspend_wakeup_init_user(void)`
|
||||
@@ -285,7 +337,7 @@ Keep in mind that EEPROM has a limited number of writes. While this is very high
|
||||
|
||||
* If you don't understand the example, then you may want to avoid using this feature, as it is rather complicated.
|
||||
|
||||
### Example Implementation
|
||||
### Example Implementation
|
||||
|
||||
This is an example of how to add settings, and read and write it. We're using the user keymap for the example here. This is a complex function, and has a lot going on. In fact, it uses a lot of the above functions to work!
|
||||
|
||||
|
46
docs/feature_debounce_type.md
Normal file
46
docs/feature_debounce_type.md
Normal file
@@ -0,0 +1,46 @@
|
||||
# Debounce algorithm
|
||||
|
||||
QMK supports multiple debounce algorithms through its debounce API.
|
||||
|
||||
The underlying debounce algorithm is determined by which matrix.c file you are using.
|
||||
|
||||
The logic for which debounce method called is below. It checks various defines that you have set in rules.mk
|
||||
|
||||
```
|
||||
DEBOUNCE_TYPE?= sym_g
|
||||
VALID_DEBOUNCE_TYPES := sym_g eager_pk custom
|
||||
ifeq ($(filter $(DEBOUNCE_TYPE),$(VALID_DEBOUNCE_TYPES)),)
|
||||
$(error DEBOUNCE_TYPE="$(DEBOUNCE_TYPE)" is not a valid debounce algorithm)
|
||||
endif
|
||||
ifeq ($(strip $(DEBOUNCE_TYPE)), sym_g)
|
||||
QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_sym_g.c
|
||||
else ifeq ($(strip $(DEBOUNCE_TYPE)), eager_pk)
|
||||
QUANTUM_SRC += $(DEBOUNCE_DIR)/debounce_eager_pk.c
|
||||
endif
|
||||
```
|
||||
|
||||
# Debounce selection
|
||||
|
||||
| DEBOUNCE_ALGO | Description | What to do |
|
||||
| ------------- | --------------------------------------------------- | ----------------------------- |
|
||||
| Not defined | You are using the included matrix.c and debounce.c | Nothing. Debounce_sym_g will be compiled, and used if necessary |
|
||||
| custom | Use your own debounce.c | ```SRC += debounce.c``` add your own debounce.c and implement necessary functions |
|
||||
| sym_g / eager_pk | You are using the included matrix.c and debounce.c | Use an alternative debounce algorithm |
|
||||
|
||||
**Regarding split keyboards**:
|
||||
The debounce code is compatible with split keyboards.
|
||||
|
||||
# Use your own debouncing code
|
||||
* Set ```DEBOUNCE_TYPE = custom ```.
|
||||
* Add ```SRC += debounce.c```
|
||||
* Add your own ```debounce.c```. Look at included ```debounce_sym_g.c```s for sample implementations.
|
||||
* Debouncing occurs after every raw matrix scan.
|
||||
* Use num_rows rather than MATRIX_ROWS, so that split keyboards are supported correctly.
|
||||
|
||||
# Changing between included debouncing methods
|
||||
You can either use your own code, by including your own debounce.c, or switch to another included one.
|
||||
Included debounce methods are:
|
||||
* debounce_eager_pk - debouncing per key. On any state change, response is immediate, followed by ```DEBOUNCE_DELAY``` millseconds of no further input for that key
|
||||
* debounce_sym_g - debouncing per keyboard. On any state change, a global timer is set. When ```DEBOUNCE_DELAY``` milliseconds of no changes has occured, all input changes are pushed.
|
||||
|
||||
|
@@ -51,6 +51,35 @@ The folder name must be added to the keyboard's `rules.mk`:
|
||||
|
||||
but the `LAYOUT_<layout>` variable must be defined in `<folder>.h` as well.
|
||||
|
||||
## Building a Keymap
|
||||
|
||||
You should be able to build the keyboard keymap with a command in this format:
|
||||
|
||||
make <keyboard>:<layout>
|
||||
|
||||
### Conflicting layouts
|
||||
When a keyboard supports multiple layout options,
|
||||
|
||||
LAYOUTS = ortho_4x4 ortho_4x12
|
||||
|
||||
And a layout exists for both options,
|
||||
```
|
||||
layouts/
|
||||
+ community/
|
||||
| + ortho_4x4/
|
||||
| | + <layout>/
|
||||
| | | + ...
|
||||
| + ortho_4x12/
|
||||
| | + <layout>/
|
||||
| | | + ...
|
||||
| + ...
|
||||
```
|
||||
|
||||
The FORCE_LAYOUT argument can be used to specify which layout to build
|
||||
|
||||
make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x4
|
||||
make <keyboard>:<layout> FORCE_LAYOUT=ortho_4x12
|
||||
|
||||
## Tips for Making Layouts Keyboard-Agnostic
|
||||
|
||||
### Includes
|
||||
|
@@ -28,6 +28,7 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "micro_oled.h"
|
||||
#include <print.h>
|
||||
#include <stdlib.h>
|
||||
#include "util/font5x7.h"
|
||||
#include "util/font8x16.h"
|
||||
@@ -309,12 +310,11 @@ static uint8_t micro_oled_screen_buffer[] = {
|
||||
#else
|
||||
//catchall for custom screen szies
|
||||
static uint8_t micro_oled_screen_buffer[LCDWIDTH*LCDWIDTH/8] = {0};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
void micro_oled_init(void) {
|
||||
|
||||
i2c_init();
|
||||
i2c_start(I2C_ADDRESS_SA0_1);
|
||||
|
||||
|
@@ -1,6 +1,10 @@
|
||||
#include QMK_KEYBOARD_H
|
||||
|
||||
#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT))
|
||||
|
||||
enum custom_keycodes {
|
||||
SFT_ESC = SAFE_RANGE
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
@@ -13,7 +17,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
* via the function actions code at the bottom.
|
||||
*/
|
||||
LAYOUT(
|
||||
F(0), 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_NO, KC_BSPC,
|
||||
SFT_ESC,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_NO, KC_BSPC,
|
||||
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_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT,
|
||||
KC_LSFT, KC_NO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_NO,
|
||||
@@ -34,21 +38,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
SHIFT_ESC,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_FUNCTION(SHIFT_ESC),
|
||||
};
|
||||
|
||||
void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
static uint8_t shift_esc_shift_mask;
|
||||
switch (id) {
|
||||
case SHIFT_ESC:
|
||||
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK;
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
switch (keycode) {
|
||||
case SFT_ESC:
|
||||
if (record->event.pressed) {
|
||||
if (shift_esc_shift_mask) {
|
||||
if (get_mods() & MODS_SHIFT_MASK) {
|
||||
add_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
@@ -56,7 +50,7 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
send_keyboard_report();
|
||||
}
|
||||
} else {
|
||||
if (shift_esc_shift_mask) {
|
||||
if (get_mods() & MODS_SHIFT_MASK) {
|
||||
del_key(KC_GRV);
|
||||
send_keyboard_report();
|
||||
} else {
|
||||
@@ -64,6 +58,10 @@ void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) {
|
||||
send_keyboard_report();
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
return false;
|
||||
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@@ -45,7 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
KC_ESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,\
|
||||
KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_ENT,\
|
||||
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH,\
|
||||
KC_LCTL, KC_LGUI, KC_LALT, F(0), F(1), F(2), KC_RALT, KC_RCTL \
|
||||
KC_LCTL, KC_LGUI, KC_LALT, LT(_LOWER, KC_SPC),LT(_RAISE, KC_SPC),LT(_ADJUST, KC_LGUI), KC_RALT, KC_RCTL \
|
||||
),
|
||||
|
||||
/* Function Layer 1 HHKB style
|
||||
@@ -106,24 +106,6 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
enum function_id {
|
||||
LAUNCH,
|
||||
RGBLED_TOGGLE,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[0] = ACTION_LAYER_TAP_KEY(_LOWER, KC_SPC),
|
||||
[1] = ACTION_LAYER_TAP_KEY(_RAISE, KC_SPC),
|
||||
[2] = ACTION_LAYER_TAP_KEY(_ADJUST, KC_LGUI),
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
|
@@ -111,21 +111,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[_SFX] = LAYOUT_iso_splitrshift(
|
||||
RESET, _______, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, _______, _______, _______, KC_BSPC, \
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_4, KC_5, KC_6, _______, _______, _______, KC_BSLS, \
|
||||
_______, F(2), F(3), _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \
|
||||
_______, F(4), F(5), F(6), F(7), F(8), F(9), _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \
|
||||
_______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, _______, _______, XXXXXXX, KC_ENT, \
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, KC_0, _______, KC_SLSH, KC_UP, _______, \
|
||||
_______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT),
|
||||
};
|
||||
|
||||
enum function_id {
|
||||
LAUNCH,
|
||||
RGBLED_TOGGLE,
|
||||
};
|
||||
|
||||
const uint16_t PROGMEM fn_actions[] = {
|
||||
[1] = ACTION_FUNCTION(LAUNCH),
|
||||
[10] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_ENT),
|
||||
};
|
||||
|
||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||
{
|
||||
// MACRODOWN only works in this function
|
||||
|
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This file has been automatically generated using ChibiStudio board
|
||||
* generator plugin. Do not edit manually.
|
||||
*/
|
||||
|
||||
#include "hal.h"
|
||||
|
||||
#if HAL_USE_PAL || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief PAL setup.
|
||||
* @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.
|
||||
*/
|
||||
const PALConfig pal_default_config = {
|
||||
#if STM32_HAS_GPIOA
|
||||
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
|
||||
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOB
|
||||
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
|
||||
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOC
|
||||
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
|
||||
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOD
|
||||
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
|
||||
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOE
|
||||
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
|
||||
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOF
|
||||
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
|
||||
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOG
|
||||
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
|
||||
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOH
|
||||
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
|
||||
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
|
||||
#endif
|
||||
#if STM32_HAS_GPIOI
|
||||
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
|
||||
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
|
||||
#endif
|
||||
};
|
||||
#endif
|
||||
|
||||
void enter_bootloader_mode_if_requested(void);
|
||||
|
||||
/**
|
||||
* @brief Early initialization code.
|
||||
* @details This initialization must be performed just after stack setup
|
||||
* and before any other initialization.
|
||||
*/
|
||||
void __early_init(void) {
|
||||
enter_bootloader_mode_if_requested();
|
||||
stm32_clock_init();
|
||||
}
|
||||
|
||||
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
|
||||
/**
|
||||
* @brief MMC_SPI card detection.
|
||||
*/
|
||||
bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
|
||||
|
||||
(void)mmcp;
|
||||
/* TODO: Fill the implementation.*/
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief MMC_SPI card write protection detection.
|
||||
*/
|
||||
bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
|
||||
|
||||
(void)mmcp;
|
||||
/* TODO: Fill the implementation.*/
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Board-specific initialization code.
|
||||
* @todo Add your board-specific code, if any.
|
||||
*/
|
||||
void boardInit(void) {
|
||||
SYSCFG->CFGR1 |= SYSCFG_CFGR1_I2C1_DMA_RMP;
|
||||
SYSCFG->CFGR1 &= ~(SYSCFG_CFGR1_SPI2_DMA_RMP);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
# List of all the board related files.
|
||||
BOARDSRC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY/board.c
|
||||
|
||||
# Required include directories
|
||||
BOARDINC = $(BOARD_PATH)/boards/ST_STM32F072B_DISCOVERY
|
File diff suppressed because it is too large
Load Diff
7
keyboards/cannonkeys/satisfaction75/bootloader_defs.h
Normal file
7
keyboards/cannonkeys/satisfaction75/bootloader_defs.h
Normal file
@@ -0,0 +1,7 @@
|
||||
/* Address for jumping to bootloader on STM32 chips. */
|
||||
/* It is chip dependent, the correct number can be looked up here (page 175):
|
||||
* http://www.st.com/web/en/resource/technical/document/application_note/CD00167594.pdf
|
||||
* This also requires a patch to chibios:
|
||||
* <tmk_dir>/tmk_core/tool/chibios/ch-bootloader-jump.patch
|
||||
*/
|
||||
#define STM32_BOOTLOADER_ADDRESS 0x1FFFC800
|
524
keyboards/cannonkeys/satisfaction75/chconf.h
Normal file
524
keyboards/cannonkeys/satisfaction75/chconf.h
Normal file
File diff suppressed because it is too large
Load Diff
107
keyboards/cannonkeys/satisfaction75/config.h
Normal file
107
keyboards/cannonkeys/satisfaction75/config.h
Normal file
@@ -0,0 +1,107 @@
|
||||
/*
|
||||
Copyright 2015 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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/>.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* USB Device descriptor parameter */
|
||||
#define VENDOR_ID 0xCA04
|
||||
#define PRODUCT_ID 0x57F5
|
||||
#define DEVICE_VER 0x0001
|
||||
/* in python2: list(u"whatever".encode('utf-16-le')) */
|
||||
/* at most 32 characters or the ugly hack in usb_main.c borks */
|
||||
#define MANUFACTURER QMK
|
||||
#define PRODUCT Satisfaction75
|
||||
#define DESCRIPTION Satisfaction 75 Keyboard
|
||||
|
||||
/* key matrix size */
|
||||
#define MATRIX_ROWS 6
|
||||
#define MATRIX_COLS 16
|
||||
|
||||
#define MATRIX_COL_PINS { B1, B2, B10, B11, B12, B13, B14, A8, A9, A10, B0, A7, A5, B5, A15, A1 }
|
||||
#define MATRIX_ROW_PINS { B3, B4, A0, A2, A4, A3 }
|
||||
#define DIODE_DIRECTION COL2ROW
|
||||
|
||||
#define NUMBER_OF_ENCODERS 1
|
||||
#define ENCODERS_PAD_A { B9 }
|
||||
#define ENCODERS_PAD_B { B8 }
|
||||
|
||||
//LEDS A6, RGB B15
|
||||
#define BACKLIGHT_LEVELS 24
|
||||
#define BACKLIGHT_BREATHING
|
||||
#define BREATHING_PERIOD 6
|
||||
|
||||
/* define if matrix has ghost */
|
||||
//#define MATRIX_HAS_GHOST
|
||||
|
||||
|
||||
/* 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 QWIIC_MICRO_OLED_ENABLE
|
||||
|
||||
#undef I2C_ADDRESS_SA0_1
|
||||
#define I2C_ADDRESS_SA0_1 0b0111100
|
||||
#define LCDWIDTH 128
|
||||
#define LCDHEIGHT 32
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#define DYNAMIC_KEYMAP_LAYER_COUNT 4
|
||||
|
||||
// EEPROM usage
|
||||
|
||||
// TODO: refactor with new user EEPROM code (coming soon)
|
||||
#define EEPROM_MAGIC 0x451F
|
||||
#define EEPROM_MAGIC_ADDR 32
|
||||
// Bump this every time we change what we store
|
||||
// This will automatically reset the EEPROM with defaults
|
||||
// and avoid loading invalid data from the EEPROM
|
||||
#define EEPROM_VERSION 0x02
|
||||
#define EEPROM_VERSION_ADDR 34
|
||||
|
||||
// Dynamic keymap starts after EEPROM version
|
||||
#define DYNAMIC_KEYMAP_EEPROM_ADDR 35
|
||||
// Dynamic macro starts after dynamic keymaps (35+(4*6*16*2)) = (35+768)
|
||||
#define DYNAMIC_KEYMAP_MACRO_EEPROM_ADDR 803
|
||||
#define DYNAMIC_KEYMAP_MACRO_EEPROM_SIZE 221
|
||||
#define DYNAMIC_KEYMAP_MACRO_COUNT 16
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Feature disable options
|
||||
* These options are also useful to firmware size reduction.
|
||||
*/
|
||||
|
||||
/* disable debug print */
|
||||
//#define NO_DEBUG
|
||||
|
||||
/* disable print */
|
||||
//#define NO_PRINT
|
||||
|
||||
/* disable action features */
|
||||
//#define NO_ACTION_LAYER
|
||||
//#define NO_ACTION_TAPPING
|
||||
//#define NO_ACTION_ONESHOT
|
||||
//#define NO_ACTION_MACRO
|
||||
//#define NO_ACTION_FUNCTION
|
354
keyboards/cannonkeys/satisfaction75/halconf.h
Normal file
354
keyboards/cannonkeys/satisfaction75/halconf.h
Normal file
File diff suppressed because it is too large
Load Diff
116
keyboards/cannonkeys/satisfaction75/i2c_master.c
Normal file
116
keyboards/cannonkeys/satisfaction75/i2c_master.c
Normal file
@@ -0,0 +1,116 @@
|
||||
/* Copyright 2018 Jack Humbert
|
||||
* Copyright 2018 Yiancar
|
||||
*
|
||||
* 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/>.
|
||||
*/
|
||||
|
||||
/* This library is only valid for STM32 processors.
|
||||
* This library follows the convention of the AVR i2c_master library.
|
||||
* As a result addresses are expected to be already shifted (addr << 1).
|
||||
* I2CD1 is the default driver which corresponds to pins B6 and B7. This
|
||||
* can be changed.
|
||||
* Please ensure that HAL_USE_I2C is TRUE in the halconf.h file and that
|
||||
* STM32_I2C_USE_I2C1 is TRUE in the mcuconf.h file. Pins B6 and B7 are used
|
||||
* but using any other I2C pins should be trivial.
|
||||
*/
|
||||
|
||||
#include "i2c_master.h"
|
||||
#include "quantum.h"
|
||||
#include <string.h>
|
||||
#include <hal.h>
|
||||
#include "chtypes.h"
|
||||
#include "ch.h"
|
||||
|
||||
static uint8_t i2c_address;
|
||||
|
||||
// This configures the I2C clock to 400khz assuming a 48Mhz clock
|
||||
// For more info : https://www.st.com/en/embedded-software/stsw-stm32126.html
|
||||
static const I2CConfig i2cconfig = {
|
||||
STM32_TIMINGR_PRESC(0x00U) |
|
||||
STM32_TIMINGR_SCLDEL(0x03U) | STM32_TIMINGR_SDADEL(0x01U) |
|
||||
STM32_TIMINGR_SCLH(0x03U) | STM32_TIMINGR_SCLL(0x09U),
|
||||
0,
|
||||
0
|
||||
};
|
||||
|
||||
__attribute__ ((weak))
|
||||
void i2c_init(void)
|
||||
{
|
||||
// Try releasing special pins for a short time
|
||||
palSetPadMode(GPIOB, 6, PAL_MODE_INPUT);
|
||||
palSetPadMode(GPIOB, 7, PAL_MODE_INPUT);
|
||||
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
palSetPadMode(GPIOB, 6, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||
palSetPadMode(GPIOB, 7, PAL_MODE_ALTERNATE(1) | PAL_STM32_OTYPE_OPENDRAIN);
|
||||
|
||||
//i2cInit(); //This is invoked by halInit() so no need to redo it.
|
||||
}
|
||||
|
||||
// This is usually not needed
|
||||
uint8_t i2c_start(uint8_t address)
|
||||
{
|
||||
i2c_address = address;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8_t i2c_transmit(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
msg_t status = MSG_OK;
|
||||
|
||||
i2c_address = address;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
i2cAcquireBus(&I2C_DRIVER);
|
||||
status = i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, 0, 0, MS2ST(timeout));
|
||||
i2cReleaseBus(&I2C_DRIVER);
|
||||
return status;
|
||||
}
|
||||
|
||||
uint8_t i2c_receive(uint8_t address, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = address;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
return i2cMasterReceiveTimeout(&I2C_DRIVER, (i2c_address >> 1), data, length, MS2ST(timeout));
|
||||
}
|
||||
|
||||
uint8_t i2c_writeReg(uint8_t devaddr, uint8_t regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = devaddr;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
|
||||
uint8_t complete_packet[length + 1];
|
||||
for(uint8_t i = 0; i < length; i++)
|
||||
{
|
||||
complete_packet[i+1] = data[i];
|
||||
}
|
||||
complete_packet[0] = regaddr;
|
||||
|
||||
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), complete_packet, length + 1, 0, 0, MS2ST(timeout));
|
||||
}
|
||||
|
||||
uint8_t i2c_readReg(uint8_t devaddr, uint8_t* regaddr, uint8_t* data, uint16_t length, uint16_t timeout)
|
||||
{
|
||||
i2c_address = devaddr;
|
||||
i2cStart(&I2C_DRIVER, &i2cconfig);
|
||||
return i2cMasterTransmitTimeout(&I2C_DRIVER, (i2c_address >> 1), regaddr, 1, data, length, MS2ST(timeout));
|
||||
}
|
||||
|
||||
// This is usually not needed. It releases the driver to allow pins to become GPIO again.
|
||||
uint8_t i2c_stop(uint16_t timeout)
|
||||
{
|
||||
i2cStop(&I2C_DRIVER);
|
||||
return 0;
|
||||
}
|
37
keyboards/cannonkeys/satisfaction75/keymaps/default/keymap.c
Normal file
37
keyboards/cannonkeys/satisfaction75/keymaps/default/keymap.c
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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 QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_default(
|
||||
KC_ESC, 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_GRV, 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, ENC_PRESS,
|
||||
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_CAPS, 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_PGUP,
|
||||
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_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
[1] = LAYOUT_default(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
49
keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c
Normal file
49
keyboards/cannonkeys/satisfaction75/keymaps/via/keymap.c
Normal file
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
Copyright 2012,2013 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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 QMK_KEYBOARD_H
|
||||
|
||||
const uint16_t keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||
[0] = LAYOUT_default(
|
||||
KC_ESC, 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_GRV, 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, ENC_PRESS,
|
||||
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_CAPS, 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_PGUP,
|
||||
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_PGDN,
|
||||
KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, KC_RALT, MO(1), KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT
|
||||
),
|
||||
[1] = LAYOUT_default(
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, OLED_TOGG,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLOCK_SET,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
||||
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
||||
)
|
||||
};
|
||||
|
||||
void matrix_init_user(void) {
|
||||
//user initialization
|
||||
}
|
||||
|
||||
void matrix_scan_user(void) {
|
||||
//user matrix
|
||||
}
|
||||
|
||||
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||
return true;
|
||||
}
|
5
keyboards/cannonkeys/satisfaction75/keymaps/via/rules.mk
Normal file
5
keyboards/cannonkeys/satisfaction75/keymaps/via/rules.mk
Normal file
@@ -0,0 +1,5 @@
|
||||
# rules.mk overrides to enable VIA
|
||||
|
||||
RAW_ENABLE = yes
|
||||
DYNAMIC_KEYMAP_ENABLE = yes
|
||||
|
240
keyboards/cannonkeys/satisfaction75/led.c
Normal file
240
keyboards/cannonkeys/satisfaction75/led.c
Normal file
@@ -0,0 +1,240 @@
|
||||
/*
|
||||
Copyright 2012 Jun Wako <wakojun@gmail.com>
|
||||
|
||||
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 "hal.h"
|
||||
#include "led_custom.h"
|
||||
#include "satisfaction75.h"
|
||||
#include "printf.h"
|
||||
|
||||
static void breathing_callback(PWMDriver *pwmp);
|
||||
|
||||
static PWMConfig pwmCFG = {
|
||||
0xFFFF, /* PWM clock frequency */
|
||||
256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
|
||||
NULL, /* No Callback */
|
||||
{
|
||||
{PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */
|
||||
{PWM_OUTPUT_DISABLED, NULL},
|
||||
{PWM_OUTPUT_DISABLED, NULL},
|
||||
{PWM_OUTPUT_DISABLED, NULL}
|
||||
},
|
||||
0, /* HW dependent part.*/
|
||||
0
|
||||
};
|
||||
|
||||
static PWMConfig pwmCFG_breathing = {
|
||||
0xFFFF, /* 10kHz PWM clock frequency */
|
||||
256, /* PWM period (in ticks) 1S (1/10kHz=0.1mS 0.1ms*10000 ticks=1S) */
|
||||
breathing_callback, /* Breathing Callback */
|
||||
{
|
||||
{PWM_OUTPUT_ACTIVE_HIGH, NULL}, /* Enable Channel 0 */
|
||||
{PWM_OUTPUT_DISABLED, NULL},
|
||||
{PWM_OUTPUT_DISABLED, NULL},
|
||||
{PWM_OUTPUT_DISABLED, NULL}
|
||||
},
|
||||
0, /* HW dependent part.*/
|
||||
0
|
||||
};
|
||||
|
||||
// See http://jared.geek.nz/2013/feb/linear-led-pwm
|
||||
static uint16_t cie_lightness(uint16_t v) {
|
||||
if (v <= 5243) // if below 8% of max
|
||||
return v / 9; // same as dividing by 900%
|
||||
else {
|
||||
uint32_t y = (((uint32_t) v + 10486) << 8) / (10486 + 0xFFFFUL); // add 16% of max and compare
|
||||
// to get a useful result with integer division, we shift left in the expression above
|
||||
// and revert what we've done again after squaring.
|
||||
y = y * y * y >> 8;
|
||||
if (y > 0xFFFFUL) // prevent overflow
|
||||
return 0xFFFFU;
|
||||
else
|
||||
return (uint16_t) y;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void backlight_init_ports(void) {
|
||||
palSetPadMode(GPIOA, 6, PAL_MODE_ALTERNATE(1));
|
||||
pwmStart(&PWMD3, &pwmCFG);
|
||||
if(kb_backlight_config.enable){
|
||||
if(kb_backlight_config.breathing){
|
||||
breathing_enable();
|
||||
} else{
|
||||
backlight_set(kb_backlight_config.level);
|
||||
}
|
||||
} else {
|
||||
backlight_set(0);
|
||||
}
|
||||
}
|
||||
|
||||
void backlight_set(uint8_t level) {
|
||||
uint32_t duty = (uint32_t)(cie_lightness(0xFFFF * (uint32_t) level / BACKLIGHT_LEVELS));
|
||||
if (level == 0) {
|
||||
// Turn backlight off
|
||||
pwmDisableChannel(&PWMD3, 0);
|
||||
} else {
|
||||
// Turn backlight on
|
||||
if(!is_breathing()){
|
||||
pwmEnableChannel(&PWMD3, 0, PWM_FRACTION_TO_WIDTH(&PWMD3,0xFFFF,duty));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
uint8_t backlight_tick = 0;
|
||||
|
||||
void backlight_task(void) {
|
||||
}
|
||||
|
||||
#define BREATHING_NO_HALT 0
|
||||
#define BREATHING_HALT_OFF 1
|
||||
#define BREATHING_HALT_ON 2
|
||||
#define BREATHING_STEPS 128
|
||||
|
||||
static uint8_t breathing_period = BREATHING_PERIOD;
|
||||
static uint8_t breathing_halt = BREATHING_NO_HALT;
|
||||
static uint16_t breathing_counter = 0;
|
||||
|
||||
bool is_breathing(void) {
|
||||
return PWMD3.config == &pwmCFG_breathing;
|
||||
}
|
||||
|
||||
#define breathing_min() do {breathing_counter = 0;} while (0)
|
||||
#define breathing_max() do {breathing_counter = breathing_period * 256 / 2;} while (0)
|
||||
|
||||
|
||||
void breathing_interrupt_enable(void){
|
||||
pwmStop(&PWMD3);
|
||||
pwmStart(&PWMD3, &pwmCFG_breathing);
|
||||
chSysLockFromISR();
|
||||
pwmEnablePeriodicNotification(&PWMD3);
|
||||
pwmEnableChannelI(
|
||||
&PWMD3,
|
||||
0,
|
||||
PWM_FRACTION_TO_WIDTH(
|
||||
&PWMD3,
|
||||
0xFFFF,
|
||||
0xFFFF
|
||||
)
|
||||
);
|
||||
chSysUnlockFromISR();
|
||||
}
|
||||
|
||||
void breathing_interrupt_disable(void){
|
||||
pwmStop(&PWMD3);
|
||||
pwmStart(&PWMD3, &pwmCFG);
|
||||
}
|
||||
|
||||
void breathing_enable(void)
|
||||
{
|
||||
breathing_counter = 0;
|
||||
breathing_halt = BREATHING_NO_HALT;
|
||||
breathing_interrupt_enable();
|
||||
}
|
||||
|
||||
void breathing_pulse(void)
|
||||
{
|
||||
if (kb_backlight_config.level == 0)
|
||||
breathing_min();
|
||||
else
|
||||
breathing_max();
|
||||
breathing_halt = BREATHING_HALT_ON;
|
||||
breathing_interrupt_enable();
|
||||
}
|
||||
|
||||
void breathing_disable(void)
|
||||
{
|
||||
breathing_interrupt_disable();
|
||||
// Restore backlight level
|
||||
backlight_set(kb_backlight_config.level);
|
||||
}
|
||||
|
||||
void breathing_self_disable(void)
|
||||
{
|
||||
if (kb_backlight_config.level == 0)
|
||||
breathing_halt = BREATHING_HALT_OFF;
|
||||
else
|
||||
breathing_halt = BREATHING_HALT_ON;
|
||||
}
|
||||
|
||||
void breathing_toggle(void) {
|
||||
if (is_breathing()){
|
||||
breathing_disable();
|
||||
} else {
|
||||
breathing_enable();
|
||||
}
|
||||
}
|
||||
|
||||
void breathing_period_set(uint8_t value)
|
||||
{
|
||||
if (!value)
|
||||
value = 1;
|
||||
breathing_period = value;
|
||||
}
|
||||
|
||||
void breathing_period_default(void) {
|
||||
breathing_period_set(BREATHING_PERIOD);
|
||||
}
|
||||
|
||||
void breathing_period_inc(void)
|
||||
{
|
||||
breathing_period_set(breathing_period+1);
|
||||
}
|
||||
|
||||
void breathing_period_dec(void)
|
||||
{
|
||||
breathing_period_set(breathing_period-1);
|
||||
}
|
||||
|
||||
/* To generate breathing curve in python:
|
||||
* from math import sin, pi; [int(sin(x/128.0*pi)**4*255) for x in range(128)]
|
||||
*/
|
||||
static const uint8_t breathing_table[BREATHING_STEPS] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 3, 4, 5, 6, 8, 10, 12, 15, 17, 20, 24, 28, 32, 36, 41, 46, 51, 57, 63, 70, 76, 83, 91, 98, 106, 113, 121, 129, 138, 146, 154, 162, 170, 178, 185, 193, 200, 207, 213, 220, 225, 231, 235, 240, 244, 247, 250, 252, 253, 254, 255, 254, 253, 252, 250, 247, 244, 240, 235, 231, 225, 220, 213, 207, 200, 193, 185, 178, 170, 162, 154, 146, 138, 129, 121, 113, 106, 98, 91, 83, 76, 70, 63, 57, 51, 46, 41, 36, 32, 28, 24, 20, 17, 15, 12, 10, 8, 6, 5, 4, 3, 2, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
|
||||
|
||||
// Use this before the cie_lightness function.
|
||||
static inline uint16_t scale_backlight(uint16_t v) {
|
||||
return v / BACKLIGHT_LEVELS * kb_backlight_config.level;
|
||||
}
|
||||
|
||||
static void breathing_callback(PWMDriver *pwmp)
|
||||
{
|
||||
(void)pwmp;
|
||||
uint16_t interval = (uint16_t) breathing_period * 256 / BREATHING_STEPS;
|
||||
// resetting after one period to prevent ugly reset at overflow.
|
||||
breathing_counter = (breathing_counter + 1) % (breathing_period * 256);
|
||||
uint8_t index = breathing_counter / interval % BREATHING_STEPS;
|
||||
|
||||
if (((breathing_halt == BREATHING_HALT_ON) && (index == BREATHING_STEPS / 2)) ||
|
||||
((breathing_halt == BREATHING_HALT_OFF) && (index == BREATHING_STEPS - 1)))
|
||||
{
|
||||
breathing_interrupt_disable();
|
||||
}
|
||||
|
||||
uint32_t duty = cie_lightness(scale_backlight(breathing_table[index] * 256));
|
||||
|
||||
chSysLockFromISR();
|
||||
pwmEnableChannelI(
|
||||
&PWMD3,
|
||||
0,
|
||||
PWM_FRACTION_TO_WIDTH(
|
||||
&PWMD3,
|
||||
0xFFFF,
|
||||
duty
|
||||
)
|
||||
);
|
||||
chSysUnlockFromISR();
|
||||
}
|
5
keyboards/cannonkeys/satisfaction75/led_custom.h
Normal file
5
keyboards/cannonkeys/satisfaction75/led_custom.h
Normal file
@@ -0,0 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
void backlight_task(void);
|
||||
void breathing_interrupt_disable(void);
|
||||
void breathing_interrupt_enable(void);
|
176
keyboards/cannonkeys/satisfaction75/mcuconf.h
Normal file
176
keyboards/cannonkeys/satisfaction75/mcuconf.h
Normal file
@@ -0,0 +1,176 @@
|
||||
/*
|
||||
ChibiOS - Copyright (C) 2006..2015 Giovanni Di Sirio
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _MCUCONF_H_
|
||||
#define _MCUCONF_H_
|
||||
|
||||
/*
|
||||
* STM32F0xx drivers configuration.
|
||||
* The following settings override the default settings present in
|
||||
* the various device driver implementation headers.
|
||||
* Note that the settings for each driver only have effect if the whole
|
||||
* driver is enabled in halconf.h.
|
||||
*
|
||||
* IRQ priorities:
|
||||
* 3...0 Lowest...Highest.
|
||||
*
|
||||
* DMA priorities:
|
||||
* 0...3 Lowest...Highest.
|
||||
*/
|
||||
|
||||
#define STM32F0xx_MCUCONF
|
||||
// #define STM32F070xB
|
||||
|
||||
/*
|
||||
* HAL driver system settings.
|
||||
*/
|
||||
#define STM32_NO_INIT FALSE
|
||||
#define STM32_PVD_ENABLE FALSE
|
||||
#define STM32_PLS STM32_PLS_LEV0
|
||||
#define STM32_HSI_ENABLED TRUE
|
||||
#define STM32_HSI14_ENABLED TRUE
|
||||
#define STM32_HSI48_ENABLED FALSE
|
||||
#define STM32_LSI_ENABLED TRUE
|
||||
#define STM32_HSE_ENABLED FALSE
|
||||
#define STM32_LSE_ENABLED TRUE
|
||||
#define STM32_SW STM32_SW_PLL
|
||||
#define STM32_PLLSRC STM32_PLLSRC_HSI_DIV2
|
||||
#define STM32_PREDIV_VALUE 1
|
||||
#define STM32_PLLMUL_VALUE 12
|
||||
#define STM32_HPRE STM32_HPRE_DIV1
|
||||
#define STM32_PPRE STM32_PPRE_DIV1
|
||||
#define STM32_ADCSW STM32_ADCSW_HSI14
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_MCOSEL STM32_MCOSEL_NOCLOCK
|
||||
#define STM32_ADCPRE STM32_ADCPRE_DIV4
|
||||
#define STM32_ADCSW STM32_ADCSW_HSI14
|
||||
#define STM32_USBSW STM32_USBSW_HSI48
|
||||
#define STM32_CECSW STM32_CECSW_HSI
|
||||
#define STM32_I2C1SW STM32_I2C1SW_HSI
|
||||
#define STM32_USART1SW STM32_USART1SW_PCLK
|
||||
#define STM32_RTCSEL STM32_RTCSEL_LSE
|
||||
|
||||
/*
|
||||
* ADC driver system settings.
|
||||
*/
|
||||
#define STM32_ADC_USE_ADC1 FALSE
|
||||
#define STM32_ADC_ADC1_DMA_PRIORITY 2
|
||||
#define STM32_ADC_IRQ_PRIORITY 2
|
||||
#define STM32_ADC_ADC1_DMA_IRQ_PRIORITY 2
|
||||
|
||||
/*
|
||||
* EXT driver system settings.
|
||||
*/
|
||||
#define STM32_EXT_EXTI0_1_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI2_3_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI4_15_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI16_IRQ_PRIORITY 3
|
||||
#define STM32_EXT_EXTI17_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* GPT driver system settings.
|
||||
*/
|
||||
#define STM32_GPT_USE_TIM1 FALSE
|
||||
#define STM32_GPT_USE_TIM2 FALSE
|
||||
#define STM32_GPT_USE_TIM3 FALSE
|
||||
#define STM32_GPT_USE_TIM14 FALSE
|
||||
#define STM32_GPT_TIM1_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM2_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM3_IRQ_PRIORITY 2
|
||||
#define STM32_GPT_TIM14_IRQ_PRIORITY 2
|
||||
|
||||
/*
|
||||
* I2C driver system settings.
|
||||
*/
|
||||
#define STM32_I2C_USE_I2C1 TRUE
|
||||
#define STM32_I2C_USE_I2C2 FALSE
|
||||
#define STM32_I2C_BUSY_TIMEOUT 50
|
||||
#define STM32_I2C_I2C1_IRQ_PRIORITY 3
|
||||
#define STM32_I2C_I2C2_IRQ_PRIORITY 3
|
||||
#define STM32_I2C_USE_DMA TRUE
|
||||
#define STM32_I2C_I2C1_DMA_PRIORITY 1
|
||||
#define STM32_I2C_I2C2_DMA_PRIORITY 1
|
||||
#define STM32_I2C_I2C1_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 7)
|
||||
#define STM32_I2C_I2C1_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 6)
|
||||
#define STM32_I2C_DMA_ERROR_HOOK(i2cp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ICU driver system settings.
|
||||
*/
|
||||
#define STM32_ICU_USE_TIM1 FALSE
|
||||
#define STM32_ICU_USE_TIM2 FALSE
|
||||
#define STM32_ICU_USE_TIM3 FALSE
|
||||
#define STM32_ICU_TIM1_IRQ_PRIORITY 3
|
||||
#define STM32_ICU_TIM2_IRQ_PRIORITY 3
|
||||
#define STM32_ICU_TIM3_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* PWM driver system settings.
|
||||
*/
|
||||
#define STM32_PWM_USE_ADVANCED FALSE
|
||||
#define STM32_PWM_USE_TIM1 FALSE
|
||||
#define STM32_PWM_USE_TIM2 FALSE
|
||||
#define STM32_PWM_USE_TIM3 TRUE
|
||||
#define STM32_PWM_TIM1_IRQ_PRIORITY 3
|
||||
#define STM32_PWM_TIM2_IRQ_PRIORITY 3
|
||||
#define STM32_PWM_TIM3_IRQ_PRIORITY 3
|
||||
|
||||
/*
|
||||
* SERIAL driver system settings.
|
||||
*/
|
||||
#define STM32_SERIAL_USE_USART1 FALSE
|
||||
#define STM32_SERIAL_USE_USART2 FALSE
|
||||
#define STM32_SERIAL_USART1_PRIORITY 3
|
||||
#define STM32_SERIAL_USART2_PRIORITY 3
|
||||
|
||||
/*
|
||||
* SPI driver system settings.
|
||||
*/
|
||||
#define STM32_SPI_USE_SPI1 FALSE
|
||||
#define STM32_SPI_USE_SPI2 TRUE
|
||||
#define STM32_SPI_SPI1_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI2_DMA_PRIORITY 1
|
||||
#define STM32_SPI_SPI1_IRQ_PRIORITY 2
|
||||
#define STM32_SPI_SPI2_IRQ_PRIORITY 2
|
||||
#define STM32_SPI_SPI2_RX_DMA_STREAM STM32_DMA_STREAM_ID(1, 4)
|
||||
#define STM32_SPI_SPI2_TX_DMA_STREAM STM32_DMA_STREAM_ID(1, 5)
|
||||
#define STM32_SPI_DMA_ERROR_HOOK(spip) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* ST driver system settings.
|
||||
*/
|
||||
#define STM32_ST_IRQ_PRIORITY 2
|
||||
#define STM32_ST_USE_TIMER 2
|
||||
|
||||
/*
|
||||
* UART driver system settings.
|
||||
*/
|
||||
#define STM32_UART_USE_USART1 FALSE
|
||||
#define STM32_UART_USE_USART2 FALSE
|
||||
#define STM32_UART_USART1_IRQ_PRIORITY 3
|
||||
#define STM32_UART_USART2_IRQ_PRIORITY 3
|
||||
#define STM32_UART_USART1_DMA_PRIORITY 0
|
||||
#define STM32_UART_USART2_DMA_PRIORITY 0
|
||||
#define STM32_UART_DMA_ERROR_HOOK(uartp) osalSysHalt("DMA failure")
|
||||
|
||||
/*
|
||||
* USB driver system settings.
|
||||
*/
|
||||
#define STM32_USB_USE_USB1 TRUE
|
||||
#define STM32_USB_LOW_POWER_ON_SUSPEND FALSE
|
||||
#define STM32_USB_USB1_LP_IRQ_PRIORITY 3
|
||||
|
||||
#endif /* _MCUCONF_H_ */
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user