35#include "mikrosdk_version.h"
38#if mikroSDK_GET_VERSION < 20800ul
39#include "rcu_delays.h"
45#include "drv_digital_out.h"
46#include "drv_digital_in.h"
69#define THYONEI_CMD_BROADCAST_DATA_REQ 0x06
70#define THYONEI_CMD_MULTICAST_DATA_REQ 0x05
71#define THYONEI_CMD_UNICAST_DATA_REQ 0x04
72#define THYONEI_CMD_MULTICAST_DATA_EX_REQ 0x08
73#define THYONEI_CMD_UNICAST_DATA_EX_REQ 0x07
74#define THYONEI_CMD_DATA_CNF 0x44
75#define THYONEI_CMD_TXCOMPLETE_RSP 0xC4
76#define THYONEI_CMD_DATA_IND 0x84
77#define THYONEI_CMD_SNIFFER_IND 0x99
78#define THYONEI_CMD_SET_REQ 0x11
79#define THYONEI_CMD_GET_REQ 0x10
80#define THYONEI_CMD_START_IND 0x73
81#define THYONEI_CMD_GETSTATE_REQ 0x01
82#define THYONEI_CMD_RESET_REQ 0x00
83#define THYONEI_CMD_SLEEP_REQ 0x02
84#define THYONEI_CMD_FACTORY_RESET_REQ 0x1C
85#define THYONEI_CMD_BOOTLOADER_REQ 0x1F
86#define THYONEI_CMD_TRANSPARENT_MODE_REQ 0x1B
87#define THYONEI_CMD_SETCHANNEL_REQ 0x19
88#define THYONEI_CMD_GPIO_LOCAL_SET_CONFIG_REQ 0x25
89#define THYONEI_CMD_GPIO_LOCAL_GET_CONFIG_REQ 0x26
90#define THYONEI_CMD_GPIO_REMOTE_SET_CONFIG_REQ 0x29
91#define THYONEI_CMD_GPIO_REMOTE_GET_CONFIG_REQ 0x2A
92#define THYONEI_CMD_GPIO_LOCAL_WRITE_REQ 0x27
93#define THYONEI_CMD_GPIO_LOCAL_READ_REQ 0x28
94#define THYONEI_CMD_GPIO_REMOTE_WRITE_REQ 0x2B
95#define THYONEI_CMD_GPIO_REMOTE_READ_REQ 0x2C
96#define THYONEI_CMD_GPIO_REMOTE_SET_CONFIG_IND 0xA9
97#define THYONEI_CMD_GPIO_REMOTE_WRITE_IND 0xAB
98#define THYONEI_CMD_ERROR_IND 0xA2
99#define THYONEI_CMD_DTM_START_REQ 0x1D
100#define THYONEI_CMD_DTM_REQ 0x1E
106#define THYONEI_INDEX_SERIAL_NUMBER 0x01
107#define THYONEI_INDEX_FW_VERSION 0x02
108#define THYONEI_INDEX_UART_CONFIG 0x04
109#define THYONEI_INDEX_UART_MODE 0x05
110#define THYONEI_INDEX_UART_TRANSPARENT_TIMEOUT 0x06
111#define THYONEI_INDEX_RF_CHANNEL 0x07
112#define THYONEI_INDEX_ENCRYPTION_MODE 0x08
113#define THYONEI_INDEX_RF_PROFILE 0x09
114#define THYONEI_INDEX_RF_NUM_RETRIES 0x0A
115#define THYONEI_INDEX_RF_TX_POWER 0x0B
116#define THYONEI_INDEX_RF_RP_NUM_SLOTS 0x0C
117#define THYONEI_INDEX_MAC_SOURCE_ADDRESS 0x10
118#define THYONEI_INDEX_MAC_DEST_ADDRESS 0x11
119#define THYONEI_INDEX_MAC_GROUP_ID 0x12
120#define THYONEI_INDEX_MAC_TRANSPARENT_ADDR_MODE 0x13
121#define THYONEI_INDEX_MAC_ENCRYPTION_KEY 0x14
122#define THYONEI_INDEX_MAC_TTL 0x15
123#define THYONEI_INDEX_CCA_MODE 0x16
124#define THYONEI_INDEX_CCA_THRESHOLD 0x17
125#define THYONEI_INDEX_GPIO_BLOCK_REMOTE 0x18
126#define THYONEI_INDEX_UART_TRANSP_ETX_CONFIG 0x19
127#define THYONEI_INDEX_UART_TRANSP_ETX 0x1A
128#define THYONEI_INDEX_UART_TRANSP_ETC_ENABLE 0x1B
129#define THYONEI_INDEX_UART_TRANSP_ETC 0x1C
130#define THYONEI_INDEX_RF_REPRATER_THRESHOLD 0x1D
131#define THYONEI_INDEX_MODULE_MODE 0x20
137#define THYONEI_RESPONSE_CODE 0x40
138#define THYONEI_START_SIGNAL 0x02
144#define THYONE_PIN_MODE_HIGH 0x01
145#define THYONE_PIN_MODE_LOW 0x00
152#define THYONEI_TX_DRV_BUFFER_SIZE 100
153#define THYONEI_RX_DRV_BUFFER_SIZE 300
171#define THYONEI_MAP_MIKROBUS( cfg, mikrobus ) \
172 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
173 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
174 cfg.bt = MIKROBUS( mikrobus, MIKROBUS_AN ); \
175 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
176 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
177 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
178 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
#define THYONEI_RX_DRV_BUFFER_SIZE
Definition: thyonei.h:153
#define THYONEI_TX_DRV_BUFFER_SIZE
Thyone-I driver buffer size.
Definition: thyonei.h:152
err_t thyonei_broadcast_data_req(thyonei_t *ctx, uint8_t message_len, uint8_t *message)
Thyone-I brodcast data function.
void thyonei_cfg_setup(thyonei_cfg_t *cfg)
Thyone-I configuration object setup function.
void thyonei_default_cfg(thyonei_t *ctx)
Thyone-I default configuration function.
err_t thyonei_set_req(thyonei_t *ctx, uint8_t settings_index, uint8_t parameters_length, uint8_t *parameters)
Thyone-I set individual parameters function.
err_t thyonei_get_req(thyonei_t *ctx, uint8_t settings_index, uint8_t *param_len, uint8_t *parameter)
Thyone-I get individual parameters function.
void thyonei_set_wup(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set WUP pin function.
void thyonei_set_bt(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set BT pin function.
err_t thyonei_send_command(thyonei_t *ctx, uint8_t command, uint16_t payload_length, uint8_t *payload)
Thyone-I send command function.
err_t thyonei_generic_write(thyonei_t *ctx, uint8_t *data_in, uint16_t len)
Thyone-I data writing function.
err_t thyonei_init(thyonei_t *ctx, thyonei_cfg_t *cfg)
Thyone-I initialization function.
uint8_t thyonei_get_cts_state(thyonei_t *ctx)
Thyone-I get CTS pin function.
err_t thyonei_generic_read(thyonei_t *ctx, uint8_t *data_out, uint16_t len)
Thyone-I data reading function.
err_t thyonei_multicast_data_req(thyonei_t *ctx, uint8_t message_len, uint8_t *message)
Thyone-I multicast data function.
void thyonei_set_rst(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set RST pin function.
void thyonei_hw_reset(thyonei_t *ctx)
Thyone-I hardware reser function.
void thyonei_set_rts(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set RTS pin function.
err_t thyonei_unicast_data_req(thyonei_t *ctx, uint8_t message_len, uint8_t *message)
Thyone-I unicast data function.
Thyone-I Click configuration object.
Definition: thyonei.h:212
pin_name_t rts
Definition: thyonei.h:220
uint32_t baud_rate
Definition: thyonei.h:225
pin_name_t wup
Definition: thyonei.h:221
pin_name_t cts
Definition: thyonei.h:222
pin_name_t bt
Definition: thyonei.h:218
bool uart_blocking
Definition: thyonei.h:226
uart_data_bits_t data_bit
Definition: thyonei.h:227
pin_name_t tx_pin
Definition: thyonei.h:215
pin_name_t rx_pin
Definition: thyonei.h:214
uart_stop_bits_t stop_bit
Definition: thyonei.h:229
uart_parity_t parity_bit
Definition: thyonei.h:228
pin_name_t rst
Definition: thyonei.h:219
Thyone-I Click context object.
Definition: thyonei.h:188
digital_out_t rts
Definition: thyonei.h:192
uart_t uart
Definition: thyonei.h:199
digital_out_t wup
Definition: thyonei.h:193
digital_in_t cts
Definition: thyonei.h:196
digital_out_t rst
Definition: thyonei.h:191
digital_out_t bt
Definition: thyonei.h:190
thyonei_return_value_t
Thyone-I Click return value data.
Definition: thyonei.h:238
@ THYONEI_OK
Definition: thyonei.h:239
@ THYONEI_ERROR
Definition: thyonei.h:240