#include <stdint.h>
#include <string.h>
#include "no_os_util.h"
#include "no_os_i2c.h"
Go to the source code of this file.
|
int | max31343_reg_read (struct max31343_dev *dev, uint8_t reg_addr, uint8_t *reg_data) |
| Read device register. More...
|
|
int | max31343_reg_write (struct max31343_dev *dev, uint8_t reg_addr, uint8_t reg_data) |
| Write device register. More...
|
|
int | max31343_update_bits (struct max31343_dev *dev, uint8_t reg_addr, uint8_t mask, uint8_t reg_data) |
| Update specific register bits. More...
|
|
int | max31343_set_time_stamp (struct max31343_dev *dev, struct max31343_time_stamp ts) |
| Set time stamp. More...
|
|
int | max31343_reg_read_time_stamp (struct max31343_dev *dev, struct max31343_time_stamp *ts) |
| Read time stamp. More...
|
|
int | max31343_init (struct max31343_dev **device, struct max31343_init_param init_param) |
| Initialize the device. More...
|
|
int | max31343_remove (struct max31343_dev *dev) |
| Remove the device and release resources. More...
|
|
◆ MAX31343_F_CFG1_DATA_RET
#define MAX31343_F_CFG1_DATA_RET NO_OS_BIT(4) |
◆ MAX31343_F_CFG1_ENOSC
◆ MAX31343_F_CFG1_I2C_TIMEOUT
#define MAX31343_F_CFG1_I2C_TIMEOUT NO_OS_BIT(3) |
◆ MAX31343_F_CFG2_CLKO_HZ
◆ MAX31343_F_CFG2_ENCLKO
◆ MAX31343_F_CFG2_SQW_HZ
◆ MAX31343_F_INT_EN_A1IE
◆ MAX31343_F_INT_EN_A2IE
◆ MAX31343_F_INT_EN_DOSF
◆ MAX31343_F_INT_EN_PFAILE
#define MAX31343_F_INT_EN_PFAILE NO_OS_BIT(5) |
◆ MAX31343_F_INT_EN_TIE
◆ MAX31343_F_INT_EN_TSIE
◆ MAX31343_F_PWR_MGMT_D_VBACK_SEL
#define MAX31343_F_PWR_MGMT_D_VBACK_SEL NO_OS_BIT(3) |
◆ MAX31343_F_PWR_MGMT_DMAN_SEL
#define MAX31343_F_PWR_MGMT_DMAN_SEL NO_OS_BIT(2) |
◆ MAX31343_F_PWR_MGMT_PFVT
#define MAX31343_F_PWR_MGMT_PFVT NO_OS_BIT(4) |
◆ MAX31343_F_RTC_RESET_SWRST
#define MAX31343_F_RTC_RESET_SWRST NO_OS_BIT(0) |
◆ MAX31343_F_STATUS_A1F
◆ MAX31343_F_STATUS_A2F
◆ MAX31343_F_STATUS_OSF
◆ MAX31343_F_STATUS_PFAIL
◆ MAX31343_F_STATUS_PSDECT
#define MAX31343_F_STATUS_PSDECT NO_OS_BIT(7) |
◆ MAX31343_F_STATUS_TIF
◆ MAX31343_F_STATUS_TSF
◆ MAX31343_F_TIMER_CONFIG_TE
#define MAX31343_F_TIMER_CONFIG_TE NO_OS_BIT(4) |
◆ MAX31343_F_TIMER_CONFIG_TFS
#define MAX31343_F_TIMER_CONFIG_TFS NO_OS_BIT(0) |
◆ MAX31343_F_TIMER_CONFIG_TPAUSE
#define MAX31343_F_TIMER_CONFIG_TPAUSE NO_OS_BIT(3) |
◆ MAX31343_F_TIMER_CONFIG_TRPT
#define MAX31343_F_TIMER_CONFIG_TRPT NO_OS_BIT(2) |
◆ MAX31343_F_TRICKLE_D_TRICKLE
#define MAX31343_F_TRICKLE_D_TRICKLE NO_OS_BIT(0) |
◆ MAX31343_F_TRICKLE_TCHE
◆ MAX31343_F_TS_CONFIG_AUTO_MODE
#define MAX31343_F_TS_CONFIG_AUTO_MODE NO_OS_BIT(7) |
◆ MAX31343_F_TS_CONFIG_ONESHOT_MODE
#define MAX31343_F_TS_CONFIG_ONESHOT_MODE NO_OS_BIT(6) |
◆ MAX31343_F_TS_CONFIG_TTSINT
#define MAX31343_F_TS_CONFIG_TTSINT NO_OS_BIT(3) |
◆ MAX31343_I2C_ADDRESS
#define MAX31343_I2C_ADDRESS 0x68 |
◆ MAX31343_R_ALM1_HRS
#define MAX31343_R_ALM1_HRS 0x0F |
◆ MAX31343_R_ALM1_MIN
#define MAX31343_R_ALM1_MIN 0x0E |
◆ MAX31343_R_ALM1_MON
#define MAX31343_R_ALM1_MON 0x11 |
◆ MAX31343_R_ALM1_SEC
#define MAX31343_R_ALM1_SEC 0x0D |
◆ MAX31343_R_ALM1_YEAR
#define MAX31343_R_ALM1_YEAR 0x12 |
◆ MAX31343_R_ALM1DAY_DATE
#define MAX31343_R_ALM1DAY_DATE 0x10 |
◆ MAX31343_R_ALM2_HRS
#define MAX31343_R_ALM2_HRS 0x14 |
◆ MAX31343_R_ALM2_MIN
#define MAX31343_R_ALM2_MIN 0x13 |
◆ MAX31343_R_ALM2DAY_DATE
#define MAX31343_R_ALM2DAY_DATE 0x15 |
◆ MAX31343_R_CFG1
#define MAX31343_R_CFG1 0x03 |
◆ MAX31343_R_CFG2
#define MAX31343_R_CFG2 0x04 |
◆ MAX31343_R_DATE
#define MAX31343_R_DATE 0x0A |
◆ MAX31343_R_DAY
#define MAX31343_R_DAY 0x09 |
◆ MAX31343_R_HOURS
#define MAX31343_R_HOURS 0x08 |
◆ MAX31343_R_INT_EN
#define MAX31343_R_INT_EN 0x01 |
◆ MAX31343_R_MINUTES
#define MAX31343_R_MINUTES 0x07 |
◆ MAX31343_R_MONTH
#define MAX31343_R_MONTH 0x0B |
◆ MAX31343_R_PWR_MGMT
#define MAX31343_R_PWR_MGMT 0x18 |
◆ MAX31343_R_RAM_REG_END
#define MAX31343_R_RAM_REG_END 0x61 |
◆ MAX31343_R_RAM_REG_START
#define MAX31343_R_RAM_REG_START 0x22 |
◆ MAX31343_R_RTC_RESET
#define MAX31343_R_RTC_RESET 0x02 |
◆ MAX31343_R_SECONDS
#define MAX31343_R_SECONDS 0x06 |
◆ MAX31343_R_STATUS
#define MAX31343_R_STATUS 0x00 |
◆ MAX31343_R_TEMP_LSB
#define MAX31343_R_TEMP_LSB 0x1B |
◆ MAX31343_R_TEMP_MSB
#define MAX31343_R_TEMP_MSB 0x1A |
◆ MAX31343_R_TIMER_CONFIG
#define MAX31343_R_TIMER_CONFIG 0x05 |
◆ MAX31343_R_TIMER_COUNT
#define MAX31343_R_TIMER_COUNT 0x16 |
◆ MAX31343_R_TIMER_INIT
#define MAX31343_R_TIMER_INIT 0x17 |
◆ MAX31343_R_TRICKLE
#define MAX31343_R_TRICKLE 0x19 |
◆ MAX31343_R_TS_CONFIG
#define MAX31343_R_TS_CONFIG 0x1C |
◆ MAX31343_R_YEAR
#define MAX31343_R_YEAR 0x0C |
◆ max31343_init()
Initialize the device.
- Parameters
-
device | - The device structure. |
init_param | - The structure that contains the device initial parameters. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max31343_reg_read()
int max31343_reg_read |
( |
struct max31343_dev * |
dev, |
|
|
uint8_t |
reg_addr, |
|
|
uint8_t * |
reg_data |
|
) |
| |
Read device register.
- Parameters
-
dev | - The device structure. |
reg_addr | - The register address. |
reg_data | - The data read from the register. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max31343_reg_read_time_stamp()
Read time stamp.
- Parameters
-
dev | - The device structure. |
ts | - Structure holding the time stamp to read. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max31343_reg_write()
int max31343_reg_write |
( |
struct max31343_dev * |
dev, |
|
|
uint8_t |
reg_addr, |
|
|
uint8_t |
reg_data |
|
) |
| |
Write device register.
- Parameters
-
dev- | The device structure. |
reg_addr | - The register address. |
reg_data | - The data to be written. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max31343_remove()
Remove the device and release resources.
- Parameters
-
dev | - The device structure. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max31343_set_time_stamp()
Set time stamp.
- Parameters
-
dev | - The device structure. |
ts | - Structure holding the time stamp to be set. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max31343_update_bits()
int max31343_update_bits |
( |
struct max31343_dev * |
dev, |
|
|
uint8_t |
reg_addr, |
|
|
uint8_t |
mask, |
|
|
uint8_t |
reg_data |
|
) |
| |
Update specific register bits.
- Parameters
-
dev | - The device structure. |
reg_addr | - The register address. |
mask | - Specific bits mask. |
reg_data | - The data to be written. |
- Returns
- 0 in case of success, negative error code otherwise.