Loading...
Searching...
No Matches

Driver interface for the MAX31343 I2C real-time clock. More...

Detailed Description

Driver interface for the MAX31343 I2C real-time clock.

Author
Jakob Müller ja.mu.nosp@m.elle.nosp@m.r@tuh.nosp@m.h.de

Definition in file max31343.h.

#include <stdint.h>
#include <time.h>
#include <stdbool.h>
#include "periph/i2c.h"
+ Include dependency graph for max31343.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  max31343_t
 Device descriptor for the MAX31343 RTC. More...
 
struct  max31343_params_t
 Configuration parameters for MAX31343 initialization. More...
 

Enumerations

enum  max31343_sqw_freq_t {
  MAX31343_SQW_1HZ = 0 , MAX31343_SQW_2HZ = 1 , MAX31343_SQW_4HZ = 2 , MAX31343_SQW_8HZ = 3 ,
  MAX31343_SQW_16HZ = 4 , MAX31343_SQW_32HZ = 5
}
 Square-wave output frequency selection. More...
 
enum  max31343_ttsint_t {
  MAX31343_TTSINT_1S = 0x0 , MAX31343_TTSINT_2S = 0x1 , MAX31343_TTSINT_4S = 0x2 , MAX31343_TTSINT_8S = 0x3 ,
  MAX31343_TTSINT_16S = 0x4 , MAX31343_TTSINT_32S = 0x5 , MAX31343_TTSINT_64S = 0x6 , MAX31343_TTSINT_128S = 0x7
}
 Automatic temperature conversion interval. More...
 
enum  max31343_trickle_res_t { MAX31343_TRICKLE_RES_3K = 0x0U , MAX31343_TRICKLE_RES_6K = 0x2U , MAX31343_TRICKLE_RES_11K = 0x3U }
 Trickle charger resistor selection. More...
 

Functions

int max31343_init (max31343_t *dev, const max31343_params_t *params)
 Initialize MAX31343 device.
 
int max31343_get_time (const max31343_t *dev, struct tm *time)
 Read current time from device.
 
int max31343_set_time (const max31343_t *dev, const struct tm *time)
 Set current time on device.
 
int max31343_poweron (const max31343_t *dev)
 Enable RTC oscillator (power on timekeeping).
 
int max31343_poweroff (const max31343_t *dev)
 Disable RTC oscillator (stop timekeeping).
 
int max31343_set_alarm (const max31343_t *dev, const struct tm *time)
 Set alarm time registers.
 
int max31343_get_alarm (const max31343_t *dev, struct tm *time)
 Get the currently configured alarm time.
 
int max31343_set_alarm_int (const max31343_t *dev, bool enable)
 Enable or disable the alarm interrupt.
 
int max31343_set_sqw (const max31343_t *dev, max31343_sqw_freq_t freq)
 Configure the square-wave (SQW) output frequency.
 
int max31343_get_temp (const max31343_t *dev, int16_t *temp_centi)
 Read temperature in centi-degrees Celsius (°C * 100)
 
int max31343_trickle_charge_enable (const max31343_t *dev, bool diode, max31343_trickle_res_t res)
 Enable the trickle charger.
 
int max31343_trickle_charge_disable (const max31343_t *dev)
 Disable the trickle charger.
 
int max31343_temp_set_automode (const max31343_t *dev, bool enable, max31343_ttsint_t ttsint)
 Configure automatic temperature conversion mode and interval.