Skip to content

Commit

Permalink
sn32: i2c: add onekey configs
Browse files Browse the repository at this point in the history
for 24xB and 26x
  • Loading branch information
dexter93 committed Jun 7, 2024
1 parent bd57909 commit 423052a
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 0 deletions.
23 changes: 23 additions & 0 deletions keyboards/handwired/onekey/sn32f240b/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Copyright 2024 Dimitris Mantzouranis <[email protected]>
*
* 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

#define I2C_DRIVER I2CD0
#define I2C1_SCL_PIN A6
#define I2C1_SDA_PIN A7
#define I2C1_OPMODE OPMODE_I2C
#define I2C1_CLOCK_SPEED 400000
19 changes: 19 additions & 0 deletions keyboards/handwired/onekey/sn32f240b/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2024 Dimitris Mantzouranis <[email protected]>
*
* 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

#define SN32_I2C_USE_I2C0 TRUE
#include_next <mcuconf.h>
23 changes: 23 additions & 0 deletions keyboards/handwired/onekey/sn32f260/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/* Copyright 2024 Dimitris Mantzouranis <[email protected]>
*
* 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

#define I2C_DRIVER I2CD0
#define I2C1_SCL_PIN A4
#define I2C1_SDA_PIN A5
#define I2C1_OPMODE OPMODE_I2C
#define I2C1_CLOCK_SPEED 400000
19 changes: 19 additions & 0 deletions keyboards/handwired/onekey/sn32f260/mcuconf.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/* Copyright 2024 Dimitris Mantzouranis <[email protected]>
*
* 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

#define SN32_I2C_USE_I2C0 TRUE
#include_next <mcuconf.h>

0 comments on commit 423052a

Please sign in to comment.