Skip to content

Commit 34112da

Browse files
authored
Adds the Proton C base project (#4224)
* adds proton c base * fixes custom matrix include * adds readme.md * usable pins, readme update
1 parent 15f6278 commit 34112da

File tree

14 files changed

+2743
-1
lines changed

14 files changed

+2743
-1
lines changed

common_features.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ QUANTUM_SRC:= \
244244
$(QUANTUM_DIR)/keymap_common.c \
245245
$(QUANTUM_DIR)/keycode_config.c
246246

247-
ifndef CUSTOM_MATRIX
247+
ifneq ($(strip $(CUSTOM_MATRIX)), yes)
248248
ifeq ($(strip $(SPLIT_KEYBOARD)), yes)
249249
QUANTUM_SRC += $(QUANTUM_DIR)/split_common/matrix.c
250250
else
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
ChibiOS - Copyright (C) 2006..2016 Giovanni Di Sirio
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
17+
#include "hal.h"
18+
19+
#if HAL_USE_PAL || defined(__DOXYGEN__)
20+
/**
21+
* @brief PAL setup.
22+
* @details Digital I/O ports static configuration as defined in @p board.h.
23+
* This variable is used by the HAL when initializing the PAL driver.
24+
*/
25+
const PALConfig pal_default_config = {
26+
#if STM32_HAS_GPIOA
27+
{VAL_GPIOA_MODER, VAL_GPIOA_OTYPER, VAL_GPIOA_OSPEEDR, VAL_GPIOA_PUPDR,
28+
VAL_GPIOA_ODR, VAL_GPIOA_AFRL, VAL_GPIOA_AFRH},
29+
#endif
30+
#if STM32_HAS_GPIOB
31+
{VAL_GPIOB_MODER, VAL_GPIOB_OTYPER, VAL_GPIOB_OSPEEDR, VAL_GPIOB_PUPDR,
32+
VAL_GPIOB_ODR, VAL_GPIOB_AFRL, VAL_GPIOB_AFRH},
33+
#endif
34+
#if STM32_HAS_GPIOC
35+
{VAL_GPIOC_MODER, VAL_GPIOC_OTYPER, VAL_GPIOC_OSPEEDR, VAL_GPIOC_PUPDR,
36+
VAL_GPIOC_ODR, VAL_GPIOC_AFRL, VAL_GPIOC_AFRH},
37+
#endif
38+
#if STM32_HAS_GPIOD
39+
{VAL_GPIOD_MODER, VAL_GPIOD_OTYPER, VAL_GPIOD_OSPEEDR, VAL_GPIOD_PUPDR,
40+
VAL_GPIOD_ODR, VAL_GPIOD_AFRL, VAL_GPIOD_AFRH},
41+
#endif
42+
#if STM32_HAS_GPIOE
43+
{VAL_GPIOE_MODER, VAL_GPIOE_OTYPER, VAL_GPIOE_OSPEEDR, VAL_GPIOE_PUPDR,
44+
VAL_GPIOE_ODR, VAL_GPIOE_AFRL, VAL_GPIOE_AFRH},
45+
#endif
46+
#if STM32_HAS_GPIOF
47+
{VAL_GPIOF_MODER, VAL_GPIOF_OTYPER, VAL_GPIOF_OSPEEDR, VAL_GPIOF_PUPDR,
48+
VAL_GPIOF_ODR, VAL_GPIOF_AFRL, VAL_GPIOF_AFRH},
49+
#endif
50+
#if STM32_HAS_GPIOG
51+
{VAL_GPIOG_MODER, VAL_GPIOG_OTYPER, VAL_GPIOG_OSPEEDR, VAL_GPIOG_PUPDR,
52+
VAL_GPIOG_ODR, VAL_GPIOG_AFRL, VAL_GPIOG_AFRH},
53+
#endif
54+
#if STM32_HAS_GPIOH
55+
{VAL_GPIOH_MODER, VAL_GPIOH_OTYPER, VAL_GPIOH_OSPEEDR, VAL_GPIOH_PUPDR,
56+
VAL_GPIOH_ODR, VAL_GPIOH_AFRL, VAL_GPIOH_AFRH},
57+
#endif
58+
#if STM32_HAS_GPIOI
59+
{VAL_GPIOI_MODER, VAL_GPIOI_OTYPER, VAL_GPIOI_OSPEEDR, VAL_GPIOI_PUPDR,
60+
VAL_GPIOI_ODR, VAL_GPIOI_AFRL, VAL_GPIOI_AFRH}
61+
#endif
62+
};
63+
#endif
64+
65+
void enter_bootloader_mode_if_requested(void);
66+
67+
/**
68+
* @brief Early initialization code.
69+
* @details This initialization must be performed just after stack setup
70+
* and before any other initialization.
71+
*/
72+
void __early_init(void) {
73+
enter_bootloader_mode_if_requested();
74+
stm32_clock_init();
75+
}
76+
77+
#if HAL_USE_SDC || defined(__DOXYGEN__)
78+
/**
79+
* @brief SDC card detection.
80+
*/
81+
bool sdc_lld_is_card_inserted(SDCDriver *sdcp) {
82+
83+
(void)sdcp;
84+
/* TODO: Fill the implementation.*/
85+
return true;
86+
}
87+
88+
/**
89+
* @brief SDC card write protection detection.
90+
*/
91+
bool sdc_lld_is_write_protected(SDCDriver *sdcp) {
92+
93+
(void)sdcp;
94+
/* TODO: Fill the implementation.*/
95+
return false;
96+
}
97+
#endif /* HAL_USE_SDC */
98+
99+
#if HAL_USE_MMC_SPI || defined(__DOXYGEN__)
100+
/**
101+
* @brief MMC_SPI card detection.
102+
*/
103+
bool mmc_lld_is_card_inserted(MMCDriver *mmcp) {
104+
105+
(void)mmcp;
106+
/* TODO: Fill the implementation.*/
107+
return true;
108+
}
109+
110+
/**
111+
* @brief MMC_SPI card write protection detection.
112+
*/
113+
bool mmc_lld_is_write_protected(MMCDriver *mmcp) {
114+
115+
(void)mmcp;
116+
/* TODO: Fill the implementation.*/
117+
return false;
118+
}
119+
#endif
120+
121+
/**
122+
* @brief Board-specific initialization code.
123+
* @todo Add your board-specific code, if any.
124+
*/
125+
void boardInit(void) {
126+
}

0 commit comments

Comments
 (0)