driver2 2.0.0.0
driver2.h File Reference

This file contains API for Driver 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_pwm.h"

Go to the source code of this file.

Data Structures

struct  driver2_t
 Driver 2 Click driver selector. More...
 
struct  driver2_cfg_t
 Driver 2 Click configuration object. More...
 

Macros

#define DRIVER2_PIN_ENABLE   0x01
 Driver 2 pin state.
 
#define DRIVER2_PIN_DISABLE   0x00
 
#define DRIVER2_DEF_FREQ   5000
 Driver 2 default PWM frequency.
 
#define DRIVER2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  driver2_return_value_t { DRIVER2_OK = 0 , DRIVER2_ERROR = -1 }
 Driver 2 Click return value data. More...
 

Functions

void driver2_cfg_setup (driver2_cfg_t *cfg)
 Driver 2 configuration object setup function.
 
err_t driver2_init (driver2_t *ctx, driver2_cfg_t *cfg)
 Driver 2 initialization function.
 
err_t driver2_default_cfg (driver2_t *ctx)
 Driver 2 default configuration function.
 
err_t driver2_set_duty_cycle (driver2_t *ctx, float duty_cycle)
 Driver 2 sets PWM duty cycle.
 
err_t driver2_pwm_stop (driver2_t *ctx)
 Driver 2 stop PWM module.
 
err_t driver2_pwm_start (driver2_t *ctx)
 Driver 2 start PWM module.
 
void driver2_set_sd_pin (driver2_t *ctx, uint8_t state)
 Set SD pin.
 
void driver2_set_pwm_pin (driver2_t *ctx, uint8_t state)
 Set PWM pin.
 
uint8_t driver2_get_fb_pin (driver2_t *ctx)
 Get FB pin.
 

Detailed Description

This file contains API for Driver 2 Click Driver.

Enumeration Type Documentation

◆ driver2_return_value_t

Driver 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
DRIVER2_OK 
DRIVER2_ERROR