API for configuring and manipulating UNIQUEID click driver.
More...
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.
◆ 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 | |
◆ uniqueid_cfg_setup()
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()
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()
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
-
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.