copied over and modified for use my CH59x soft I2C. CH32X GPIO does not have an open drain mode, so I have to implement this with RMW to the mode register. After doing this and adding missing functions needed for existing code, LED writes and EEPROM reads and writes. using the AWU for system timing so the clock speed can change. existing issues: - changing clock speed divider in soft i2c routines causes the system to crash - ADC seems to be reading, but result isn't being used
20 lines
295 B
C
20 lines
295 B
C
/*
|
|
global config
|
|
*/
|
|
|
|
#ifndef INC_GLOBAL_H_
|
|
#define INC_GLOBAL_H_
|
|
|
|
|
|
|
|
#include "system_ch32x035.h"
|
|
|
|
|
|
|
|
#define SYSCLK_FREQ_NORMAL SYSCLK_FREQ_24MHz_HSI
|
|
#define SYSCLK_FREQ_USEI2C SYSCLK_FREQ_24MHz_HSI
|
|
#define SYSCLK_FREQ_IDLE SYSCLK_FREQ_12MHz_HSI
|
|
|
|
|
|
|
|
#endif /* INC_GLOBAL_H_ */ |