ds3234.h
Go to the documentation of this file.
1 /*
2  * Copyright 2018 SKF AB
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
24 #ifndef DS3234_H
25 #define DS3234_H
26 
27 #include <periph/gpio.h>
28 #include <periph/spi.h>
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
37 typedef struct {
40  gpio_t cs;
42 
47  DS3234_OK = 0,
48  DS3234_NO_DEV = 1,
49  DS3234_NO_SPI = 2
50 };
51 
63 int ds3234_pps_init(const ds3234_params_t *params);
64 
65 #ifdef __cplusplus
66 }
67 #endif
68 
69 #endif /* DS3234_H */
70 
ds3234_return_codes
ds3234_return_codes
Return codes for the DS3234 device driver.
Definition: ds3234.h:46
ds3234_params_t
Parameters for the DS3234 device driver.
Definition: ds3234.h:37
ds3234_params_t::cs
gpio_t cs
CS pin GPIO handle.
Definition: ds3234.h:40
spi.h
Low-level SPI peripheral driver interface definition.
ds3234_params_t::spi
spi_t spi
SPI bus the sensor is connected to.
Definition: ds3234.h:38
spi_clk_t
spi_clk_t
Available SPI clock speeds.
Definition: spi.h:173
gpio.h
Low-level GPIO peripheral driver interface definitions.
ds3234_pps_init
int ds3234_pps_init(const ds3234_params_t *params)
Initialize the DS3234 RTC as a PPS device.
ds3234_params_t::clk
spi_clk_t clk
SPI bus clock speed.
Definition: ds3234.h:39
spi_t
unsigned int spi_t
Default type for SPI devices.
Definition: spi.h:118