Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for ErgoDox with STM32 Microcontroller #5398

Merged
merged 25 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
a392fb4
Began Work On STM32 Ergodox
Codetector1374 Jan 16, 2019
079fbc4
test
Codetector1374 Jan 17, 2019
304cd5b
Now it compile. Not linking thou
Codetector1374 Jan 17, 2019
c2b9529
Screw this Linker. It links now!
Codetector1374 Jan 17, 2019
06f9f2a
Blinkly Keyboard
Codetector1374 Jan 17, 2019
4927abe
bootloader test code
Codetector1374 Jan 18, 2019
23b445a
Working on matrix / i2c stuff
Codetector1374 Jan 23, 2019
3c5251f
Progress (LED Blink)
Codetector1374 Jan 24, 2019
0365c92
Progress on MCP_23017 Status Flag
Codetector1374 Jan 24, 2019
cf99732
[WIP]
Codetector1374 Jan 24, 2019
fd84782
update
Codetector1374 Jan 25, 2019
1f1f23c
Works! Remeber to change back the bootloader address when the new boo…
Codetector1374 Jan 26, 2019
ee657d7
Time to go debug the i2c
Codetector1374 Jan 26, 2019
ec07114
Finally, it now works with PCB Rev 1.0.2
Codetector1374 Jan 29, 2019
222e791
updated for rev.2 pcb
Codetector1374 Feb 23, 2019
082de2c
minor compilation fix
Codetector1374 Mar 13, 2019
4378d6c
Merge remote-tracking branch 'upstream/master' into ergodox_stm32
Codetector1374 Mar 13, 2019
224637b
Why when debugger is enabled then everything works.
Codetector1374 Mar 13, 2019
3438cad
Remeber to call init functions.
Codetector1374 Mar 13, 2019
35591b3
Update arm i2c driver to support STM32F103 series device.
Codetector1374 Mar 14, 2019
f7b501d
fix include once header. Replaced with #pragma once.
Codetector1374 Mar 14, 2019
86db0c2
Merge remote-tracking branch 'source/master' into ergodox_stm32
Codetector1374 Jul 9, 2019
c4ec830
complication test
Codetector1374 Jul 9, 2019
20ae9ce
Merge branch 'master' into ergodox_stm32
Codetector1374 Sep 21, 2019
6ef3d88
fix conflict and support for latest gcc
Codetector1374 Sep 23, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Progress on MCP_23017 Status Flag
  • Loading branch information
Codetector1374 committed Jan 24, 2019
commit 0365c9219d0564faf6b3e854ad9717285e49e5dc
1 change: 0 additions & 1 deletion keyboards/ergodox_ez/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ void matrix_init(void)

mcp23018_status = init_mcp23018();


unselect_rows();
init_cols();

Expand Down
16 changes: 14 additions & 2 deletions keyboards/ergodox_stm32/ergodox_stm32.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ extern inline void ergodox_board_led_2_off(void);
extern inline void ergodox_board_led_3_off(void);
extern inline void ergodox_led_all_off(void);

int mcp23017_status = 0x20;
uint8_t i2c_initializied = 0;

// static THD_WORKING_AREA(testThread1WorkingArea, 128);
// static THD_FUNCTION(testThread1, arg) {
// palSetPadMode(GPIOA, 14, PAL_MODE_INPUT_PULLUP);
Expand Down Expand Up @@ -58,8 +61,17 @@ void ergodox_blink_all_leds(void)
}

void mcp23017_init(void) {
i2c_init();
if (!i2c_initializied) {
i2c_init();
i2c_initializied = 1;
}

uint8_t data[2];
data[0] = 0x0;
data[1] = 0b00111111;
mcp23017_status = i2c_writeReg(I2C_ADDR, I2C_IODIRA, data, 2, 1000);
mcp23017_status = i2c_writeReg(I2C_ADDR, I2C_GPPUA, data, 2, 1000);

// i2c_readReg(I2C_ADDR, );
// i2c_readReg(I2C_ADDR, );
}

2 changes: 2 additions & 0 deletions keyboards/ergodox_stm32/ergodox_stm32.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
#define I2C_GPIOB 0x13
#define I2C_OLATA 0x14
#define I2C_OLATB 0x15
#define I2C_GPPUA 0x0C
#define I2C_GPPUB 0x0D

inline void ergodox_board_led_1_on(void) { palSetPad(GPIOA, 10); }
inline void ergodox_board_led_2_on(void) { palSetPad(GPIOA, 9); }
Expand Down
28 changes: 27 additions & 1 deletion keyboards/ergodox_stm32/matrix.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ static matrix_row_t matrix[MATRIX_ROWS];
// static matrix_row_t raw_matrix[MATRIX_ROWS];

// static uint8_t debounce_matrix[MATRIX_ROWS * MATRIX_COLS];
static matrix_row_t read_cols(uint8_t row);
static void init_cols(void);
static void unselect_rows(void);
static void select_row(uint8_t row);


__attribute__ ((weak))
void matrix_init_user(void) {}
Expand All @@ -28,10 +33,14 @@ void matrix_init_kb(void) {

__attribute__ ((weak))
void matrix_scan_kb(void)
{}
{

}

void matrix_init(void)
{
mcp23017_init();

matrix_init_quantum();
}

Expand Down Expand Up @@ -65,3 +74,20 @@ void matrix_print(void)
xprintf("\n");
}
}

static matrix_row_t read_cols(uint8_t row)
{

}
static void init_cols(void)
{

}
static void unselect_rows(void)
{
GPIOA->regs->BSRR = 0b1111111 << 8;
}
static void select_row(uint8_t row)
{

}