ble10 2.0.0.0
BLE 10 Click Driver

API for configuring and manipulating BLE 10 Click driver. More...

Topics

 BLE 10 Device Settings
 Settings for registers of BLE 10 Click driver.
 
 BLE 10 MikroBUS Map
 MikroBUS pin mapping of BLE 10 Click driver.
 

Functions

void ble10_cfg_setup (ble10_cfg_t *cfg)
 BLE 10 configuration object setup function.
 
err_t ble10_init (ble10_t *ctx, ble10_cfg_t *cfg)
 BLE 10 initialization function.
 
void ble10_default_cfg (ble10_t *ctx)
 BLE 10 default configuration function.
 
err_t ble10_generic_write (ble10_t *ctx, char *data_buf, uint16_t len)
 BLE 10 data writing function.
 
err_t ble10_generic_read (ble10_t *ctx, char *data_buf, uint16_t max_len)
 BLE 10 data reading function.
 
uint8_t ble10_get_rts_pin (ble10_t *ctx)
 BLE 10 get ready to send pin function.
 
uint8_t ble10_get_pio3_pin (ble10_t *ctx)
 BLE 10 get PIO3 pin function.
 
void ble10_set_cts_pin (ble10_t *ctx, uint8_t state)
 BLE 10 set clear to send pin function.
 
void ble10_set_rst_pin (ble10_t *ctx, uint8_t state)
 BLE 10 set reset pin function.
 
void ble10_hw_reset (ble10_t *ctx)
 BLE 10 hw reset function.
 
err_t ble10_sw_reset (ble10_t *ctx)
 BLE 10 software reset function.
 
err_t ble10_factory_reset (ble10_t *ctx)
 BLE 10 factory reset function.
 
err_t ble10_send_cmd (ble10_t *ctx, char *at_cmd_buf)
 BLE 10 send command function.
 
err_t ble10_send_cmd_with_parameter (ble10_t *ctx, char *at_cmd_buf, char *param_buf)
 BLE 10 send command with parameter function.
 
err_t ble10_send_cmd_check (ble10_t *ctx, char *at_cmd_buf)
 BLE 10 send command check function.
 
err_t ble10_remove_pairings (ble10_t *ctx)
 BLE 10 remove pairings function.
 
err_t ble10_list_pairings (ble10_t *ctx)
 BLE 10 list current pairings function.
 
err_t ble10_set_device_name (ble10_t *ctx, char *dev_name)
 BLE 10 set local device name function.
 
err_t ble10_discover_nearby_devices (ble10_t *ctx)
 BLE 10 discover nearby devices function.
 
err_t ble10_get_temperature (ble10_t *ctx)
 BLE 10 get temperature function.
 
err_t ble10_read_an_pin_value (ble10_t *ctx, uint16_t *data_out)
 BLE 10 read AIN pin value function.
 
err_t ble10_read_an_pin_voltage (ble10_t *ctx, float *data_out)
 BLE 10 read AIN pin voltage level function.
 

Detailed Description

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

◆ ble10_cfg_setup()

void ble10_cfg_setup ( ble10_cfg_t * cfg)

BLE 10 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ ble10_default_cfg()

void ble10_default_cfg ( ble10_t * ctx)

BLE 10 default configuration function.

This function executes a default configuration of BLE 10 click board.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
Returns
None.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ ble10_discover_nearby_devices()

err_t ble10_discover_nearby_devices ( ble10_t * ctx)

BLE 10 discover nearby devices function.

This function discovers nearby advertising LE devices.

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

◆ ble10_factory_reset()

err_t ble10_factory_reset ( ble10_t * ctx)

BLE 10 factory reset function.

This function factory resets the device.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
Factory reset clears the pairings.

◆ ble10_generic_read()

err_t ble10_generic_read ( ble10_t * ctx,
char * data_buf,
uint16_t max_len )

BLE 10 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.
Note
None.

◆ ble10_generic_write()

err_t ble10_generic_write ( ble10_t * ctx,
char * data_buf,
uint16_t len )

BLE 10 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble10_get_pio3_pin()

uint8_t ble10_get_pio3_pin ( ble10_t * ctx)

BLE 10 get PIO3 pin function.

This function returns the PIO3 pin logic state.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ble10_get_rts_pin()

uint8_t ble10_get_rts_pin ( ble10_t * ctx)

BLE 10 get ready to send pin function.

This function returns the RTS pin logic state.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ble10_get_temperature()

err_t ble10_get_temperature ( ble10_t * ctx)

BLE 10 get temperature function.

This function executes get temperature command which returns the current temperature of the module's internal temperature sensor.

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

◆ ble10_hw_reset()

void ble10_hw_reset ( ble10_t * ctx)

BLE 10 hw reset function.

This function resets the module by toggling the RST pin.

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

◆ ble10_init()

err_t ble10_init ( ble10_t * ctx,
ble10_cfg_t * cfg )

BLE 10 initialization function.

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

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

◆ ble10_list_pairings()

err_t ble10_list_pairings ( ble10_t * ctx)

BLE 10 list current pairings function.

This function lists all current pairings.

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

◆ ble10_read_an_pin_value()

err_t ble10_read_an_pin_value ( ble10_t * ctx,
uint16_t * data_out )

BLE 10 read AIN pin value function.

This function reads results of AD conversion of the AIN pin.

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

◆ ble10_read_an_pin_voltage()

err_t ble10_read_an_pin_voltage ( ble10_t * ctx,
float * data_out )

BLE 10 read AIN pin voltage level function.

This function reads results of AD conversion of the AIN pin and converts them to proportional voltage level.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[out]data_out: Output voltage level of the analog pin [V].
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
The conversion to voltage depends on the entered configuration of the ADC (resolution, reference voltage).

◆ ble10_remove_pairings()

err_t ble10_remove_pairings ( ble10_t * ctx)

BLE 10 remove pairings function.

This function removes all the device pairings.

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

◆ ble10_send_cmd()

err_t ble10_send_cmd ( ble10_t * ctx,
char * at_cmd_buf )

BLE 10 send command function.

This function sends a desired command with the CR byte appended to.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[in]at_cmd_buf: Command string.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble10_send_cmd_check()

err_t ble10_send_cmd_check ( ble10_t * ctx,
char * at_cmd_buf )

BLE 10 send command check function.

This function sends a desired command with the question mark and CR byte appended to.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[in]at_cmd_buf: Command string.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble10_send_cmd_with_parameter()

err_t ble10_send_cmd_with_parameter ( ble10_t * ctx,
char * at_cmd_buf,
char * param_buf )

BLE 10 send command with parameter function.

This function sends a desired command with the parameter buffer and CR byte appended to.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[in]at_cmd_buf: Command string.
[in]param_buf: Parameters string.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble10_set_cts_pin()

void ble10_set_cts_pin ( ble10_t * ctx,
uint8_t state )

BLE 10 set clear to send pin function.

This function sets the CTS pin to a desired state.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ble10_set_device_name()

err_t ble10_set_device_name ( ble10_t * ctx,
char * dev_name )

BLE 10 set local device name function.

This function sets the local device name.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[in]dev_name: Device name ( up to 20 characters ).
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ble10_set_rst_pin()

void ble10_set_rst_pin ( ble10_t * ctx,
uint8_t state )

BLE 10 set reset pin function.

This function sets the RST pin to a desired state.

Parameters
[in]ctx: Click context object. See ble10_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ble10_sw_reset()

err_t ble10_sw_reset ( ble10_t * ctx)

BLE 10 software reset function.

This function software resets the device.

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