Skip to content

Commit

Permalink
add I2C_CLOCK_SPEED definition
Browse files Browse the repository at this point in the history
add I2C_CLOCK_SPEED definition
  • Loading branch information
OctopusZ committed Jan 11, 2024
1 parent 0241e89 commit 31f1c2e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion qmk_porting/platforms/ch58x/i2c_master.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void i2c_init()
setPinInputHigh(B12);
setPinInputHigh(B13);
#endif
I2C_Init(I2C_Mode_I2C, 400000, I2C_DutyCycle_16_9, I2C_Ack_Enable, I2C_AckAddr_7bit, TxAdderss);
I2C_Init(I2C_Mode_I2C, I2C_CLOCK_SPEED, I2C_DutyCycle_16_9, I2C_Ack_Enable, I2C_AckAddr_7bit, TxAdderss);
while (I2C_GetFlagStatus(I2C_FLAG_BUSY)) {
__nop();
}
Expand Down
4 changes: 4 additions & 0 deletions qmk_porting/platforms/ch58x/i2c_master.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
#include <stdbool.h>
#include "gpio.h"

#ifndef I2C_CLOCK_SPEED
#define I2C_CLOCK_SPEED 400000
#endif

typedef int16_t i2c_status_t;

#define TxAdderss 0x52
Expand Down

0 comments on commit 31f1c2e

Please sign in to comment.