bletiny 2.0.0.0
|
API for configuring and manipulating BLE TINY Click driver. More...
Topics | |
BLE TINY Commands List | |
List of commands of BLE TINY Click driver. | |
BLE TINY Device Settings | |
Settings for registers of BLE TINY Click driver. | |
BLE TINY MikroBUS Map | |
MikroBUS pin mapping of BLE TINY Click driver. | |
Functions | |
void | bletiny_cfg_setup (bletiny_cfg_t *cfg) |
BLE TINY configuration object setup function. | |
err_t | bletiny_init (bletiny_t *ctx, bletiny_cfg_t *cfg) |
BLE TINY initialization function. | |
err_t | bletiny_default_cfg (bletiny_t *ctx) |
BLE TINY default configuration function. | |
err_t | bletiny_generic_write (bletiny_t *ctx, char *data_buf, uint16_t len) |
BLE TINY data writing function. | |
err_t | bletiny_generic_read (bletiny_t *ctx, char *data_buf, uint16_t max_len) |
BLE TINY data reading function. | |
void | bletiny_send_cmd (bletiny_t *ctx, char *cmd) |
Send command function. | |
void | bletiny_spi_config (bletiny_t *ctx, uint8_t speed, uint8_t mode) |
Configure Click board for SPI master communication. | |
err_t | bletiny_spi_write (bletiny_t *ctx, char *data_buf, uint8_t len) |
Send command to write data to slave device via SPI communication. | |
err_t | bletiny_spi_read (bletiny_t *ctx, char *data_buf, uint8_t len) |
Send command to read data from slave device via SPI communication. | |
err_t | bletiny_spi_write_then_read (bletiny_t *ctx, uint8_t *data_write, uint8_t write_len, char *data_read, uint8_t read_len) |
Send command to write data to and then read data from slave device via SPI communication. | |
void | bletiny_i2c_config (bletiny_t *ctx, uint8_t speed, uint8_t reg_len) |
Configure Click board for I2C master communication. | |
err_t | bletiny_i2c_write (bletiny_t *ctx, uint8_t slave_address, uint16_t reg, uint8_t reg_data) |
Send command to write data to reg address of slave device via I2C communication. | |
err_t | bletiny_i2c_read (bletiny_t *ctx, uint8_t slave_address, uint16_t reg, uint8_t *data_buf, uint8_t len) |
Send command to read data from slave device via I2C communication. | |
API for configuring and manipulating BLE TINY Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void bletiny_cfg_setup | ( | bletiny_cfg_t * | cfg | ) |
BLE TINY configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See bletiny_cfg_t object definition for detailed explanation. |
err_t bletiny_default_cfg | ( | bletiny_t * | ctx | ) |
BLE TINY default configuration function.
This function executes a default configuration of BLE TINY click board.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
0
- Success, -1
- Error.err_t bletiny_generic_read | ( | bletiny_t * | ctx, |
char * | data_buf, | ||
uint16_t | max_len ) |
BLE TINY data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[out] | data_buf | : Output read data. |
[in] | max_len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer.err_t bletiny_generic_write | ( | bletiny_t * | ctx, |
char * | data_buf, | ||
uint16_t | len ) |
BLE TINY data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | data_buf | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error.void bletiny_i2c_config | ( | bletiny_t * | ctx, |
uint8_t | speed, | ||
uint8_t | reg_len ) |
Configure Click board for I2C master communication.
Configure Click board pins for I2C communication and sets I2C communication parameters.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | speed | : Clock speed. |
[in] | reg_len | : I2C slave register length. |
err_t bletiny_i2c_read | ( | bletiny_t * | ctx, |
uint8_t | slave_address, | ||
uint16_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Send command to read data from slave device via I2C communication.
Send command over UART to read len bytes of reg address from attached Click board.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | slave_address | : Slave address to send. |
[in] | reg | : Register address of slave. |
[out] | data_buf | : Read data. |
[in] | len | : Number of bytes to read. |
>=0
- Success, <0
- Error.err_t bletiny_i2c_write | ( | bletiny_t * | ctx, |
uint8_t | slave_address, | ||
uint16_t | reg, | ||
uint8_t | reg_data ) |
Send command to write data to reg address of slave device via I2C communication.
Send command over UART to write reg_data to reg address of attached Click board.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | slave_address | : Slave address to send. |
[in] | reg | : Register address of slave. |
[in] | reg_data | : Data to write to reg. |
>=0
- Success, <0
- Error.err_t bletiny_init | ( | bletiny_t * | ctx, |
bletiny_cfg_t * | cfg ) |
BLE TINY initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See bletiny_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error.void bletiny_send_cmd | ( | bletiny_t * | ctx, |
char * | cmd ) |
Send command function.
This function sends the specified command to the click module.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | cmd | : Command variable. |
void bletiny_spi_config | ( | bletiny_t * | ctx, |
uint8_t | speed, | ||
uint8_t | mode ) |
Configure Click board for SPI master communication.
Configure Click board pins for SPI communication and sets SPI communication parameters.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | speed | : Clock speed. |
[in] | mode | : SPI mode. |
err_t bletiny_spi_read | ( | bletiny_t * | ctx, |
char * | data_buf, | ||
uint8_t | len ) |
Send command to read data from slave device via SPI communication.
Send command over UART to read len bytes of data_buf from attached Click board.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[out] | data_buf | : Read data. |
[in] | len | : Number of bytes to read. |
>=0
- Success, <0
- Error.err_t bletiny_spi_write | ( | bletiny_t * | ctx, |
char * | data_buf, | ||
uint8_t | len ) |
Send command to write data to slave device via SPI communication.
Send command over UART to write len bytes from data_buf to attached Click board.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[in] | data_buf | : Data to write. |
[in] | len | : Number of bytes to write from data_buf. |
>=0
- Success, <0
- Error.err_t bletiny_spi_write_then_read | ( | bletiny_t * | ctx, |
uint8_t * | data_write, | ||
uint8_t | write_len, | ||
char * | data_read, | ||
uint8_t | read_len ) |
Send command to write data to and then read data from slave device via SPI communication.
Send command over UART to write write_len bytes from data_write, and then to read read_len bytes of data_read from attached Click board.
[in] | ctx | : Click context object. See bletiny_t object definition for detailed explanation. |
[out] | data_write | : Data to write. |
[in] | write_len | : Number of bytes to write from data_write. |
[out] | data_read | : Read data. |
[in] | read_len | : Number of bytes to read. |
>=0
- Success, <0
- Error.