cooler  2.1.0.0
Modules | Functions
Cooler Click Driver

API for configuring and manipulating Cooler Click driver. More...

Modules

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

Functions

void cooler_cfg_setup (cooler_cfg_t *cfg)
 Cooler configuration object setup function. More...
 
err_t cooler_init (cooler_t *ctx, cooler_cfg_t *cfg)
 Cooler initialization function. More...
 
err_t cooler_default_cfg (cooler_t *ctx)
 Cooler default configuration function. More...
 
err_t cooler_generic_write (cooler_t *ctx, uint8_t reg, uint8_t *data_in, uint8_t len)
 Cooler data writing function. More...
 
err_t cooler_generic_read (cooler_t *ctx, uint8_t reg, uint8_t *data_out, uint8_t len)
 Cooler data reading function. More...
 
err_t cooler_data_write (cooler_t *ctx, uint8_t reg, uint16_t data_in)
 Cooler 16-bit data writing function. More...
 
err_t cooler_data_read (cooler_t *ctx, uint8_t reg, uint16_t *data_out)
 Cooler 16-bit data reading function. More...
 
err_t cooler_get_device_id (cooler_t *ctx, uint16_t *device_id)
 Cooler get device ID function. More...
 
err_t cooler_sensor_voltage (cooler_t *ctx, float *voltage)
 Cooler get sensor voltage result function. More...
 
err_t cooler_get_object_temperature (cooler_t *ctx, float *temperature)
 Cooler get object temperature function. More...
 
uint8_t cooler_get_alert (cooler_t *ctx)
 Cooler fault indication function. More...
 
err_t cooler_read_raw_adc (cooler_t *ctx, uint16_t *raw_adc)
 Cooler read raw ADC value function. More...
 
err_t cooler_read_voltage (cooler_t *ctx, float *voltage)
 Cooler read voltage level function. More...
 
err_t cooler_set_vref (cooler_t *ctx, float vref)
 Cooler set vref function. More...
 
void cooler_set_in1_pin (cooler_t *ctx)
 Cooler set IN1 pin state function. More...
 
void cooler_clear_in1_pin (cooler_t *ctx)
 Cooler IN1 pin clearing function. More...
 
void cooler_set_in2_pin (cooler_t *ctx)
 Cooler set IN2 pin state function. More...
 
void cooler_clear_in2_pin (cooler_t *ctx)
 Cooler IN2 pin clearing function. More...
 
err_t cooler_set_out_state (cooler_t *ctx, cooler_out_state_t out_state)
 Cooler set output function. More...
 

Detailed Description

API for configuring and manipulating Cooler 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

◆ cooler_cfg_setup()

void cooler_cfg_setup ( cooler_cfg_t cfg)

Cooler configuration object setup function.

This function initializes Click configuration structure to initial values.

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

◆ cooler_clear_in1_pin()

void cooler_clear_in1_pin ( cooler_t ctx)

Cooler IN1 pin clearing function.

This function clears the IN1 (PWM) pin on the low level of the DRV8213 4-A Brushed DC Motor Driver with Integrated Current Sense, Current Regulation and Stall Detection on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ cooler_clear_in2_pin()

void cooler_clear_in2_pin ( cooler_t ctx)

Cooler IN2 pin clearing function.

This function clears the IN2 (RST) pin on the low level of the DRV8213 4-A Brushed DC Motor Driver with Integrated Current Sense, Current Regulation and Stall Detection on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ cooler_data_read()

err_t cooler_data_read ( cooler_t ctx,
uint8_t  reg,
uint16_t *  data_out 
)

Cooler 16-bit data reading function.

This function reads a 16-bit data from the selected register of the TMP007 Infrared Thermopile Sensor with Integrated Math Engine on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[in]reg: Register address.
[out]data_out: Output read data.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cooler_data_write()

err_t cooler_data_write ( cooler_t ctx,
uint8_t  reg,
uint16_t  data_in 
)

Cooler 16-bit data writing function.

This function writes a 16-bit data to the selected register of the TMP007 Infrared Thermopile Sensor with Integrated Math Engine on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[in]reg: Register address.
[in]data_in: Data to be written.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cooler_default_cfg()

