-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDS1302.h
37 lines (26 loc) · 979 Bytes
/
DS1302.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef _H_DS1302_H
#define _H_DS1302_H
#include "stm32f7xx_hal.h"
/* Initialization */
/* GPIO and DWT */
void DS1302_Init(void);
/* Reads time byte by byte to 'buf' */
void DS1302_ReadTime(uint8_t *buf);
/* Writes time byte by byte from 'buf' */
void DS1302_WriteTime(uint8_t *buf);
/* Writes 'val' to ram address 'addr' */
/* Ram addresses range from 0 to 30 */
void DS1302_WriteRam(uint8_t addr, uint8_t val);
/* Reads ram address 'addr' */
uint8_t DS1302_ReadRam(uint8_t addr);
/* Clears the entire ram writing 0 */
void DS1302_ClearRam(void);
/* Reads time in burst mode, includes control byte */
void DS1302_ReadTimeBurst(uint8_t * temp);
/* Writes time in burst mode, includes control byte */
void DS1302_WriteTimeBurst(uint8_t * buf);
/* Reads ram in burst mode 'len' bytes into 'buf' */
void DS1302_ReadRamBurst(uint8_t len, uint8_t * buf);
/* Writes ram in burst mode 'len' bytes from 'buf' */
void DS1302_WriteRamBurst(uint8_t len, uint8_t * buf);
#endif