tfmini
2.0.0.0
|
API for configuring and manipulating TFmini Click driver. More...
Modules | |
TFmini Device Settings | |
Settings for registers of TFmini Click driver. | |
TFmini MikroBUS Map | |
MikroBUS pin mapping of TFmini Click driver. | |
Functions | |
void | tfmini_cfg_setup (tfmini_cfg_t *cfg) |
TFmini configuration object setup function. More... | |
void | tfmini_drv_interface_selection (tfmini_cfg_t *cfg, tfmini_drv_t drv_sel) |
TFmini driver interface setup function. More... | |
err_t | tfmini_init (tfmini_t *ctx, tfmini_cfg_t *cfg) |
TFmini initialization function. More... | |
err_t | tfmini_default_cfg (tfmini_t *ctx) |
TFmini default configuration function. More... | |
err_t | tfmini_send_frame (tfmini_t *ctx, tfmini_frame_t frame) |
TFmini send frame function. More... | |
err_t | tfmini_get_response (tfmini_t *ctx, tfmini_frame_t *frame) |
TFmini get response function. More... | |
err_t | tfmini_get_firmware_version (tfmini_t *ctx, uint32_t *fw_version) |
TFmini get firmware version function. More... | |
err_t | tfmini_system_reset (tfmini_t *ctx) |
TFmini system reset function. More... | |
err_t | tfmini_set_frame_rate (tfmini_t *ctx, uint16_t frame_rate) |
TFmini set frame rate function. More... | |
err_t | tfmini_change_interface (tfmini_t *ctx, tfmini_drv_t drv_sel) |
TFmini change interface function. More... | |
err_t | tfmini_factory_default (tfmini_t *ctx) |
TFmini factory default function. More... | |
err_t | tfmini_save_settings (tfmini_t *ctx) |
TFmini save settings function. More... | |
err_t | tfmini_get_measurement (tfmini_t *ctx, int16_t *distance, int16_t *strength, float *temperature) |
TFmini get measurement function. More... | |
API for configuring and manipulating TFmini Click driver.
void tfmini_cfg_setup | ( | tfmini_cfg_t * | cfg | ) |
TFmini configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See tfmini_cfg_t object definition for detailed explanation. |
err_t tfmini_change_interface | ( | tfmini_t * | ctx, |
tfmini_drv_t | drv_sel | ||
) |
TFmini change interface function.
This function sets the communication interface bit of the appropriate register.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See tfmini_drv_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t tfmini_default_cfg | ( | tfmini_t * | ctx | ) |
TFmini default configuration function.
This function executes a default configuration of TFmini click board.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
0
- Success, -1
- Error.void tfmini_drv_interface_selection | ( | tfmini_cfg_t * | cfg, |
tfmini_drv_t | drv_sel | ||
) |
TFmini 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 tfmini_cfg_t object definition for detailed explanation. |
[in] | drv_sel | : Driver interface selection. See tfmini_drv_t object definition for detailed explanation. |
err_t tfmini_factory_default | ( | tfmini_t * | ctx | ) |
TFmini factory default function.
This function resets the system to factory settings by issuing the factory default command.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t tfmini_get_firmware_version | ( | tfmini_t * | ctx, |
uint32_t * | fw_version | ||
) |
TFmini get firmware version function.
This function reads the sensor firmware version.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
[out] | fw_version | : 24bit firmware version value in form V3V2V1. |
0
- Success, -1
- Error.err_t tfmini_get_measurement | ( | tfmini_t * | ctx, |
int16_t * | distance, | ||
int16_t * | strength, | ||
float * | temperature | ||
) |
TFmini get measurement function.
This function reads the output data frame and obtains the distance, strength and temperature values from it.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
[out] | distance | : Target object distance in cm. |
[out] | strength | : Signal strength [0-65535]. |
[out] | temperature | : Sensor internal temperature in Celsius. |
0
- Success, -1
- Error or low signal strength, -2
- Signal strength saturation, -4
- Ambient light saturation, -5
- No header found, -6
- Wrong checksum.err_t tfmini_get_response | ( | tfmini_t * | ctx, |
tfmini_frame_t * | frame | ||
) |
TFmini get response function.
This function reads the command response frame of the sensor.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
[out] | frame | : Command response frame. See tfmini_frame_t object definition for detailed explanation. |
0
- Success, -1
- Error, -5
- No header found, -6
- Wrong checksum.err_t tfmini_init | ( | tfmini_t * | ctx, |
tfmini_cfg_t * | cfg | ||
) |
TFmini initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See tfmini_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t tfmini_save_settings | ( | tfmini_t * | ctx | ) |
TFmini save settings function.
This function issues the save settings command.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t tfmini_send_frame | ( | tfmini_t * | ctx, |
tfmini_frame_t | frame | ||
) |
TFmini send frame function.
This function sends a command frame to the sensor.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
[in] | frame | : Command frame. See tfmini_frame_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t tfmini_set_frame_rate | ( | tfmini_t * | ctx, |
uint16_t | frame_rate | ||
) |
TFmini set frame rate function.
This function sets the output data frame rate.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
[in] | frame_rate | : Output data frame rate in Hz. |
0
- Success, -1
- Error.err_t tfmini_system_reset | ( | tfmini_t * | ctx | ) |
TFmini system reset function.
This function resets the system by issuing the system reset command.
[in] | ctx | : Click context object. See tfmini_t object definition for detailed explanation. |
0
- Success, -1
- Error.