annab412 2.1.0.0
ANNA-B412 Click Driver

API for configuring and manipulating ANNA-B412 Click driver. More...

Topics

 ANNA-B412 Device Settings
 Settings for registers of ANNA-B412 Click driver.
 
 ANNA-B412 MikroBUS Map
 MikroBUS pin mapping of ANNA-B412 Click driver.
 

Functions

void annab412_cfg_setup (annab412_cfg_t *cfg)
 ANNA-B412 configuration object setup function.
 
err_t annab412_init (annab412_t *ctx, annab412_cfg_t *cfg)
 ANNA-B412 initialization function.
 
err_t annab412_default_cfg (annab412_t *ctx)
 ANNA-B412 default configuration function.
 
err_t annab412_generic_write (annab412_t *ctx, uint8_t *data_in, uint16_t len)
 ANNA-B412 data writing function.
 
err_t annab412_generic_read (annab412_t *ctx, uint8_t *data_out, uint16_t len)
 ANNA-B412 data reading function.
 
void annab412_set_rst_pin (annab412_t *ctx, uint8_t state)
 ANNA-B412 set reset pin function.
 
void annab412_set_dsr_pin (annab412_t *ctx, uint8_t state)
 ANNA-B412 set data set ready pin function.
 
void annab412_set_cts_pin (annab412_t *ctx, uint8_t state)
 ANNA-B412 set clear to send pin function.
 
uint8_t annab412_get_dtr_pin (annab412_t *ctx)
 ANNA-B412 get data terminal ready pin function.
 
uint8_t annab412_get_rts_pin (annab412_t *ctx)
 ANNA-B412 get request to send pin function.
 
void annab412_hw_reset (annab412_t *ctx)
 ANNA-B412 hw reset function.
 
err_t annab412_send_command (annab412_t *ctx, char *command)
 ANNA-B412 send command function.
 
err_t annab412_set_cmd_echo_on (annab412_t *ctx)
 ANNA-B412 set command echo on function.
 
err_t annab412_set_cmd_echo_off (annab412_t *ctx)
 ANNA-B412 set command echo on function.
 
err_t annab412_set_cmd_device_name (annab412_t *ctx, char *device_name)
 ANNA-B412 set device name function.
 
err_t annab412_set_cmd_conn_mode (annab412_t *ctx, uint8_t mode)
 ANNA-B412 set connectability mode function.
 
err_t annab412_set_cmd_discover_mode (annab412_t *ctx, uint8_t mode)
 ANNA-B412 set discoverability mode function.
 
err_t annab412_set_cmd_enter_mode (annab412_t *ctx, uint8_t mode)
 ANNA-B412 set enter mode function.
 

Detailed Description

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

◆ annab412_cfg_setup()

void annab412_cfg_setup ( annab412_cfg_t * cfg)

ANNA-B412 configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ annab412_default_cfg()

err_t annab412_default_cfg ( annab412_t * ctx)

ANNA-B412 default configuration function.

This function executes a default configuration of ANNA-B412 click board.

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

◆ annab412_generic_read()

err_t annab412_generic_read ( annab412_t * ctx,
uint8_t * data_out,
uint16_t len )

ANNA-B412 data reading function.

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

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[out]data_out: Output read data.
[in]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.

◆ annab412_generic_write()

err_t annab412_generic_write ( annab412_t * ctx,
uint8_t * data_in,
uint16_t len )

ANNA-B412 data writing function.

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

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]data_in: 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.

◆ annab412_get_dtr_pin()

uint8_t annab412_get_dtr_pin ( annab412_t * ctx)

ANNA-B412 get data terminal ready pin function.

This function the logic state of the DTR pin

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
Logic state of the DTR pin.
Note
None.

◆ annab412_get_rts_pin()

uint8_t annab412_get_rts_pin ( annab412_t * ctx)

ANNA-B412 get request to send pin function.

This function the logic state of the RTS pin

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
Logic state of the RTS pin.
Note
None.

◆ annab412_hw_reset()

void annab412_hw_reset ( annab412_t * ctx)

ANNA-B412 hw reset function.

This function resets the module by toggling the RST pin.

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

◆ annab412_init()

err_t annab412_init ( annab412_t * ctx,
annab412_cfg_t * cfg )

ANNA-B412 initialization function.

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

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

◆ annab412_send_command()

err_t annab412_send_command ( annab412_t * ctx,
char * command )

ANNA-B412 send command function.

This function sends a desired command of the Stand-alone Bluetooth 5.1 low energy module on the ANNA-B412 click board™.

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]command: 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.

◆ annab412_set_cmd_conn_mode()

err_t annab412_set_cmd_conn_mode ( annab412_t * ctx,
uint8_t mode )

ANNA-B412 set connectability mode function.

This function sets the connectability mode of the Stand-alone Bluetooth 5.1 low energy module on the ANNA-B412 click board™.

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]mode: Desired connectability mode [1-2].
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ annab412_set_cmd_device_name()

err_t annab412_set_cmd_device_name ( annab412_t * ctx,
char * device_name )

ANNA-B412 set device name function.

This function sets the device name of the Stand-alone Bluetooth 5.1 low energy module on the ANNA-B412 click board™.

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]device_name: Desired device name.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ annab412_set_cmd_discover_mode()

err_t annab412_set_cmd_discover_mode ( annab412_t * ctx,
uint8_t mode )

ANNA-B412 set discoverability mode function.

This function sets the discoverability mode of the Stand-alone Bluetooth 5.1 low energy module on the ANNA-B412 click board™.

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]mode: Desired discoverability mode [1-3].
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ annab412_set_cmd_echo_off()

err_t annab412_set_cmd_echo_off ( annab412_t * ctx)

ANNA-B412 set command echo on function.

This function disable the echo mode of the Stand-alone Bluetooth 5.1 low energy module on the ANNA-B412 click board™.

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

◆ annab412_set_cmd_echo_on()

err_t annab412_set_cmd_echo_on ( annab412_t * ctx)

ANNA-B412 set command echo on function.

This function enables the echo mode of the Stand-alone Bluetooth 5.1 low energy module on the ANNA-B412 click board™.

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

◆ annab412_set_cmd_enter_mode()

err_t annab412_set_cmd_enter_mode ( annab412_t * ctx,
uint8_t mode )

ANNA-B412 set enter mode function.

This function sets the enter mode of the Stand-alone Bluetooth 5.1 low energy module on the ANNA-B412 click board™.

Parameters
[in]ctx: Click context object. See annab412_t object definition for detailed explanation.
[in]mode: Desired enter mode [0-4].
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation.
Note
None.

◆ annab412_set_cts_pin()

void annab412_set_cts_pin ( annab412_t * ctx,
uint8_t state )

ANNA-B412 set clear to send pin function.

This function sets a desired logic state of the CTS pin.

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

◆ annab412_set_dsr_pin()

void annab412_set_dsr_pin ( annab412_t * ctx,
uint8_t state )

ANNA-B412 set data set ready pin function.

This function sets a desired logic state of the DSR pin.

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

◆ annab412_set_rst_pin()

void annab412_set_rst_pin ( annab412_t * ctx,
uint8_t state )

ANNA-B412 set reset pin function.

This function sets a desired logic state of the RST pin.

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