uniqueid 2.0.0.0
UNIQUE ID click criver

API for configuring and manipulating UNIQUEID click driver. More...

Topics

 UNIQUE ID Settings
 Settings of UNIQUE ID click driver.
 
 Uniqueid_map
 MikroBUS pin mapping.
 

Data Structures

struct  uniqueid_t
 UNIQUE ID click context object. More...
 
struct  uniqueid_cfg_t
 UNIQUE ID click configuration object. More...
 

Enumerations

enum  uniqueid_gpio_sel_t { UNIQUEID_GPIO_0 , UNIQUEID_GPIO_1 }
 UNIQUE ID click GPIO selector. More...
 
enum  uniqueid_return_value_t { UNIQUEID_OK = 0 , UNIQUEID_ERROR = -1 }
 UNIQUE ID click return value data. More...
 

Functions

void uniqueid_cfg_setup (uniqueid_cfg_t *cfg)
 UNIQUE ID configuration object setup function.
 
void uniqueid_gpio_selection (uniqueid_cfg_t *cfg, uniqueid_gpio_sel_t gpio_sel)
 UNIQUE ID driver interface setup function.
 
err_t uniqueid_init (uniqueid_t *ctx, uniqueid_cfg_t *cfg)
 UNIQUE ID initialization function.
 
err_t uniqueid_read_id (uniqueid_t *ctx, uint8_t *family, uint8_t *serial_num)
 UNIQUE ID read Family Code and Serial Number function.
 

Detailed Description

API for configuring and manipulating UNIQUEID click driver.

API for configuring and manipulating UNIQUE ID click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Enumeration Type Documentation

◆ uniqueid_gpio_sel_t

UNIQUE ID click GPIO selector.

Selecting GPIO pins of UNIQUE ID click driver.

Enumerator
UNIQUEID_GPIO_0 

GPIO_0 pin.

UNIQUEID_GPIO_1 

GPIO_1 pin.

◆ uniqueid_return_value_t

UNIQUE ID click return value data.

Predefined enum values for driver return values.

Enumerator
UNIQUEID_OK 
UNIQUEID_ERROR 

Function Documentation

◆ uniqueid_cfg_setup()

void uniqueid_cfg_setup ( uniqueid_cfg_t * cfg)

UNIQUE ID configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See uniqueid_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ uniqueid_gpio_selection()

void uniqueid_gpio_selection ( uniqueid_cfg_t * cfg,
uniqueid_gpio_sel_t gpio_sel )

UNIQUE ID driver interface setup function.

This function sets a communication GPIO pins which will be used further in the click driver.

Parameters
[out]cfg: Click configuration structure. See uniqueid_cfg_t object definition for detailed explanation.
[in]gpio_sel: GPIO selector. See uniqueid_gpio_sel_t object definition for detailed explanation.
Returns
Nothing.
Note
This function should be called before init function in order to configure the driver to work with the serial interface which is consistent with the real state of the hardware. If this function is not called, the default driver interface will be set.

◆ uniqueid_init()

err_t uniqueid_init ( uniqueid_t * ctx,
uniqueid_cfg_t * cfg )

UNIQUE ID initialization function.

This function initializes all necessary pins and peripherals used for this Click board.

Parameters
[out]ctx: Click context object. See uniqueid_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See uniqueid_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ uniqueid_read_id()

err_t uniqueid_read_id ( uniqueid_t * ctx,
uint8_t * family,
uint8_t * serial_num )

UNIQUE ID read Family Code and Serial Number function.

This function reads Family Code and Serial Number of device's ROM memory.

Parameters
[in]ctx: Click context object. See uniqueid_t object definition for detailed explanation.
[out]family: Address pointing where to store Family Code information.
[out]serial_num: Address pointing where to store Serial Number information.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.