39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
51#include "drv_spi_master.h"
74#define WIFI8_MAP_MIKROBUS(cfg, mikrobus) \
75 cfg.miso = MIKROBUS(mikrobus, MIKROBUS_MISO); \
76 cfg.mosi = MIKROBUS(mikrobus, MIKROBUS_MOSI); \
77 cfg.sck = MIKROBUS(mikrobus, MIKROBUS_SCK); \
78 cfg.cs = MIKROBUS(mikrobus, MIKROBUS_CS); \
79 cfg.en = MIKROBUS(mikrobus, MIKROBUS_AN); \
80 cfg.rst = MIKROBUS(mikrobus, MIKROBUS_RST); \
81 cfg.wkp = MIKROBUS(mikrobus, MIKROBUS_PWM); \
82 cfg.int_pin = MIKROBUS(mikrobus, MIKROBUS_INT)
111 uint8_t root_sha1[20];
err_t wifi8_socket_receive(wifi8_t *ctx, int8_t sock, void *pv_recv_buf, uint16_t u16_buf_len, uint32_t u32_timeoutmsec)
Asynchronous receive function.
err_t wifi8_get_ota_firmware_version(wifi8_t *ctx, wifi8_m2m_rev_t *fw_version)
Synchronous API to obtain the firmware version of the device.
err_t wifi8_request_scan(wifi8_t *ctx, uint8_t channel)
Asynchronous API to request the WINC to scan for networks.
int8_t wifi8_socket_listen(wifi8_t *ctx, int8_t sock, uint8_t backlog)
Asynchronous listen function.
err_t wifi8_start_ap(wifi8_t *ctx, wifi8_m2m_ap_config_t *pstr_m2m_ap_config)
Asynchronous API to enable access point (AKA "hot-spot") mode on the device.
err_t wifi8_socket_connect(wifi8_t *ctx, int8_t sock, wifi8_sockaddr_t *pstr_addr, uint8_t u8_addr_len)
Asynchronous connect function.
uint32_t wifi8_chip_id(wifi8_t *ctx)
Get device ID.
err_t wifi8_socket_receive_from(wifi8_t *ctx, int8_t sock, void *pv_recv_buf, uint16_t u16_buf_len, uint32_t u32_timeoutmsec)
Asynchronous receive function.
err_t wifi8_block_read(wifi8_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_len)
Read blocks of data from register address.
err_t wifi8_get_connection_info(wifi8_t *ctx)
err_t wifi8_connect(wifi8_t *ctx, char *pc_ssid, uint8_t u8_ssid_len, wifi8_m2m_sec_type_t u8_sec_type, void *pv_auth_info, uint16_t u16_ch)
err_t wifi8_init(wifi8_t *ctx, wifi8_cfg_t *cfg)
WiFi 8 initialization function.
err_t wifi8_req_scan_result(wifi8_t *ctx, uint8_t scan_request_index)
Asynchronous API to request the information of an access point discovered via scanning.
err_t wifi8_default_cfg(wifi8_t *ctx)
WiFi 8 default configuration function.
err_t wifi8_handle_events(wifi8_t *ctx)
Synchronous event handler function.
err_t wifi8_socket_send_to(wifi8_t *ctx, int8_t sock, void *pv_send_buffer, uint16_t u16_send_length, wifi8_sockaddr_t *pstr_dest_addr, uint8_t u8_addr_len)
Asynchronous sending function.
err_t wifi8_socket_close(wifi8_t *ctx, int8_t sock)
Synchronous close function.
err_t wifi8_reg_read(wifi8_t *ctx, uint32_t addr, uint32_t *data_out)
Read data from register address.
err_t wifi8_socket_create(wifi8_t *ctx, uint16_t u16_domain, uint8_t u8_type, uint8_t u8_flags)
Synchronous socket allocation function based on the specified socket type.
err_t wifi8_socket_send(wifi8_t *ctx, int8_t sock, void *pv_send_buffer, uint16_t u16_send_length)
Asynchronous sending function.
err_t wifi8_get_full_firmware_version(wifi8_t *ctx, wifi8_m2m_rev_t *fw_version)
Synchronous API to obtain the firmware version currently running on the device.
err_t wifi8_generic_write(wifi8_t *ctx, uint8_t *data_in, uint8_t len)
Generic writing function.
err_t wifi8_reg_write(wifi8_t *ctx, uint32_t addr, uint32_t data_in)
Write data to register address.
void wifi8_cfg_setup(wifi8_cfg_t *cfg)
WiFi 8 configuration object setup function.
err_t wifi8_init_drv(wifi8_t *ctx)
Synchronous API to initialize the device driver.
err_t wifi8_socket_bind(wifi8_t *ctx, int8_t sock, wifi8_sockaddr_t *pstr_addr, uint8_t u8_addr_len)
Asynchronous bind function associates the provided address and local port to the socket.
err_t wifi8_block_write(wifi8_t *ctx, uint32_t addr, uint8_t *data_buf, uint16_t buf_len)
Write blocks of data to register address.
void wifi8_socket_init(wifi8_t *ctx)
The function performs the necessary initializations for the socket library.
err_t wifi8_ble_api_send(wifi8_t *ctx, uint8_t *msg, uint32_t len)
Asynchronous API to send an encapsulated BLE message.
err_t wifi8_generic_read(wifi8_t *ctx, uint8_t *data_out, uint8_t len)
Generic reading function.
wifi8_sockaddr_in_t addr
Definition main.c:62
WiFi 8 Click configuration object.
Definition wifi8.h:127
pin_name_t wkp
Definition wifi8.h:137
spi_master_chip_select_polarity_t cs_polarity
Definition wifi8.h:143
pin_name_t sck
Definition wifi8.h:131
spi_master_mode_t spi_mode
Definition wifi8.h:142
pin_name_t mosi
Definition wifi8.h:130
uint32_t spi_speed
Definition wifi8.h:141
pin_name_t en
Definition wifi8.h:135
pin_name_t int_pin
Definition wifi8.h:138
pin_name_t miso
Definition wifi8.h:129
pin_name_t rst
Definition wifi8.h:136
pin_name_t cs
Definition wifi8.h:132
uint32_t u32_rx_size
Definition wifi8.h:158
uint8_t u8_hif_rx_done
Definition wifi8.h:154
uint8_t u8_chip_mode
Definition wifi8.h:152
wifi8_hif_call_back_t pf_ota_cb
Definition wifi8.h:161
uint8_t u8_yield
Definition wifi8.h:156
wifi8_hif_call_back_t pf_ip_cb
Definition wifi8.h:160
wifi8_hif_call_back_t pf_sigma_cb
Definition wifi8.h:162
uint8_t u8_chip_sleep
Definition wifi8.h:153
wifi8_hif_call_back_t pf_wifi_cb
Definition wifi8.h:159
wifi8_hif_call_back_t pf_ssl_cb
Definition wifi8.h:165
wifi8_hif_call_back_t pf_crypto_cb
Definition wifi8.h:164
uint8_t u8_interrupt
Definition wifi8.h:155
wifi8_hif_call_back_t pf_hif_cb
Definition wifi8.h:163
uint32_t u32_rx_addr
Definition wifi8.h:157
Definition wifi8_types.h:816
Definition wifi8_types.h:837
Definition wifi8_types.h:848
Definition wifi8_types.h:772
Definition wifi8_types.h:975
WiFi 8 Click context object.
Definition wifi8.h:92
uint32_t ping_id
Definition wifi8.h:114
uint8_t socket_init
Definition wifi8.h:113
spi_master_t spi
Definition wifi8.h:102
uint8_t hif_bl_offset
Definition wifi8.h:106
uint32_t hs_flags
Definition wifi8.h:109
wifi8_ping_cb_t ping_cb
Definition wifi8.h:118
wifi8_app_resolve_cb_t app_resolve_cb
Definition wifi8.h:117
uint8_t ch_num
Definition wifi8.h:108
wifi8_app_socket_cb_t app_socket_cb
Definition wifi8.h:116
digital_in_t int_pin
Definition wifi8.h:99
uint16_t session_id
Definition wifi8.h:112
wifi8_nm_state_t device_state
Definition wifi8.h:107
digital_out_t wkp
Definition wifi8.h:96
digital_out_t en
Definition wifi8.h:94
digital_out_t rst
Definition wifi8.h:95
pin_name_t chip_select
Definition wifi8.h:104
wifi8_app_wifi_cb_t app_wifi_cb
Definition wifi8.h:115
void(* wifi8_hif_call_back_t)(wifi8_t *ctx, uint8_t u8_op_code, uint16_t u16_data_size, uint32_t u32_addr)
Definition wifi8.h:147
wifi8_sock_addr_t wifi8_uip_sock_addr_t
Definition wifi8.h:148
void(* wifi8_ping_cb_t)(uint32_t u32ip_addr, uint32_t u32rtt, uint8_t u8_error_code)
Definition wifi8_types.h:1335
void(* wifi8_app_resolve_cb_t)(uint8_t *pu8_domain_name, uint32_t u32_server_ip)
Definition wifi8_types.h:1334
void(* wifi8_app_socket_cb_t)(int8_t sock, uint8_t u8_msg, void *pv_msg)
Definition wifi8_types.h:1333
wifi8_nm_state_t
Definition wifi8_types.h:618
wifi8_m2m_sec_type_t
Definition wifi8_types.h:430
#define MAX_SOCKET
Definition wifi8_types.h:179
void(* wifi8_app_wifi_cb_t)(uint8_t u8_msg_type, void *pv_msg)
Definition wifi8_types.h:1331