err_t cooler_default_cfg ( cooler_t ctx)

Cooler default configuration function.

This function executes a default configuration of Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_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.

◆ cooler_generic_read()

err_t cooler_generic_read ( cooler_t ctx,
uint8_t  reg,
uint8_t *  data_out,
uint8_t  len 
)

Cooler data reading function.

This function reads a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See cooler_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.

◆ cooler_generic_write()

err_t cooler_generic_write ( cooler_t ctx,
uint8_t  reg,
uint8_t *  data_in,
uint8_t  len 
)

Cooler data writing function.

This function writes a desired number of data bytes starting from the selected register.

Parameters
[in]ctx: Click context object. See cooler_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.

◆ cooler_get_alert()

uint8_t cooler_get_alert ( cooler_t ctx)

Cooler fault indication function.

This function reads the state of the ALR (INT) pin of Cooler Click board.

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

◆ cooler_get_device_id()

err_t cooler_get_device_id ( cooler_t ctx,
uint16_t *  device_id 
)

Cooler get device ID function.

This function reads a device ID value of the TMP007 Infrared Thermopile Sensor with Integrated Math Engine on the Cooler Click board.

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

◆ cooler_get_object_temperature()

err_t cooler_get_object_temperature ( cooler_t ctx,
float *  temperature 
)

Cooler get object temperature function.

This function reads the object's temperature data in degrees Celsius of the TMP007 Infrared Thermopile Sensor with Integrated Math Engine on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[out]temperature: Temperature (degrees Celsius).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cooler_init()

err_t cooler_init ( cooler_t ctx,
cooler_cfg_t cfg 
)

Cooler initialization function.

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

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

◆ cooler_read_raw_adc()

err_t cooler_read_raw_adc ( cooler_t ctx,
uint16_t *  raw_adc 
)

Cooler read raw ADC value function.

This function reads raw ADC value.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[out]raw_adc: Output ADC result.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cooler_read_voltage()

err_t cooler_read_voltage ( cooler_t ctx,
float *  voltage 
)

Cooler read voltage level function.

This function reads raw ADC value and converts it to proportional voltage level.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[out]voltage: Output voltage level [V].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered reference voltage.

◆ cooler_sensor_voltage()

err_t cooler_sensor_voltage ( cooler_t ctx,
float *  voltage 
)

Cooler get sensor voltage result function.

This function reads the sensor voltage result of the TMP007 Infrared Thermopile Sensor with Integrated Math Engine on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[out]voltage: Sensor voltage result [+-5.12mV].
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cooler_set_in1_pin()

void cooler_set_in1_pin ( cooler_t ctx)

Cooler set IN1 pin state function.

This function sets the IN1 (PWM) pin on the high level of the DRV8213 4-A Brushed DC Motor Driver with Integrated Current Sense, Current Regulation and Stall Detection on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ cooler_set_in2_pin()

void cooler_set_in2_pin ( cooler_t ctx)

Cooler set IN2 pin state function.

This function sets the IN2 (RST) pin on the high level of the DRV8213 4-A Brushed DC Motor Driver with Integrated Current Sense, Current Regulation and Stall Detection on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
Returns
Nothing.
Note
None.

◆ cooler_set_out_state()

err_t cooler_set_out_state ( cooler_t ctx,
cooler_out_state_t  out_state 
)

Cooler set output function.

This function controls the operation of the cooler - on/off of the DRV8213 4-A Brushed DC Motor Driver with Integrated Current Sense, Current Regulation and Stall Detection on the Cooler Click board.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[in]out_state: Motor states selection. See cooler_out_state_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ cooler_set_vref()

err_t cooler_set_vref ( cooler_t ctx,
float  vref 
)

Cooler set vref function.

This function sets the voltage reference for Cooler Click driver.

Parameters
[in]ctx: Click context object. See cooler_t object definition for detailed explanation.
[in]vref: Reference voltage (volts).
Returns
  • 0 - Success,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
The default voltage reference set with cooler_init is 3.3V.