I found all the libraries of DS1302 are for Arduino, it there any ds1302.h and ds1302.c for libc or I should write them by libc based on datasheet?
You can find AVR library code for the DS 1302 at https://gist.github.com/cosard/4...
"If you find yourself in an even battle, you didn't plan very well."
As a general rule, avr-libc DOES NOT contain external peripheral libraries. Neither would one normally consider "write them by libc", any more than you would say "write your program by libc". libc contains a set of very useful tools that almost every writer who uses gcc relies on in some way, even if it is only to define "uint8_t" and its brethren. As a general rule, everyone who uses gcc relies on libc for some part of the program.
Until Black Lives Matter, we do not have "All Lives Matter"!
© 2021 Microchip Technology Inc.