Go to the documentation of this file.
39 #ifdef PREINIT_SUPPORTED
43 #ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49 #include "drv_digital_out.h"
50 #include "drv_digital_in.h"
73 #define THYONEI_CMD_BROADCAST_DATA_REQ 0x06
74 #define THYONEI_CMD_MULTICAST_DATA_REQ 0x05
75 #define THYONEI_CMD_UNICAST_DATA_REQ 0x04
76 #define THYONEI_CMD_MULTICAST_DATA_EX_REQ 0x08
77 #define THYONEI_CMD_UNICAST_DATA_EX_REQ 0x07
78 #define THYONEI_CMD_DATA_CNF 0x44
79 #define THYONEI_CMD_TXCOMPLETE_RSP 0xC4
80 #define THYONEI_CMD_DATA_IND 0x84
81 #define THYONEI_CMD_SNIFFER_IND 0x99
82 #define THYONEI_CMD_SET_REQ 0x11
83 #define THYONEI_CMD_GET_REQ 0x10
84 #define THYONEI_CMD_START_IND 0x73
85 #define THYONEI_CMD_GETSTATE_REQ 0x01
86 #define THYONEI_CMD_RESET_REQ 0x00
87 #define THYONEI_CMD_SLEEP_REQ 0x02
88 #define THYONEI_CMD_FACTORY_RESET_REQ 0x1C
89 #define THYONEI_CMD_BOOTLOADER_REQ 0x1F
90 #define THYONEI_CMD_TRANSPARENT_MODE_REQ 0x1B
91 #define THYONEI_CMD_SETCHANNEL_REQ 0x19
92 #define THYONEI_CMD_GPIO_LOCAL_SET_CONFIG_REQ 0x25
93 #define THYONEI_CMD_GPIO_LOCAL_GET_CONFIG_REQ 0x26
94 #define THYONEI_CMD_GPIO_REMOTE_SET_CONFIG_REQ 0x29
95 #define THYONEI_CMD_GPIO_REMOTE_GET_CONFIG_REQ 0x2A
96 #define THYONEI_CMD_GPIO_LOCAL_WRITE_REQ 0x27
97 #define THYONEI_CMD_GPIO_LOCAL_READ_REQ 0x28
98 #define THYONEI_CMD_GPIO_REMOTE_WRITE_REQ 0x2B
99 #define THYONEI_CMD_GPIO_REMOTE_READ_REQ 0x2C
100 #define THYONEI_CMD_GPIO_REMOTE_SET_CONFIG_IND 0xA9
101 #define THYONEI_CMD_GPIO_REMOTE_WRITE_IND 0xAB
102 #define THYONEI_CMD_ERROR_IND 0xA2
103 #define THYONEI_CMD_DTM_START_REQ 0x1D
104 #define THYONEI_CMD_DTM_REQ 0x1E
110 #define THYONEI_INDEX_SERIAL_NUMBER 0x01
111 #define THYONEI_INDEX_FW_VERSION 0x02
112 #define THYONEI_INDEX_UART_CONFIG 0x04
113 #define THYONEI_INDEX_UART_MODE 0x05
114 #define THYONEI_INDEX_UART_TRANSPARENT_TIMEOUT 0x06
115 #define THYONEI_INDEX_RF_CHANNEL 0x07
116 #define THYONEI_INDEX_ENCRYPTION_MODE 0x08
117 #define THYONEI_INDEX_RF_PROFILE 0x09
118 #define THYONEI_INDEX_RF_NUM_RETRIES 0x0A
119 #define THYONEI_INDEX_RF_TX_POWER 0x0B
120 #define THYONEI_INDEX_RF_RP_NUM_SLOTS 0x0C
121 #define THYONEI_INDEX_MAC_SOURCE_ADDRESS 0x10
122 #define THYONEI_INDEX_MAC_DEST_ADDRESS 0x11
123 #define THYONEI_INDEX_MAC_GROUP_ID 0x12
124 #define THYONEI_INDEX_MAC_TRANSPARENT_ADDR_MODE 0x13
125 #define THYONEI_INDEX_MAC_ENCRYPTION_KEY 0x14
126 #define THYONEI_INDEX_MAC_TTL 0x15
127 #define THYONEI_INDEX_CCA_MODE 0x16
128 #define THYONEI_INDEX_CCA_THRESHOLD 0x17
129 #define THYONEI_INDEX_GPIO_BLOCK_REMOTE 0x18
130 #define THYONEI_INDEX_UART_TRANSP_ETX_CONFIG 0x19
131 #define THYONEI_INDEX_UART_TRANSP_ETX 0x1A
132 #define THYONEI_INDEX_UART_TRANSP_ETC_ENABLE 0x1B
133 #define THYONEI_INDEX_UART_TRANSP_ETC 0x1C
134 #define THYONEI_INDEX_RF_REPRATER_THRESHOLD 0x1D
135 #define THYONEI_INDEX_MODULE_MODE 0x20
141 #define THYONEI_RESPONSE_CODE 0x40
142 #define THYONEI_START_SIGNAL 0x02
148 #define THYONE_PIN_MODE_HIGH 0x01
149 #define THYONE_PIN_MODE_LOW 0x00
156 #define THYONEI_TX_DRV_BUFFER_SIZE 300
157 #define THYONEI_RX_DRV_BUFFER_SIZE 300
175 #define THYONEI_MAP_MIKROBUS( cfg, mikrobus ) \
176 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
177 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
178 cfg.bt = MIKROBUS( mikrobus, MIKROBUS_AN ); \
179 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
180 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
181 cfg.wup = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
182 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
digital_out_t bt
Definition: thyonei.h:194
err_t thyonei_generic_write(thyonei_t *ctx, uint8_t *data_in, uint16_t len)
Thyone-I data writing function.
@ THYONEI_ERROR
Definition: thyonei.h:244
pin_name_t wup
Definition: thyonei.h:225
err_t thyonei_init(thyonei_t *ctx, thyonei_cfg_t *cfg)
Thyone-I initialization function.
#define THYONEI_RX_DRV_BUFFER_SIZE
Definition: thyonei.h:157
void thyonei_cfg_setup(thyonei_cfg_t *cfg)
Thyone-I configuration object setup function.
pin_name_t tx_pin
Definition: thyonei.h:219
Thyone-I Click context object.
Definition: thyonei.h:192
void thyonei_set_rts(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set RTS pin function.
pin_name_t rx_pin
Definition: thyonei.h:218
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.
pin_name_t rst
Definition: thyonei.h:223
#define THYONEI_TX_DRV_BUFFER_SIZE
Thyone-I driver buffer size.
Definition: thyonei.h:156
pin_name_t bt
Definition: thyonei.h:222
void thyonei_hw_reset(thyonei_t *ctx)
Thyone-I hardware reser function.
uint8_t thyonei_get_cts_state(thyonei_t *ctx)
Thyone-I get CTS pin 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.
uart_t uart
Definition: thyonei.h:203
digital_out_t wup
Definition: thyonei.h:197
err_t thyonei_send_command(thyonei_t *ctx, uint8_t command, uint16_t payload_length, uint8_t *payload)
Thyone-I send command function.
void thyonei_set_rst(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set RST pin function.
uart_parity_t parity_bit
Definition: thyonei.h:232
err_t thyonei_broadcast_data_req(thyonei_t *ctx, uint8_t message_len, uint8_t *message)
Thyone-I brodcast data function.
uart_stop_bits_t stop_bit
Definition: thyonei.h:233
err_t thyonei_generic_read(thyonei_t *ctx, uint8_t *data_out, uint16_t len)
Thyone-I data reading function.
void thyonei_set_bt(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set BT pin function.
err_t thyonei_unicast_data_req(thyonei_t *ctx, uint8_t message_len, uint8_t *message)
Thyone-I unicast data function.
@ THYONEI_OK
Definition: thyonei.h:243
digital_out_t rts
Definition: thyonei.h:196
digital_in_t cts
Definition: thyonei.h:200
pin_name_t cts
Definition: thyonei.h:226
bool uart_blocking
Definition: thyonei.h:230
uart_data_bits_t data_bit
Definition: thyonei.h:231
pin_name_t rts
Definition: thyonei.h:224
digital_out_t rst
Definition: thyonei.h:195
void thyonei_set_wup(thyonei_t *ctx, uint8_t pin_state)
Thyone-I set WUP pin function.
Thyone-I Click configuration object.
Definition: thyonei.h:216
uint32_t baud_rate
Definition: thyonei.h:229
thyonei_return_value_t
Thyone-I Click return value data.
Definition: thyonei.h:242
void thyonei_default_cfg(thyonei_t *ctx)
Thyone-I default configuration function.
err_t thyonei_multicast_data_req(thyonei_t *ctx, uint8_t message_len, uint8_t *message)
Thyone-I multicast data function.