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 
9 #pragma once
10 
24 #ifdef __cplusplus
25 extern "C"
26 {
27 #endif
28 
29 #include <inttypes.h>
30 #include "periph/gpio.h"
31 
35 typedef struct {
36  gpio_t vsel[4];
37  gpio_t ctrl_pin;
39 
43 typedef struct {
45 } tps6274x_t;
46 
50 enum {
53 };
54 
63 int tps6274x_init(tps6274x_t *dev, const tps6274x_params_t *params);
64 
72 uint16_t tps6274x_switch_voltage(tps6274x_t *dev, uint16_t voltage);
73 
80 void tps6274x_load_ctrl(tps6274x_t *dev, int status);
81 
82 #ifdef __cplusplus
83 }
84 #endif
Low-level GPIO peripheral driver interface definitions.
int tps6274x_init(tps6274x_t *dev, const tps6274x_params_t *params)
Init converter.
uint16_t tps6274x_switch_voltage(tps6274x_t *dev, uint16_t voltage)
Switch to different voltage level.
void tps6274x_load_ctrl(tps6274x_t *dev, int status)
Sets ctrl pin high to power a subsystem connected on the load pin.
@ TPS6274X_ERR_INIT
error during init
Definition: tps6274x.h:52
@ TPS6274X_OK
everything was fine
Definition: tps6274x.h:51
Adds include for missing inttype definitions.
TPS6274x Configuration struct.
Definition: tps6274x.h:35
gpio_t ctrl_pin
ctrl pin mapping
Definition: tps6274x.h:37
Device descriptor for the TPS6274x.
Definition: tps6274x.h:43
tps6274x_params_t params
device initialization parameters
Definition: tps6274x.h:44