diff options
author | William Harrington <kb0iic@berzerkula.org> | 2019-08-01 02:52:47 -0500 |
---|---|---|
committer | William Harrington <kb0iic@berzerkula.org> | 2019-08-01 02:52:47 -0500 |
commit | 253d38a786dbed3e09b90399a05943153ca8d457 (patch) | |
tree | 765bfcd4a5d40a596bbfb7944c1136a30ea8bf7c | |
parent | 452ecb5e9c0ad214cab6617c1a54a2edc55a6cd3 (diff) |
Add functions to edit SQWE.
-rwxr-xr-x | ds3231.c | 8 | ||||
-rwxr-xr-x | ds3231.h | 1 |
2 files changed, 9 insertions, 0 deletions
@@ -71,6 +71,14 @@ void Set_DayOfWeek(int dow) { I2C_Master_Stop();
}
+void Set_Sqwe(int contvalue) {
+ I2C_Master_Start(); // Start I2C
+ I2C_Master_Write(0xD0); // RTC Chip address
+ I2C_Master_Write(0x0E); // Control register address
+ I2C_Master_Write(contvalue); // Data to control register
+ I2C_Master_Stop();
+}
+
void Set_Time() {
I2C_Master_Start(); // Start I2C
I2C_Master_Write(0xD0); // RTC Chip address
@@ -6,6 +6,7 @@ unsigned int Get_DayOfWeek(unsigned int, unsigned int, unsigned int); void Read_Alarms_Temp(void);
void Set_Date(void);
void Set_DayOfWeek(int);
+void Set_Sqwe(int);
void Set_Time(void);
void Update_Current_Date_Time(void);
void Write_Alarms(void);
\ No newline at end of file |