buckboost 2.0.0.0
buckboost.h
Go to the documentation of this file.
1/*
2 * MikroSDK - MikroE Software Development Kit
3 * Copyright© 2020 MikroElektronika d.o.o.
4 *
5 * Permission is hereby granted, free of charge, to any person
6 * obtaining a copy of this software and associated documentation
7 * files (the "Software"), to deal in the Software without restriction,
8 * including without limitation the rights to use, copy, modify, merge,
9 * publish, distribute, sublicense, and/or sell copies of the Software,
10 * and to permit persons to whom the Software is furnished to do so,
11 * subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be
14 * included in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
20 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22 * OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
33// ----------------------------------------------------------------------------
34
35#ifndef BUCKBOOST_H
36#define BUCKBOOST_H
37
38#include "drv_digital_out.h"
39#include "drv_digital_in.h"
40
41// -------------------------------------------------------------- PUBLIC MACROS
51#define BUCKBOOST_MAP_MIKROBUS( cfg, mikrobus ) \
52 cfg.vs2= MIKROBUS( mikrobus, MIKROBUS_AN ); \
53 cfg.run= MIKROBUS( mikrobus, MIKROBUS_CS ); \
54 cfg.vs3= MIKROBUS( mikrobus, MIKROBUS_RST ); \
55 cfg.pwm= MIKROBUS( mikrobus, MIKROBUS_PWM ); \
56 cfg.vs1= MIKROBUS( mikrobus, MIKROBUS_INT )
63#define BUCKBOOST_RETVAL uint8_t
64
65#define BUCKBOOST_OK 0x00
66#define BUCKBOOST_INIT_ERROR 0xFF // End group macro
70// --------------------------------------------------------------- PUBLIC TYPES
79typedef struct
80{
81 // Output pins
82
83 digital_out_t vs2;
84 digital_out_t run;
85 digital_out_t vs3;
86 digital_out_t pwm;
87 digital_out_t vs1;
88
90
94typedef struct
95{
96 // Additional gpio pins
97
98 pin_name_t vs2;
99 pin_name_t run;
100 pin_name_t vs3;
101 pin_name_t pwm;
102 pin_name_t vs1;
103
105 // End types group
107// ----------------------------------------------- PUBLIC FUNCTION DECLARATIONS
108
114#ifdef __cplusplus
115extern "C"{
116#endif
117
127
136
145
155
165
176
187
201
215
229
243
257
271
285
299
300#ifdef __cplusplus
301}
302#endif
303#endif // _BUCKBOOST_H_
304 // End public_function group
307
308// ------------------------------------------------------------------------- END
#define BUCKBOOST_RETVAL
Definition: buckboost.h:63
void buckboost_set_5000mv(buckboost_t *ctx)
Set the output voltage of 5000 mV function.
void buckboost_set_2500mv(buckboost_t *ctx)
Set the output voltage of 2500 mV function.
void buckboost_enables_auto_burst_mode(buckboost_t *ctx)
Enables automatic burst mode operation.
void buckboost_set_mode_fixed_freq(buckboost_t *ctx)
Set fixed frequency PWM operation function.
void buckboost_set_6900mv(buckboost_t *ctx)
Set the output voltage of 6900 mV function.
void buckboost_default_cfg(buckboost_t *ctx)
Click Default Configuration function.
void buckboost_set_8200mv(buckboost_t *ctx)
Set the output voltage of 8200 mV function.
void buckboost_set_4100mv(buckboost_t *ctx)
Set the output voltage of 4100 mV function.
BUCKBOOST_RETVAL buckboost_init(buckboost_t *ctx, buckboost_cfg_t *cfg)
Initialization function.
void buckboost_cfg_setup(buckboost_cfg_t *cfg)
Config Object Initialization function.
void buckboost_set_12000mv(buckboost_t *ctx)
Set the output voltage of 12000 mV function.
void buckboost_set_15000mv(buckboost_t *ctx)
Set the output voltage of 15000 mV function.
void buckboost_set_3300mv(buckboost_t *ctx)
Set the output voltage of 3000 mV function.
void buckboost_disable(buckboost_t *ctx)
Disable the converter function.
void buckboost_enable(buckboost_t *ctx)
Enable the converter function.
Click configuration structure definition.
Definition: buckboost.h:95
pin_name_t run
Definition: buckboost.h:99
pin_name_t vs3
Definition: buckboost.h:100
pin_name_t vs2
Definition: buckboost.h:98
pin_name_t pwm
Definition: buckboost.h:101
pin_name_t vs1
Definition: buckboost.h:102
Click ctx object definition.
Definition: buckboost.h:80
digital_out_t vs1
Definition: buckboost.h:87
digital_out_t pwm
Definition: buckboost.h:86
digital_out_t vs3
Definition: buckboost.h:85
digital_out_t run
Definition: buckboost.h:84
digital_out_t vs2
Definition: buckboost.h:83