void i2c_100khz_i2cclk8mhz(uint32_t i2c) { i2c_set_prescaler(i2c, 1); i2c_set_scl_low_period(i2c, 0x13); i2c_set_scl_high_period(i2c, 0xF); i2c_set_data_hold_time(i2c, 0x2); i2c_set_data_setup_time(i2c, 0x4); }
void ds3231_init() { i2c_set_bitrate_div(_I2C_RATE_VAL); i2c_set_prescaler(I2C_DIV_1); }