clockgen4 2.0.0.0
|
API for configuring and manipulating Clock Gen 4 Click driver. More...
Topics | |
Clock Gen 4 Registers List | |
List of registers of Clock Gen 4 Click driver. | |
Clock Gen 4 Registers Settings | |
Settings for registers of Clock Gen 4 Click driver. | |
Clock Gen 4 MikroBUS Map | |
MikroBUS pin mapping of Clock Gen 4 Click driver. | |
Functions | |
void | clockgen4_cfg_setup (clockgen4_cfg_t *cfg) |
Clock Gen 4 configuration object setup function. | |
void | clockgen4_drv_interface_selection (clockgen4_cfg_t *cfg, clockgen4_drv_t drv_sel) |
Clock Gen 4 driver interface setup function. | |
err_t | clockgen4_init (clockgen4_t *ctx, clockgen4_cfg_t *cfg) |
Clock Gen 4 initialization function. | |
err_t | clockgen4_default_cfg (clockgen4_t *ctx) |
Clock Gen 4 default configuration function. | |
err_t | clockgen4_generic_write (clockgen4_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len) |
Clock Gen 4 data writing function. | |
err_t | clockgen4_generic_read (clockgen4_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len) |
Clock Gen 4 data reading function. | |
void | clockgen4_dev_ctl (clockgen4_t *ctx, uint8_t dev_ctl) |
Clock Gen 4 device control function. | |
void | clockgen4_dev_cfg (clockgen4_t *ctx, uint8_t dev_cfg) |
Clock Gen 4 device configuration function. | |
void | clockgen4_glob_cfg (clockgen4_t *ctx, uint8_t glob_cfg) |
Clock Gen 4 global configuration function. | |
void | clockgen4_fnc_cfg_1 (clockgen4_t *ctx, uint8_t fnc_cfg) |
Clock Gen 4 configuration 1 function. | |
void | clockgen4_fnc_cfg_2 (clockgen4_t *ctx, uint8_t fnc_cfg) |
Clock Gen 4 configuration 2 function. | |
uint32_t | clockgen4_set_ratio (clockgen4_t *ctx, float ratio) |
Clock Gen 4 set ratio function. | |
API for configuring and manipulating Clock Gen 4 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void clockgen4_cfg_setup | ( | clockgen4_cfg_t * | cfg | ) |
Clock Gen 4 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See clockgen4_cfg_t object definition for detailed explanation. |
err_t clockgen4_default_cfg | ( | clockgen4_t * | ctx | ) |
Clock Gen 4 default configuration function.
This function executes a default configuration of Clock Gen 4 click board.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
0
- Success, -1
- Error.void clockgen4_dev_cfg | ( | clockgen4_t * | ctx, |
uint8_t | dev_cfg ) |
Clock Gen 4 device configuration function.
Function is used to write to device configuration 1 register in order to apply settings.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | dev_cfg | : 8-bit input data. |
void clockgen4_dev_ctl | ( | clockgen4_t * | ctx, |
uint8_t | dev_ctl ) |
Clock Gen 4 device control function.
Function is used to write to device control register in order to apply settings.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | dev_ctl | : 8-bit input data. |
void clockgen4_drv_interface_selection | ( | clockgen4_cfg_t * | cfg, |
clockgen4_drv_t | drv_sel ) |
Clock Gen 4 driver interface setup function.
This function sets a serial driver interface which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See clockgen4_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See clockgen4_drv_t object definition for detailed explanation. |
void clockgen4_fnc_cfg_1 | ( | clockgen4_t * | ctx, |
uint8_t | fnc_cfg ) |
Clock Gen 4 configuration 1 function.
Function is used to write to function configuration 1 register in order to apply settings.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | fnc_cfg | : 8-bit input data. |
void clockgen4_fnc_cfg_2 | ( | clockgen4_t * | ctx, |
uint8_t | fnc_cfg ) |
Clock Gen 4 configuration 2 function.
Function is used to write to function configuration 2 register in order to apply settings.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | fnc_cfg | : 8-bit input data. |
err_t clockgen4_generic_read | ( | clockgen4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
Clock Gen 4 data reading function.
This function reads a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error.err_t clockgen4_generic_write | ( | clockgen4_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_in, | ||
uint8_t | len ) |
Clock Gen 4 data writing function.
This function writes a desired number of data bytes starting from the selected register.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error.void clockgen4_glob_cfg | ( | clockgen4_t * | ctx, |
uint8_t | glob_cfg ) |
Clock Gen 4 global configuration function.
Function is used to write to function configuration 2 register in order to apply settings.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | glob_cfg | : 8-bit input data. |
err_t clockgen4_init | ( | clockgen4_t * | ctx, |
clockgen4_cfg_t * | cfg ) |
Clock Gen 4 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See clockgen4_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.uint32_t clockgen4_set_ratio | ( | clockgen4_t * | ctx, |
float | ratio ) |
Clock Gen 4 set ratio function.
Function is used to set the ratio between the output signal and the input clock.
[in] | ctx | : Click context object. See clockgen4_t object definition for detailed explanation. |
[in] | ratio | :float value that represents the ratio between the output signal and the input clock. |