proteuse  2.1.0.0
Modules | Functions
Proteus-e Click Driver

API for configuring and manipulating Proteus-e Click driver. More...

Modules

 Proteus-e Device Settings
 Settings for registers of Proteus-e Click driver.
 
 Proteus-e MikroBUS Map
 MikroBUS pin mapping of Proteus-e Click driver.
 

Functions

void proteuse_cfg_setup (proteuse_cfg_t *cfg)
 Proteus-e configuration object setup function. More...
 
err_t proteuse_init (proteuse_t *ctx, proteuse_cfg_t *cfg)
 Proteus-e initialization function. More...
 
err_t proteuse_default_cfg (proteuse_t *ctx)
 Proteus-e default configuration function. More...
 
err_t proteuse_generic_write (proteuse_t *ctx, uint8_t *data_in, uint16_t len)
 Proteus-e data writing function. More...
 
err_t proteuse_generic_read (proteuse_t *ctx, uint8_t *data_out, uint16_t len)
 Proteus-e data reading function. More...
 
void proteuse_set_rst_pin (proteuse_t *ctx, uint8_t state)
 Proteus-e set RST pin function. More...
 
err_t proteuse_reset_device (proteuse_t *ctx)
 Proteus-e reset device function. More...
 
void proteuse_set_en_pin (proteuse_t *ctx, uint8_t state)
 Proteus-e set EN pin function. More...
 
void proteuse_enable_uart (proteuse_t *ctx)
 Proteus-e enable uart function. More...
 
void proteuse_send_cmd (proteuse_t *ctx)
 Proteus-e send command function. More...
 
err_t proteuse_read_event (proteuse_t *ctx)
 Proteus-e read event function. More...
 
err_t proteuse_wait_for_event (proteuse_t *ctx, uint8_t cmd, uint8_t max_time_s)
 Proteus-e wait for event function. More...
 
void proteuse_clear_buffers (proteuse_t *ctx)
 Proteus-e clear buffers function. More...
 
err_t proteuse_set_user_setting (proteuse_t *ctx, uint8_t set_idx, uint8_t *data_in, uint8_t len)
 Proteus-e set user settings function. More...
 
err_t proteuse_get_user_setting (proteuse_t *ctx, uint8_t set_idx)
 Proteus-e get user settings function. More...
 

Detailed Description

API for configuring and manipulating Proteus-e 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

◆ proteuse_cfg_setup()

void proteuse_cfg_setup ( proteuse_cfg_t cfg)

Proteus-e configuration object setup function.

This function initializes click configuration structure to initial values.

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

◆ proteuse_clear_buffers()

void proteuse_clear_buffers ( proteuse_t ctx)

Proteus-e clear buffers function.

This function clears the ring buffers and the event packet object.

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

◆ proteuse_default_cfg()

err_t proteuse_default_cfg ( proteuse_t ctx)

Proteus-e default configuration function.

This function executes a default configuration of Proteus-e click board.

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

◆ proteuse_enable_uart()

void proteuse_enable_uart ( proteuse_t ctx)

Proteus-e enable uart function.

This function enables uart by toggling the uart enable pin logic state.

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

◆ proteuse_generic_read()

err_t proteuse_generic_read ( proteuse_t ctx,
uint8_t *  data_out,
uint16_t  len 
)

Proteus-e data reading function.

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

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

◆ proteuse_generic_write()

err_t proteuse_generic_write ( proteuse_t ctx,
uint8_t *  data_in,
uint16_t  len 
)

Proteus-e data writing function.

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

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

◆ proteuse_get_user_setting()

err_t proteuse_get_user_setting ( proteuse_t ctx,
uint8_t  set_idx 
)

Proteus-e get user settings function.

This function reads data from the desired user settings index and stores it in the click context event packet object.

Parameters
[in]ctx: Click context object. See proteuse_t object definition for detailed explanation.
[in]set_idx: User settings index.
Returns
  • 0 - Correct packet received,
  • -1 - Error.
Note
None.

◆ proteuse_init()

err_t proteuse_init ( proteuse_t ctx,
proteuse_cfg_t cfg 
)

Proteus-e initialization function.

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

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

◆ proteuse_read_event()

err_t proteuse_read_event ( proteuse_t ctx)

Proteus-e read event function.

This function reads an event packet from the ring buffer and stores it in the click context object. It waits up to 1 second for a packet, and if there's no packet received it returns an error.

Parameters
[in]ctx: Click context object. See proteuse_t object definition for detailed explanation.
Returns
  • 0 - Correct packet received,
  • -1 - Error. See #err_t definition for detailed explanation.
Note
None.

◆ proteuse_reset_device()

err_t proteuse_reset_device ( proteuse_t ctx)

Proteus-e reset device function.

This function resets the device by toggling the reset pin logic state.

Parameters
[in]ctx: Click context object. See proteuse_t object definition for detailed explanation.
Returns
  • 0 - Correct packet received,
  • -1 - Error.
Note
None.

◆ proteuse_send_cmd()

void proteuse_send_cmd ( proteuse_t ctx)

Proteus-e send command function.

This function sends a desired command packet from the click context object.

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

◆ proteuse_set_en_pin()

void proteuse_set_en_pin ( proteuse_t ctx,
uint8_t  state 
)

Proteus-e set EN pin function.

This function sets the uart enable pin logic state.

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

◆ proteuse_set_rst_pin()

void proteuse_set_rst_pin ( proteuse_t ctx,
uint8_t  state 
)

Proteus-e set RST pin function.

This function sets the reset pin logic state.

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

◆ proteuse_set_user_setting()

err_t proteuse_set_user_setting ( proteuse_t ctx,
uint8_t  set_idx,
uint8_t *  data_in,
uint8_t  len 
)

Proteus-e set user settings function.

This function writes data to a desired user settings index.

Parameters
[in]ctx: Click context object. See proteuse_t object definition for detailed explanation.
[in]set_idx: User settings index.
[in]data_in: Data buffer to be written.
[in]len: Number of data bytes.
Returns
  • 0 - Correct packet received,
  • -1 - Error.
Note
None.

◆ proteuse_wait_for_event()

err_t proteuse_wait_for_event ( proteuse_t ctx,
uint8_t  cmd,
uint8_t  max_time_s 
)

Proteus-e wait for event function.

This function waits for the desired event packet to arrive and stores it in the click context object.

Parameters
[in]ctx: Click context object. See proteuse_t object definition for detailed explanation.
[in]cmd: Expected packet command byte.
[in]max_time_s: Maximum wait time in seconds.
Returns
  • 0 - Correct packet received,
  • -1 - Error.
Note
None.