proteuse 2.1.0.0
Loading...
Searching...
No Matches
proteuse.h File Reference

This file contains API for Proteus-e Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  proteuse_packet_t
 Proteus-e Click command packet structure object. More...
 
struct  proteuse_t
 Proteus-e Click context object. More...
 
struct  proteuse_cfg_t
 Proteus-e Click configuration object. More...
 

Macros

#define PROTEUSE_START_BYTE   0x02
 Proteus-e start byte.
 
#define PROTEUSE_CMD_TYPE_REQ   0x00
 Proteus-e commands type settings.
 
#define PROTEUSE_CMD_TYPE_CNF   0x40
 
#define PROTEUSE_CMD_TYPE_IND   0x80
 
#define PROTEUSE_CMD_TYPE_RSP   0xC0
 
#define PROTEUSE_CMD_TYPE_MASK   0xC0
 
#define PROTEUSE_CMD_REQ_RESET   0x00
 Proteus-e commands request settings.
 
#define PROTEUSE_CMD_REQ_GET_STATE   0x01
 
#define PROTEUSE_CMD_REQ_SLEEP   0x02
 
#define PROTEUSE_CMD_REQ_DATA   0x04
 
#define PROTEUSE_CMD_REQ_DISCONNECT   0x07
 
#define PROTEUSE_CMD_REQ_DELETE_BONDS   0x0E
 
#define PROTEUSE_CMD_REQ_GET_BONDS   0x0F
 
#define PROTEUSE_CMD_REQ_GET   0x10
 
#define PROTEUSE_CMD_REQ_SET   0x11
 
#define PROTEUSE_CMD_REQ_PHY_UPDATE   0x1A
 
#define PROTEUSE_CMD_REQ_UART_DISABLE   0x1B
 
#define PROTEUSE_CMD_REQ_FACTORY_RESET   0x1C
 
#define PROTEUSE_CMD_REQ_DTM_START   0x1D
 
#define PROTEUSE_CMD_REQ_DTM   0x1E
 
#define PROTEUSE_CMD_REQ_GET_RAM   0x20
 
#define PROTEUSE_CMD_REQ_SET_RAM   0x21
 
#define PROTEUSE_CMD_REQ_GPIO_LOCAL_WRITE_CFG   0x25
 
#define PROTEUSE_CMD_REQ_GPIO_LOCAL_WRITE   0x26
 
#define PROTEUSE_CMD_REQ_GPIO_LOCAL_READ   0x27
 
#define PROTEUSE_CMD_REQ_GPIO_REMOTE_WRITE_CFG   0x28
 
#define PROTEUSE_CMD_REQ_GPIO_REMOTE_WRITE   0x29
 
#define PROTEUSE_CMD_REQ_GPIO_REMOTE_READ   0x2A
 
#define PROTEUSE_CMD_REQ_GPIO_LOCAL_READ_CFG   0x2B
 
#define PROTEUSE_CMD_REQ_GPIO_REMOTE_READ_CFG   0x2C
 
#define PROTEUSE_CMD_REQ_ALLOW_UNBONDED_CONN   0x2D
 
#define PROTEUSE_CMD_CNF_RESET   0x40
 Proteus-e commands confirmation settings.
 
#define PROTEUSE_CMD_CNF_GET_STATE   0x41
 
#define PROTEUSE_CMD_CNF_SLEEP   0x42
 
#define PROTEUSE_CMD_CNF_DATA   0x44
 
#define PROTEUSE_CMD_CNF_DISCONNECT   0x47
 
#define PROTEUSE_CMD_CNF_DELETE_BONDS   0x4E
 
#define PROTEUSE_CMD_CNF_GET_BONDS   0x4F
 
#define PROTEUSE_CMD_CNF_GET   0x50
 
#define PROTEUSE_CMD_CNF_SET   0x51
 
#define PROTEUSE_CMD_CNF_PHY_UPDATE   0x5A
 
#define PROTEUSE_CMD_CNF_UART_DISABLE   0x5B
 
#define PROTEUSE_CMD_CNF_FACTORY_RESET   0x5C
 
#define PROTEUSE_CMD_CNF_DTM_START   0x5D
 
#define PROTEUSE_CMD_CNF_DTM   0x5E
 
#define PROTEUSE_CMD_CNF_GET_RAM   0x60
 
#define PROTEUSE_CMD_CNF_SET_RAM   0x61
 
#define PROTEUSE_CMD_CNF_GPIO_LOCAL_WRITE_CFG   0x65
 
#define PROTEUSE_CMD_CNF_GPIO_LOCAL_WRITE   0x66
 
#define PROTEUSE_CMD_CNF_GPIO_LOCAL_READ   0x67
 
#define PROTEUSE_CMD_CNF_GPIO_REMOTE_WRITE_CFG   0x68
 
#define PROTEUSE_CMD_CNF_GPIO_REMOTE_WRITE   0x69
 
#define PROTEUSE_CMD_CNF_GPIO_REMOTE_READ   0x6A
 
#define PROTEUSE_CMD_CNF_GPIO_LOCAL_READ_CFG   0x6B
 
#define PROTEUSE_CMD_CNF_GPIO_REMOTE_READ_CFG   0x6C
 
#define PROTEUSE_CMD_CNF_ALLOW_UNBONDED_CONN   0x6D
 
#define PROTEUSE_CMD_IND_SLEEP   0x82
 Proteus-e commands indication settings.
 
#define PROTEUSE_CMD_IND_DATA   0x84
 
#define PROTEUSE_CMD_IND_CONNECT   0x86
 
#define PROTEUSE_CMD_IND_DISCONNECT   0x87
 
