g2c
2.1.0.0
|
API for configuring and manipulating G2C Click driver. More...
Modules | |
G2C Device Settings | |
Settings for registers of G2C Click driver. | |
G2C MikroBUS Map | |
MikroBUS pin mapping of G2C Click driver. | |
Functions | |
void | g2c_cfg_setup (g2c_cfg_t *cfg) |
G2C configuration object setup function. More... | |
err_t | g2c_init (g2c_t *ctx, g2c_cfg_t *cfg) |
G2C initialization function. More... | |
err_t | g2c_generic_write (g2c_t *ctx, uint8_t *data_in, uint16_t len) |
G2C data writing function. More... | |
err_t | g2c_generic_read (g2c_t *ctx, uint8_t *data_out, uint16_t len) |
G2C data reading function. More... | |
void | g2c_set_cts_pin (g2c_t *ctx, uint8_t state) |
G2C set cts pin function. More... | |
void | g2c_set_rst_pin (g2c_t *ctx, uint8_t state) |
G2C set rst pin function. More... | |
uint8_t | g2c_get_gp0_pin (g2c_t *ctx) |
G2C get gp0 pin function. More... | |
uint8_t | g2c_get_gp1_pin (g2c_t *ctx) |
G2C get gp1 pin function. More... | |
uint8_t | g2c_get_rts_pin (g2c_t *ctx) |
G2C get rts pin function. More... | |
void | g2c_reset_device (g2c_t *ctx) |
G2C reset device function. More... | |
void | g2c_send_cmd (g2c_t *ctx, uint8_t *cmd) |
G2C send command function. More... | |
void | g2c_send_cmd_with_par (g2c_t *ctx, uint8_t *at_cmd_buf, uint8_t *param_buf) |
G2C send command function with parameter. More... | |
void | g2c_send_cmd_check (g2c_t *ctx, uint8_t *at_cmd_buf) |
G2C check the sent command. More... | |
void | g2c_send_cmd_par_check (g2c_t *ctx, uint8_t *at_cmd_buf) |
G2C check the command parameters. More... | |
void | g2c_set_net_creds (g2c_t *ctx, uint8_t *wifi_ssid, uint8_t *wifi_pass) |
G2C set network credentials. More... | |
void | g2c_set_broker_creds (g2c_t *ctx, uint8_t *dev_key, uint8_t *password) |
G2C set broker credentials. More... | |
API for configuring and manipulating G2C Click driver.
void g2c_cfg_setup | ( | g2c_cfg_t * | cfg | ) |
G2C configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See g2c_cfg_t object definition for detailed explanation. |
err_t g2c_generic_read | ( | g2c_t * | ctx, |
uint8_t * | data_out, | ||
uint16_t | len | ||
) |
G2C data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. err_t g2c_generic_write | ( | g2c_t * | ctx, |
uint8_t * | data_in, | ||
uint16_t | len | ||
) |
G2C data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | data_in | : Data buffer for sending. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation. uint8_t g2c_get_gp0_pin | ( | g2c_t * | ctx | ) |
G2C get gp0 pin function.
This function returns the GPIO 0 pin logic state.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
uint8_t g2c_get_gp1_pin | ( | g2c_t * | ctx | ) |
G2C get gp1 pin function.
This function returns the GPIO 1 pin logic state.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
uint8_t g2c_get_rts_pin | ( | g2c_t * | ctx | ) |
G2C get rts pin function.
This function returns the Request to Send (RTS) pin logic state.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
G2C initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See g2c_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void g2c_reset_device | ( | g2c_t * | ctx | ) |
G2C reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
void g2c_send_cmd | ( | g2c_t * | ctx, |
uint8_t * | cmd | ||
) |
G2C send command function.
This function sends a specified command to the click module.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | cmd | : Command variable. |
void g2c_send_cmd_check | ( | g2c_t * | ctx, |
uint8_t * | at_cmd_buf | ||
) |
G2C check the sent command.
This function checks the command that is sent.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | at_cmd_buf | : Command buffer. |
void g2c_send_cmd_par_check | ( | g2c_t * | ctx, |
uint8_t * | at_cmd_buf | ||
) |
G2C check the command parameters.
This function checks the command that is sent.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | at_cmd_buf | : Command buffer. |
void g2c_send_cmd_with_par | ( | g2c_t * | ctx, |
uint8_t * | at_cmd_buf, | ||
uint8_t * | param_buf | ||
) |
G2C send command function with parameter.
This function sends a command with specified parameter to the click module.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | at_cmd_buf | : Command buffer. |
[in] | param_buf | : Parameter buffer. |
void g2c_set_broker_creds | ( | g2c_t * | ctx, |
uint8_t * | dev_key, | ||
uint8_t * | password | ||
) |
G2C set broker credentials.
This function sets the broker credentials (device key and password).
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | dev_key | : Device key. |
[in] | password | : Device password. |
void g2c_set_cts_pin | ( | g2c_t * | ctx, |
uint8_t | state | ||
) |
G2C set cts pin function.
This function sets the Clear to Send (CTS) pin logic state.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void g2c_set_net_creds | ( | g2c_t * | ctx, |
uint8_t * | wifi_ssid, | ||
uint8_t * | wifi_pass | ||
) |
G2C set network credentials.
This function sets the WiFi network credentials.
[in] | ctx | : Click context object. See g2c_t object definition for detailed explanation. |
[in] | wifi_ssid | : WiFi SSID. |
[in] | wifi_pass | : WiFi Password. |