tps6274x.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 RWTH Aachen
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 
22 #ifndef TPS6274X_H
23 #define TPS6274X_H
24 
25 #ifdef __cplusplus
26 extern "C"
27 {
28 #endif
29 
30 #include <inttypes.h>
31 #include "periph/gpio.h"
32 
36 typedef struct {
37  gpio_t vsel[4];
38  gpio_t ctrl_pin;
40 
44 typedef struct {
46 } tps6274x_t;
47 
51 enum {
54 };
55 
64 int tps6274x_init(tps6274x_t *dev, const tps6274x_params_t *params);
65 
73 uint16_t tps6274x_switch_voltage(tps6274x_t *dev, uint16_t voltage);
74 
81 void tps6274x_load_ctrl(tps6274x_t *dev, int status);
82 
83 #ifdef __cplusplus
84 }
85 #endif
86 #endif /* TPS6274X_H */
87 
tps6274x_params_t::ctrl_pin
gpio_t ctrl_pin
ctrl pin mapping
Definition: tps6274x.h:38
tps6274x_t::params
tps6274x_params_t params
device initialization parameters
Definition: tps6274x.h:45
tps6274x_init
int tps6274x_init(tps6274x_t *dev, const tps6274x_params_t *params)
Init converter.
tps6274x_load_ctrl
void tps6274x_load_ctrl(tps6274x_t *dev, int status)
Sets ctrl pin high to power a subsystem connected on the load pin.
tps6274x_switch_voltage
uint16_t tps6274x_switch_voltage(tps6274x_t *dev, uint16_t voltage)
Switch to different voltage level.
gpio.h
Low-level GPIO peripheral driver interface definitions.
tps6274x_t
Device descriptor for the TPS6274x.
Definition: tps6274x.h:44
TPS6274X_ERR_INIT
@ TPS6274X_ERR_INIT
error during init
Definition: tps6274x.h:53
inttypes.h
Adds include for missing inttype definitions.
TPS6274X_OK
@ TPS6274X_OK
everything was fine
Definition: tps6274x.h:52
tps6274x_params_t
TPS6274x Configuration struct.
Definition: tps6274x.h:36