#define PROTEUSE_CMD_IND_SECURITY   0x88
 
#define PROTEUSE_CMD_IND_PHY_UPDATE   0x9A
 
#define PROTEUSE_CMD_IND_UART_ENABLE   0x9B
 
#define PROTEUSE_CMD_IND_ERROR   0xA2
 
#define PROTEUSE_CMD_IND_GPIO_LOCAL_WRITE   0xA6
 
#define PROTEUSE_CMD_IND_GPIO_REMOTE_WRITE_CFG   0xA8
 
#define PROTEUSE_CMD_IND_GPIO_REMOTE_WRITE   0xA9
 
#define PROTEUSE_CMD_RSP_TX_COMPLETE   0xC4
 Proteus-e commands response settings.
 
#define PROTEUSE_CMD_RSP_CHANNEL_OPEN   0xC6
 
#define PROTEUSE_SET_IDX_FS_FW_VERSION   0x01
 Proteus-e user settings index list.
 
#define PROTEUSE_SET_IDX_RF_DEVICE_NAME   0x02
 
#define PROTEUSE_SET_IDX_FS_MAC   0x03
 
#define PROTEUSE_SET_IDX_FS_BTMAC   0x04
 
#define PROTEUSE_SET_IDX_UART_TRANSP_ETX   0x05
 
#define PROTEUSE_SET_IDX_UART_TRANSP_ETX_CFG   0x06
 
#define PROTEUSE_SET_IDX_RF_ADV_TIMEOUT   0x07
 
#define PROTEUSE_SET_IDX_RF_CONN_INTERVAL   0x08
 
#define PROTEUSE_SET_IDX_RF_ADV_INTERVAL   0x09
 
#define PROTEUSE_SET_IDX_UART_CFG_INDEX   0x0B
 
#define PROTEUSE_SET_IDX_RF_SEC_FLAGS   0x0C
 
#define PROTEUSE_SET_IDX_RF_ADV_DATA   0x0D
 
#define PROTEUSE_SET_IDX_RF_SCAN_RSP_DATA   0x0E
 
#define PROTEUSE_SET_IDX_FS_DEVICE_INFO   0x0F
 
#define PROTEUSE_SET_IDX_FS_SERIAL_NUMBER   0x10
 
#define PROTEUSE_SET_IDX_RF_TX_POWER   0x11
 
#define PROTEUSE_SET_IDX_RF_STATIC_PASSKEY   0x12
 
#define PROTEUSE_SET_IDX_RF_APPEARANCE   0x19
 
#define PROTEUSE_SET_IDX_RF_SPP_BASE_UUID   0x1A
 
#define PROTEUSE_SET_IDX_RF_CFG_FLAGS   0x1C
 
#define PROTEUSE_SET_IDX_RF_SPP_SERVICE_UUID   0x20
 
#define PROTEUSE_SET_IDX_RF_SPP_RX_UUID   0x21
 
#define PROTEUSE_SET_IDX_RF_SPP_TX_UUID   0x22
 
#define PROTEUSE_SET_IDX_UART_TRANSP_TIMEOUT   0x24
 
#define PROTEUSE_SET_IDX_UART_TRANSP_MAX_PL   0x25
 
#define PROTEUSE_CNF_GET_STATUS_OK   0x00
 Proteus-e CNF_GET status settings.
 
#define PROTEUSE_CNF_GET_STATUS_FAILED   0x01
 
#define PROTEUSE_CNF_GET_STATUS_NOT_PERMITTED   0xFF
 
#define PROTEUSE_CNF_DATA_STATUS_OK   0x00
 Proteus-e CNF_DATA status settings.
 
#define PROTEUSE_CNF_DATA_STATUS_FAILED   0x01
 
#define PROTEUSE_CNF_DATA_STATUS_NOT_PERMITTED   0xFF
 
#define PROTEUSE_IND_DISC_REASON_TIMEOUT   0x08
 Proteus-e IND_DISCONNECT reason settings.
 
#define PROTEUSE_IND_DISC_REASON_USER_TERM   0x13
 
#define PROTEUSE_IND_DISC_REASON_HOST_TERM   0x16
 
#define PROTEUSE_IND_DISC_REASON_CONN_INTERVAL   0x3B
 
#define PROTEUSE_IND_DISC_REASON_MIC_FAILURE   0x3D
 
#define PROTEUSE_IND_DISC_REASON_SETUP_FAILED   0x3E
 
#define PROTEUSE_IND_SEC_STATUS_RE_BONDED   0x00
 Proteus-e IND_SECURITY status settings.
 
#define PROTEUSE_IND_SEC_STATUS_BONDED   0x01
 
#define PROTEUSE_IND_SEC_STATUS_PAIRED   0x02
 
#define PROTEUSE_RSP_TIMEOUT_1000MS   1000
 Proteus-e response timeout settings.
 
#define PROTEUSE_WAIT_TIME_1S   1
 
#define PROTEUSE_TX_DRV_BUFFER_SIZE   300
 Proteus-e driver buffer size.
 
#define PROTEUSE_RX_DRV_BUFFER_SIZE   300
 
#define PROTEUSE_PAYLOAD_BUFFER_SIZE   256
 
#define PROTEUSE_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  proteuse_return_value_t { PROTEUSE_OK = 0 , PROTEUSE_ERROR = -1 }
 Proteus-e Click return value data. More...
 

Functions

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

Detailed Description

This file contains API for Proteus-e Click Driver.

Enumeration Type Documentation

◆ proteuse_return_value_t

Proteus-e Click return value data.

Predefined enum values for driver return values.

Enumerator
PROTEUSE_OK 
PROTEUSE_ERROR