42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
67#define WIFI9_MAP_MIKROBUS( cfg, mikrobus ) \
68 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
69 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
70 cfg.adr = MIKROBUS( mikrobus, MIKROBUS_AN ); \
71 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST ); \
72 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
73 cfg.mcr = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
74 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_INT );
83#define WIFI9_ERROR_TIMEOUT -2
90#define WIFI9_MODULE_POWER_ON 1
91#define WIFI9_MODULE_POWER_OFF 0
98#define WIFI9_SELECT_CMD_UART 0
99#define WIFI9_SELECT_BIN_UART 1
106#define WIFI9_CMD_GET_SYSTEM_FIRMWARE "get system firmware"
107#define WIFI9_CMD_GET_SYSTEM_MAC_ADDR "get system macaddr"
108#define WIFI9_CMD_GET_SYSTEM_SERIAL_NUM "get system serialnum"
109#define WIFI9_CMD_GET_SYSTEM_RADIO_VER "get system radio_ver"
110#define WIFI9_CMD_GET_SYSTEM_BOOTL_VER "get system bootl_ver"
111#define WIFI9_CMD_GET_SYSTEM_HW_REV "get system hwrev"
112#define WIFI9_CMD_GET_WLAN_STATE "get wlan state"
113#define WIFI9_CMD_GET_WLAN_STATE_STA "get wlan state sta"
114#define WIFI9_CMD_SET_WLAN_STATE "set wlan state"
115#define WIFI9_CMD_SET_WLAN_STATE_STA_ON "set wlan state sta on"
116#define WIFI9_CMD_SET_WLAN_CFG "set wlan cfg"
117#define WIFI9_CMD_SET_WLAN_CFG_STA "set wlan cfg sta"
118#define WIFI9_CMD_SET_NETCAT_STATE "set netcat state"
119#define WIFI9_CMD_SET_NETCAT_STATE_OFF "set netcat state off"
120#define WIFI9_CMD_SET_NETCAT_STATE_ON "set netcat state on"
121#define WIFI9_CMD_SET_NETCAT_CFG "set netcat cfg"
122#define WIFI9_CMD_SET_NETCAT_CFG_SERVER "set netcat cfg server"
123#define WIFI9_CMD_SET_NETCAT_AUTH "set netcat auth"
124#define WIFI9_CMD_SET_NETCAT_AUTH_OFF "set netcat auth off"
125#define WIFI9_CMD_GET_NET_CFG "get net cfg"
126#define WIFI9_CMD_GET_NET_CFG_STA "get net cfg sta"
133#define WIFI9_DRV_TX_BUFFER_SIZE 300
134#define WIFI9_DRV_RX_BUFFER_SIZE 500
#define WIFI9_DRV_TX_BUFFER_SIZE
Definition wifi9.h:133
#define WIFI9_DRV_RX_BUFFER_SIZE
Definition wifi9.h:134
uint8_t wifi9_get_mcr_pin(wifi9_t *ctx)
Get MCR pin state.
void wifi9_generic_write(wifi9_t *ctx, uint8_t *data_buf, uint16_t len)
Generic write function.
int32_t wifi9_generic_read(wifi9_t *ctx, uint8_t *data_buf, uint16_t max_len)
Generic read function.
void wifi9_send_command(wifi9_t *ctx, uint8_t *command)
Send Command function.
void wifi9_select_uart(wifi9_t *ctx, uint8_t uart_select)
Switch to a command or binary uart.
uint8_t wifi9_get_cts_pin(wifi9_t *ctx)
Get CTS pin state.
void wifi9_reset_device(wifi9_t *ctx)
Module reset.
void wifi9_set_rst_pin(wifi9_t *ctx, uint8_t state)
Set RST pin state.
void wifi9_set_rts_pin(wifi9_t *ctx, uint8_t state)
Set RTS pin state.
err_t wifi9_init(wifi9_t *ctx, wifi9_cfg_t *cfg)
Initialization function.
void wifi9_cfg_setup(wifi9_cfg_t *cfg)
Config Object Initialization function.
Click configuration structure definition.
Definition wifi9.h:169
pin_name_t rts
Definition wifi9.h:177
uint32_t baud_rate
Definition wifi9.h:182
pin_name_t mcr
Definition wifi9.h:178
pin_name_t adr
Definition wifi9.h:175
pin_name_t cts
Definition wifi9.h:179
bool uart_blocking
Definition wifi9.h:183
uart_data_bits_t data_bit
Definition wifi9.h:184
pin_name_t tx_pin
Definition wifi9.h:172
pin_name_t rx_pin
Definition wifi9.h:171
uart_stop_bits_t stop_bit
Definition wifi9.h:186
uart_parity_t parity_bit
Definition wifi9.h:185
pin_name_t rst
Definition wifi9.h:176
Click ctx object definition.
Definition wifi9.h:147
digital_in_t mcr
Definition wifi9.h:154
digital_out_t rts
Definition wifi9.h:151
digital_out_t adr
Definition wifi9.h:149
uart_t uart
Definition wifi9.h:158
digital_in_t cts
Definition wifi9.h:155
digital_out_t rst
Definition wifi9.h:150