39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
74#define CLOCKGEN5_OCT_0 0
75#define CLOCKGEN5_OCT_1 1
76#define CLOCKGEN5_OCT_2 2
77#define CLOCKGEN5_OCT_3 3
78#define CLOCKGEN5_OCT_4 4
79#define CLOCKGEN5_OCT_5 5
80#define CLOCKGEN5_OCT_6 6
81#define CLOCKGEN5_OCT_7 7
82#define CLOCKGEN5_OCT_8 8
83#define CLOCKGEN5_OCT_9 9
84#define CLOCKGEN5_OCT_10 10
85#define CLOCKGEN5_OCT_11 11
86#define CLOCKGEN5_OCT_12 12
87#define CLOCKGEN5_OCT_13 13
88#define CLOCKGEN5_OCT_14 14
89#define CLOCKGEN5_OCT_15 15
96#define CLOCKGEN5_OUTPUT_DISABLE 0x00
97#define CLOCKGEN5_OUTPUT_ENABLE 0x01
103#define CLOCKGEN5_CFG_ON_CLK_180 0x00
104#define CLOCKGEN5_CFG_OFF_ON 0x01
105#define CLOCKGEN5_CFG_ON_OFF 0x02
106#define CLOCKGEN5_CFG_POWER_DOWN 0x03
116#define CLOCKGEN5_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE
117#define CLOCKGEN5_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE
135#define CLOCKGEN5_MAP_MIKROBUS( cfg, mikrobus ) \
136 cfg.miso = MIKROBUS( mikrobus, MIKROBUS_MISO ); \
137 cfg.mosi = MIKROBUS( mikrobus, MIKROBUS_MOSI ); \
138 cfg.sck = MIKROBUS( mikrobus, MIKROBUS_SCK ); \
139 cfg.cs = MIKROBUS( mikrobus, MIKROBUS_CS ); \
140 cfg.oe = MIKROBUS( mikrobus, MIKROBUS_RST )
clockgen5_return_value_t
Clock Gen 5 Click return value data.
Definition clockgen5.h:190
@ CLOCKGEN5_ERROR
Definition clockgen5.h:192
@ CLOCKGEN5_OK
Definition clockgen5.h:191
err_t clockgen5_init(clockgen5_t *ctx, clockgen5_cfg_t *cfg)
Clock Gen 5 initialization function.
void clockgen5_out_enable(clockgen5_t *ctx, uint8_t en_out)
Enable output function.
void clockgen5_cfg_setup(clockgen5_cfg_t *cfg)
Clock Gen 5 configuration object setup function.
void clockgen5_set_config(clockgen5_t *ctx, uint8_t cfg)
Set configuration function.
void clockgen5_set_freq(clockgen5_t *ctx, float freq)
Set frequency function.
This file contains SPI specific macros, functions, etc.
Clock Gen 5 Click configuration object.
Definition clockgen5.h:168
spi_master_chip_select_polarity_t cs_polarity
Definition clockgen5.h:181
pin_name_t sck
Definition clockgen5.h:172
pin_name_t oe
Definition clockgen5.h:176
spi_master_mode_t spi_mode
Definition clockgen5.h:180
pin_name_t mosi
Definition clockgen5.h:171
uint32_t spi_speed
Definition clockgen5.h:179
pin_name_t miso
Definition clockgen5.h:170
pin_name_t cs
Definition clockgen5.h:173
Clock Gen 5 Click context object.
Definition clockgen5.h:150
spi_master_t spi
Definition clockgen5.h:155
digital_out_t oe
Definition clockgen5.h:152
uint8_t dev_config
Definition clockgen5.h:159
pin_name_t chip_select
Definition clockgen5.h:157