proteuse
2.1.0.0
|
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... | |
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.
void proteuse_cfg_setup | ( | proteuse_cfg_t * | cfg | ) |
Proteus-e configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See proteuse_cfg_t object definition for detailed explanation. |
void proteuse_clear_buffers | ( | proteuse_t * | ctx | ) |
Proteus-e clear buffers function.
This function clears the ring buffers and the event packet object.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
err_t proteuse_default_cfg | ( | proteuse_t * | ctx | ) |
Proteus-e default configuration function.
This function executes a default configuration of Proteus-e click board.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void proteuse_enable_uart | ( | proteuse_t * | ctx | ) |
Proteus-e enable uart function.
This function enables uart by toggling the uart enable pin logic state.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
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.
[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. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. 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.
[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. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
[in] | set_idx | : User settings index. |
0
- Correct packet received, -1
- Error. 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.
[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. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
0
- Correct packet received, -1
- Error. See #err_t definition for detailed explanation. 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.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
0
- Correct packet received, -1
- Error. void proteuse_send_cmd | ( | proteuse_t * | ctx | ) |
Proteus-e send command function.
This function sends a desired command packet from the click context object.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
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.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[in] | ctx | : Click context object. See proteuse_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
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.
[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. |
0
- Correct packet received, -1
- Error. 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.
[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. |
0
- Correct packet received, -1
- Error.