Set frequency to 1Khz of SQW pin of DS3231, Is there any method to do that?

If you are asking a question, please follow this template:

  1. My goal is: I will set SQW pin of DS3231 to 1KHz in order to get milliseconds by calling interrupt every falling edge and start the counter from 0- 999 in one second.
  2. My actions are: There are two libraries which supports DS3231 but does not support this SQW pin function.
  3. The result I see is: I was doing same in arduino IDE with some pre defined libraries. How can I do it in Mongoose OS?

According to the datasheet the square wave output can be set at 1, 1024, 4096 or 8192 Hz by setting the appropriate bits in the control register. It can be easily done in your code.