ultrasonic5 2.1.0.0
|
API for configuring and manipulating Ultrasonic 5 Click driver. More...
Topics | |
Ultrasonic 5 Registers List | |
List of registers of Ultrasonic 5 Click driver. | |
Ultrasonic 5 Registers Settings | |
Settings for registers of Ultrasonic 5 Click driver. | |
Ultrasonic 5 MikroBUS Map | |
MikroBUS pin mapping of Ultrasonic 5 Click driver. | |
Functions | |
void | ultrasonic5_cfg_setup (ultrasonic5_cfg_t *cfg) |
Ultrasonic 5 configuration object setup function. | |
err_t | ultrasonic5_init (ultrasonic5_t *ctx, ultrasonic5_cfg_t *cfg) |
Ultrasonic 5 initialization function. | |
err_t | ultrasonic5_default_cfg (ultrasonic5_t *ctx) |
Ultrasonic 5 default configuration function. | |
err_t | ultrasonic5_write_register (ultrasonic5_t *ctx, uint8_t reg, uint8_t data_in) |
Ultrasonic 5 data writing function. | |
err_t | ultrasonic5_read_register (ultrasonic5_t *ctx, uint8_t reg, uint8_t *data_out) |
Ultrasonic 5 data reading function. | |
err_t | ultrasonic5_check_communication (ultrasonic5_t *ctx) |
Ultrasonic 5 check communication function. | |
void | ultrasonic5_set_io1_pin (ultrasonic5_t *ctx) |
Ultrasonic 5 set io1 pin function. | |
void | ultrasonic5_clear_io1_pin (ultrasonic5_t *ctx) |
Ultrasonic 5 clear io1 pin function. | |
uint8_t | ultrasonic5_get_out4_pin (ultrasonic5_t *ctx) |
Ultrasonic 5 get out4 pin function. | |
err_t | ultrasonic5_read_an_pin_value (ultrasonic5_t *ctx, uint16_t *data_out) |
Ultrasonic 5 read AN pin value function. | |
err_t | ultrasonic5_read_an_pin_voltage (ultrasonic5_t *ctx, float *data_out) |
Ultrasonic 5 read AN pin voltage level function. | |
err_t | ultrasonic5_set_duty_cycle (ultrasonic5_t *ctx, float duty_cycle) |
Ultrasonic 5 sets PWM duty cycle. | |
err_t | ultrasonic5_pwm_stop (ultrasonic5_t *ctx) |
Ultrasonic 5 stop PWM module. | |
err_t | ultrasonic5_pwm_start (ultrasonic5_t *ctx) |
Ultrasonic 5 start PWM module. | |
API for configuring and manipulating Ultrasonic 5 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void ultrasonic5_cfg_setup | ( | ultrasonic5_cfg_t * | cfg | ) |
Ultrasonic 5 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See ultrasonic5_cfg_t object definition for detailed explanation. |
err_t ultrasonic5_check_communication | ( | ultrasonic5_t * | ctx | ) |
Ultrasonic 5 check communication function.
This function checks the communication by reading and verifying the device ID.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void ultrasonic5_clear_io1_pin | ( | ultrasonic5_t * | ctx | ) |
Ultrasonic 5 clear io1 pin function.
This function clears the IO1 pin to low logic state.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
err_t ultrasonic5_default_cfg | ( | ultrasonic5_t * | ctx | ) |
Ultrasonic 5 default configuration function.
This function executes a default configuration of Ultrasonic 5 click board.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t ultrasonic5_get_out4_pin | ( | ultrasonic5_t * | ctx | ) |
Ultrasonic 5 get out4 pin function.
This function returns the OUT4 pin logic state.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
err_t ultrasonic5_init | ( | ultrasonic5_t * | ctx, |
ultrasonic5_cfg_t * | cfg ) |
Ultrasonic 5 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See ultrasonic5_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ultrasonic5_pwm_start | ( | ultrasonic5_t * | ctx | ) |
Ultrasonic 5 start PWM module.
This function starts the PWM module output.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ultrasonic5_pwm_stop | ( | ultrasonic5_t * | ctx | ) |
Ultrasonic 5 stop PWM module.
This function stops the PWM module output.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ultrasonic5_read_an_pin_value | ( | ultrasonic5_t * | ctx, |
uint16_t * | data_out ) |
Ultrasonic 5 read AN pin value function.
This function reads results of AD conversion of the AN pin.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ultrasonic5_read_an_pin_voltage | ( | ultrasonic5_t * | ctx, |
float * | data_out ) |
Ultrasonic 5 read AN pin voltage level function.
This function reads results of AD conversion of the AN pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t ultrasonic5_read_register | ( | ultrasonic5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_out ) |
Ultrasonic 5 data reading function.
This function reads data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[out] | data_out | : Output read data. |
0xXX
- Status bits, -1
- Error. See #err_t definition for detailed explanation. err_t ultrasonic5_set_duty_cycle | ( | ultrasonic5_t * | ctx, |
float | duty_cycle ) |
Ultrasonic 5 sets PWM duty cycle.
This function sets the PWM duty cycle in percentages ( Range[ 0..1 ] ).
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
[in] | duty_cycle | : PWM duty cycle. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void ultrasonic5_set_io1_pin | ( | ultrasonic5_t * | ctx | ) |
Ultrasonic 5 set io1 pin function.
This function sets the IO1 pin to high logic state.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
err_t ultrasonic5_write_register | ( | ultrasonic5_t * | ctx, |
uint8_t | reg, | ||
uint8_t | data_in ) |
Ultrasonic 5 data writing function.
This function writes data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See ultrasonic5_t object definition for detailed explanation. |
[in] | reg | : Register address. |
[in] | data_in | : Data to be written. |
0xXX
- Status bits, -1
- Error. See #err_t definition for detailed explanation.