@@ -125,7 +125,7 @@ float RTC_DS3231::getTemperature() {
125125*/
126126/* *************************************************************************/
127127int8_t RTC_DS3231::getAging () {
128- return read_register (DS3231_AGING);
128+ return read_register (DS3231_AGING);
129129}
130130
131131/* *************************************************************************/
@@ -135,9 +135,51 @@ int8_t RTC_DS3231::getAging() {
135135*/
136136/* *************************************************************************/
137137void RTC_DS3231::setAging (int8_t val) {
138- write_register (DS3231_AGING, val);
138+ write_register (DS3231_AGING, val);
139139}
140140
141+ /* *************************************************************************/
142+ /* !
143+ @brief Get the current value of the control register
144+ @return Control register bits (unsigned int8)
145+ */
146+ /* *************************************************************************/
147+ uint8_t RTC_DS3231::getControlReg () {
148+ return read_register (DS3231_CONTROL);
149+ }
150+
151+ /* *************************************************************************/
152+ /* !
153+ @brief Write new values to all bits of the control register
154+ @param val New value for the 8 bit control register.
155+ */
156+ /* *************************************************************************/
157+ void RTC_DS3231::setControlReg (uint8_t val) {
158+ write_register (DS3231_CONTROL, val);
159+ }
160+
161+ /* *************************************************************************/
162+ /* !
163+ @brief Get the current value of the status register
164+ @return Status register bits (unsigned int8)
165+ */
166+ /* *************************************************************************/
167+ uint8_t RTC_DS3231::getStatusReg () {
168+ return read_register (DS3231_STATUSREG);
169+ }
170+
171+ /* *************************************************************************/
172+ /* !
173+ @brief Write new values to all bits of the status register e.g., to
174+ clear flags.
175+ @param val New value for the 8 bit status register.
176+ */
177+ /* *************************************************************************/
178+ void RTC_DS3231::setStatusReg (uint8_t val) {
179+ write_register (DS3231_STATUSREG, val);
180+ }
181+
182+
141183/* *************************************************************************/
142184/* !
143185 @brief Set alarm 1 for DS3231
0 commit comments