Go to the documentation of this file.
38 #include "drv_digital_out.h"
39 #include "drv_digital_in.h"
40 #include "drv_i2c_master.h"
53 #define CLOCKGEN2_MAP_MIKROBUS( cfg, mikrobus ) \
54 cfg.scl = MIKROBUS( mikrobus, MIKROBUS_SCL ); \
55 cfg.sda = MIKROBUS( mikrobus, MIKROBUS_SDA ); \
56 cfg.pdn = MIKROBUS( mikrobus, MIKROBUS_RST ); \
57 cfg.oe = MIKROBUS( mikrobus, MIKROBUS_CS ); \
58 cfg.dtr = MIKROBUS( mikrobus, MIKROBUS_PWM )
65 #define CLOCKGEN2_RETVAL uint8_t
67 #define CLOCKGEN2_OK 0x00
68 #define CLOCKGEN2_INIT_ERROR 0xFF
77 #define CLOCKGEN2_ADDR 0x58
79 #define CLOCKGEN2_PRESCALER_REG 0x02
80 #define CLOCKGEN2_ADDR_CHANGE_REG 0x0D
81 #define CLOKCGEN2_AUTO_PRESERVE_ENABLE 0
82 #define CLOCKGEN2_AUTO_PRESERVE_DISABLE 1
83 #define CLOCKGEN2_WRITE_EE_REG 0x3F
290 #endif // _CLOCKGEN2_H_
uint32_t i2c_speed
Definition: clockgen2.h:132
pin_name_t pdn
Definition: clockgen2.h:126
pin_name_t sda
Definition: clockgen2.h:122
void clockgen2_set_oe_pin(clockgen2_t *ctx, uint8_t state)
Set oe pin function.
digital_out_t dtr
Definition: clockgen2.h:102
void clockgen2_set_dtr_pin(clockgen2_t *ctx, uint8_t state)
Set dtr pin function.
void clockgen2_set_prescaler(clockgen2_t *ctx, uint8_t val)
Prescaler set function.
pin_name_t dtr
Definition: clockgen2.h:128
void clockgen2_write(clockgen2_t *ctx, uint8_t w_reg, uint8_t w_data)
Writing 1B function.
void clockgen2_auto_setting_preserve(clockgen2_t *ctx, uint8_t state)
Auto setting preservation function.
digital_out_t pdn
Definition: clockgen2.h:100
uint8_t i2c_address
Definition: clockgen2.h:133
pin_name_t scl
Definition: clockgen2.h:121
void clockgen2_output_enable(clockgen2_t *ctx, uint8_t state)
Settings save function.
void clockgen2_generic_write(clockgen2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic write function.
i2c_master_t i2c
Definition: clockgen2.h:106
void clockgen2_cfg_setup(clockgen2_cfg_t *cfg)
Config Object Initialization function.
#define CLOCKGEN2_RETVAL
Definition: clockgen2.h:65
Click ctx object definition.
Definition: clockgen2.h:96
pin_name_t oe
Definition: clockgen2.h:127
void clockgen2_generic_read(clockgen2_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len)
Generic read function.
void clockgen2_change_address(clockgen2_t *ctx, uint8_t new_addr)
Prescaler set function.
digital_out_t oe
Definition: clockgen2.h:101
uint8_t slave_address
Definition: clockgen2.h:110
CLOCKGEN2_RETVAL clockgen2_init(clockgen2_t *ctx, clockgen2_cfg_t *cfg)
Initialization function.
Click configuration structure definition.
Definition: clockgen2.h:117
void clockgen2_store_config(clockgen2_t *ctx)
Settings save function.
void clockgen2_set_pdn_pin(clockgen2_t *ctx, uint8_t state)
Set pdn pin function.