let scl = board.i2c_external.scl.into_floating_input().degrade();
let sda = board.i2c_external.sda.into_floating_input().degrade();
let i2c = twim::Twim::new(
board.TWIM0,
twim::Pins { scl, sda },
twim::Frequency::K100, // 100 kHz I2C frequency );
// Initialize the DS3231 RTC
let mut rtc = Ds323x::new_ds3231(i2c);
let datetime = NaiveDate::from_ymd_opt(2024, 12, 24).unwrap();
rprintln!("{:?}", datetime);
let result = match rtc.set_date(&datetime) {
Ok(r) => r,
Err(e) => {
rprintln!("Error {:?}", e);
}
};
I want to be able to get the date (current date time), but I am finding it quite difficult. Here 'rtc.set_date' I keep on getting the error Error Comm(DMABufferNotInDataMemory).