zmk/app/include/zmk/matrix_transform.h
Peter Johanson c5cca5b34f feat: Add keyboard physical layout system.
* Add bindings to allow creating multiple physical layouts that specify
  their key's physical attributes, and the matching matrix transform
  and dependant kscan to use.
* Synthesize a basic physical layout if none specified, for backwards
  compatibility.
* Update matrix transform API to explicitly pass in the selected transform
  to the API instead of using a fixed chosen transform.
* Move kscan subscription and handling into the physical layout code, so
  that selecting a different physical layout at runtime can also use the
  correct kscan instance.
* Add `physical_layouts.dtsi` file to include so you can use the
  pre-configured `&key_physical_attrs` for adding you layout keys.
2024-07-03 16:52:05 -06:00

21 lines
814 B
C

/*
* Copyright (c) 2020 The ZMK Contributors
*
* SPDX-License-Identifier: MIT
*/
#pragma once
#include <zephyr/sys/util.h>
typedef const struct zmk_matrix_transform *zmk_matrix_transform_t;
#define ZMK_MATRIX_TRANSFORM_DEFAULT_EXTERN() \
extern const struct zmk_matrix_transform zmk_matrix_transform_default
#define ZMK_MATRIX_TRANSFORM_EXTERN(node_id) \
extern const struct zmk_matrix_transform _CONCAT(zmk_matrix_transform_, node_id)
#define ZMK_MATRIX_TRANSFORM_T_FOR_NODE(node_id) &_CONCAT(zmk_matrix_transform_, node_id)
int32_t zmk_matrix_transform_row_column_to_position(zmk_matrix_transform_t mt, uint32_t row,
uint32_t column);