color12 2.1.0.0
Color 12 Click Driver

API for configuring and manipulating Color 12 Click driver. More...

Topics

 Color 12 Registers List
 List of registers of Color 12 Click driver.
 
 Color 12 Registers Settings
 Settings for registers of Color 12 Click driver.
 
 Color 12 MikroBUS Map
 MikroBUS pin mapping of Color 12 Click driver.
 

Functions

void color12_cfg_setup (color12_cfg_t *cfg)
 Color 12 configuration object setup function.
 
err_t color12_init (color12_t *ctx, color12_cfg_t *cfg)
 Color 12 initialization function.
 
err_t color12_default_cfg (color12_t *ctx)
 Color 12 default configuration function.
 
err_t color12_generic_write (color12_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Color 12 I2C writing function.
 
err_t color12_generic_read (color12_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Color 12 I2C reading function.
 
err_t color12_sw_reset (color12_t *ctx)
 Color 12 software reset function.
 
err_t color12_set_config (color12_t *ctx, color12_config_t config)
 Color 12 sets the configuration function.
 
err_t color12_get_config (color12_t *ctx, color12_config_t *config)
 Color 12 gets the configuration function.
 
err_t color12_get_color_data (color12_t *ctx, color12_color_sel_t color_sel, uint16_t *color_data)
 Color 12 gets the color measurement result function.
 
err_t color12_get_device_id (color12_t *ctx, uint8_t *device_id)
 Color 12 gets the device ID function.
 
uint8_t color12_get_int_pin (color12_t *ctx)
 Color 12 gets the interrupt function.
 

Detailed Description

API for configuring and manipulating Color 12 Click driver.

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

Function Documentation

◆ color12_cfg_setup()

void color12_cfg_setup ( color12_cfg_t * cfg)

Color 12 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ color12_default_cfg()

err_t color12_default_cfg ( color12_t * ctx)

Color 12 default configuration function.

This function executes a default configuration of Color 12 click board.

Parameters
[in]ctx: Click context object. See color12_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ color12_generic_read()

err_t color12_generic_read ( color12_t * ctx,
uint8_t reg,
uint8_t * data_out,
uint8_t len )

Color 12 I2C reading function.

This function reads a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See color12_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ color12_generic_write()

err_t color12_generic_write ( color12_t * ctx,
uint8_t reg,
uint8_t * data_in,
uint8_t len )

Color 12 I2C writing function.

This function writes a desired number of data bytes starting from the selected register by using I2C serial interface.

Parameters
[in]ctx: Click context object. See color12_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.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ color12_get_color_data()

err_t color12_get_color_data ( color12_t * ctx,
color12_color_sel_t color_sel,
uint16_t * color_data )

Color 12 gets the color measurement result function.

This function reads color measurement result data of the desired selection of the BU27006MUC-Z, Digital 16bit Serial Output Type Color Sensor IC on the Color 12 Click board™.

Parameters
[in]ctx: Click context object. See color12_t object definition for detailed explanation.
[in]color_sel: Color data selector. See color12_color_sel_t object definition for detailed explanation.
[out]color_data: Color measurement result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ color12_get_config()

err_t color12_get_config ( color12_t * ctx,
color12_config_t * config )

Color 12 gets the configuration function.

This function reads the configuration data of the BU27006MUC-Z, Digital 16bit Serial Output Type Color Sensor IC on the Color 12 Click board™.

Parameters
[in]ctx: Click context object. See color12_t object definition for detailed explanation.
[out]config: Sensor configuration object. See color12_config_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ color12_get_device_id()

err_t color12_get_device_id ( color12_t * ctx,
uint8_t * device_id )

Color 12 gets the device ID function.

This function reads a manufacturers ID of the BU27006MUC-Z, Digital 16bit Serial Output Type Color Sensor IC on the Color 12 Click board™.

Parameters
[in]ctx: Click context object. See color12_t object definition for detailed explanation.
[out]device_id: Manufacturer ID (0xE0).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ color12_get_int_pin()

uint8_t color12_get_int_pin ( color12_t * ctx)

Color 12 gets the interrupt function.

This function gets states of the Interrupt ( INT ) pin of the BU27006MUC-Z, Digital 16bit Serial Output Type Color Sensor IC on the Color 12 Click board™.

Parameters
[in]ctx: Click context object. See color12_t object definition for detailed explanation.
Returns
  • 0 - Low pin state,
  • 1 - High pin state
Note
None.

◆ color12_init()

err_t color12_init ( color12_t * ctx,
color12_cfg_t * cfg )

Color 12 initialization function.

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

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

◆ color12_set_config()

err_t color12_set_config ( color12_t * ctx,
color12_config_t config )

Color 12 sets the configuration function.

This function executes a configuration of the BU27006MUC-Z, Digital 16bit Serial Output Type Color Sensor IC on the Color 12 Click board™.

Parameters
[in]ctx: Click context object. See color12_t object definition for detailed explanation.
[in]config: Sensor configuration object. See color12_config_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ color12_sw_reset()

err_t color12_sw_reset ( color12_t * ctx)

Color 12 software reset function.

This function is used to perform a software reset of the BU27006MUC-Z, Digital 16bit Serial Output Type Color Sensor IC on the Color 12 Click board™.

Parameters
[in]ctx: Click context object. See color12_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.