clockgen2 2.0.0.0
clockgen2.h File Reference

This file contains API for Clock Gen 2 Click driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"

Go to the source code of this file.

Data Structures

struct  clockgen2_t
 Click ctx object definition. More...
 
struct  clockgen2_cfg_t
 Click configuration structure definition. More...
 

Macros

#define CLOCKGEN2_MAP_MIKROBUS(cfg, mikrobus)
 
#define CLOCKGEN2_RETVAL   uint8_t
 
#define CLOCKGEN2_OK   0x00
 
#define CLOCKGEN2_INIT_ERROR   0xFF
 
#define CLOCKGEN2_ADDR   0x58
 
#define CLOCKGEN2_PRESCALER_REG   0x02
 
#define CLOCKGEN2_ADDR_CHANGE_REG   0x0D
 
#define CLOKCGEN2_AUTO_PRESERVE_ENABLE   0
 
#define CLOCKGEN2_AUTO_PRESERVE_DISABLE   1
 
#define CLOCKGEN2_WRITE_EE_REG   0x3F
 

Functions

void clockgen2_cfg_setup (clockgen2_cfg_t *cfg)
 Config Object Initialization function.
 
CLOCKGEN2_RETVAL clockgen2_init (clockgen2_t *ctx, clockgen2_cfg_t *cfg)
 Initialization function.
 
void clockgen2_generic_write (clockgen2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic write function.
 
void clockgen2_generic_read (clockgen2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
 Generic read function.
 
void clockgen2_set_dtr_pin (clockgen2_t *ctx, uint8_t state)
 Set dtr pin function.
 
void clockgen2_set_pdn_pin (clockgen2_t *ctx, uint8_t state)
 Set pdn pin function.
 
void clockgen2_set_oe_pin (clockgen2_t *ctx, uint8_t state)
 Set oe pin function.
 
void clockgen2_write (clockgen2_t *ctx, uint8_t w_reg, uint8_t w_data)
 Writing 1B function.
 
void clockgen2_set_prescaler (clockgen2_t *ctx, uint8_t val)
 Prescaler set function.
 
void clockgen2_change_address (clockgen2_t *ctx, uint8_t new_addr)
 Prescaler set function.
 
void clockgen2_store_config (clockgen2_t *ctx)
 Settings save function.
 
void clockgen2_auto_setting_preserve (clockgen2_t *ctx, uint8_t state)
 Auto setting preservation function.
 
void clockgen2_output_enable (clockgen2_t *ctx, uint8_t state)
 Settings save function.
 

Detailed Description

This file contains API for Clock Gen 2 Click driver.