nbiot5  2.0.0.0
Modules | Functions
NB IoT 5 Click Driver

API for configuring and manipulating NB IoT 5 Click driver. More...

Modules

 NB IoT 5 Commands List
 List of commands of NB IoT 5 Click driver.
 
 NB IoT 5 Device Settings
 Settings for registers of NB IoT 5 Click driver.
 
 NB IoT 5 MikroBUS Map
 MikroBUS pin mapping of NB IoT 5 Click driver.
 

Functions

void nbiot5_cfg_setup (nbiot5_cfg_t *cfg)
 NB IoT 5 configuration object setup function. More...
 
err_t nbiot5_init (nbiot5_t *ctx, nbiot5_cfg_t *cfg)
 NB IoT 5 initialization function. More...
 
err_t nbiot5_default_cfg (nbiot5_t *ctx)
 NB IoT 5 default configuration function. More...
 
err_t nbiot5_generic_write (nbiot5_t *ctx, char *data_buf, uint16_t len)
 NB IoT 5 data writing function. More...
 
err_t nbiot5_generic_read (nbiot5_t *ctx, char *data_buf, uint16_t max_len)
 NB IoT 5 data reading function. More...
 
void nbiot5_set_wkp (nbiot5_t *ctx, uint8_t state)
 Sets state of the wkp pin setting. More...
 
void nbiot5_set_en (nbiot5_t *ctx, uint8_t state)
 Sets state of the en pin setting. More...
 
void nbiot5_set_rst (nbiot5_t *ctx, uint8_t state)
 Sets state of the rst pin setting. More...
 
void nbiot5_set_cs (nbiot5_t *ctx, uint8_t state)
 Sets state of the cs pin setting. More...
 
void nbiot5_send_cmd (nbiot5_t *ctx, char *cmd)
 Send command function. More...
 
void nbiot5_set_sim_apn (nbiot5_t *ctx, char *sim_apn)
 Set sim card APN. More...
 
void nbiot5_send_text_message (nbiot5_t *ctx, char *phone_number, char *message_context)
 NB IoT 5 send text message. More...
 

Detailed Description

API for configuring and manipulating NB IoT 5 Click driver.

Function Documentation

◆ nbiot5_cfg_setup()

void nbiot5_cfg_setup ( nbiot5_cfg_t cfg)

NB IoT 5 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See nbiot5_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ nbiot5_default_cfg()

err_t nbiot5_default_cfg ( nbiot5_t ctx)

NB IoT 5 default configuration function.

This function executes a default configuration of NB IoT 5 click board.

Parameters
[in]ctx: Click context object. See nbiot5_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
This function can consist any necessary configuration or setting to put device into operating mode.

◆ nbiot5_generic_read()

err_t nbiot5_generic_read ( nbiot5_t ctx,
char *  data_buf,
uint16_t  max_len 
)

NB IoT 5 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See nbiot5_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.

◆ nbiot5_generic_write()

err_t nbiot5_generic_write ( nbiot5_t ctx,
char *  data_buf,
uint16_t  len 
)

NB IoT 5 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See nbiot5_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.

◆ nbiot5_init()

err_t nbiot5_init ( nbiot5_t ctx,
nbiot5_cfg_t cfg 
)

NB IoT 5 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See nbiot5_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See nbiot5_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.

◆ nbiot5_send_cmd()

void nbiot5_send_cmd ( nbiot5_t ctx,
char *  cmd 
)

Send command function.

This function sends the specified command to the click module.

Parameters
[in]ctx: Click context object. See nbiot5_t object definition for detailed explanation.
[in]cmdCommand variable.
Returns
Nothing.
Note
Example of cmd -> "AT+CFUN=1".

◆ nbiot5_send_text_message()

void nbiot5_send_text_message ( nbiot5_t ctx,
char *  phone_number,
char *  message_context 
)

NB IoT 5 send text message.

This function sends text message to a phone number.

Parameters
[in]ctx: Click context object. See nbiot5_t object definition for detailed explanation.
[in]phone_numberPhone number to message.
[in]message_contextMessage to be sent.
Returns
Nothing.

◆ nbiot5_set_cs()

void nbiot5_set_cs ( nbiot5_t ctx,
uint8_t  state 
)

Sets state of the cs pin setting.

This function sets cs pin output to state setting.

Parameters
[in]ctxClick context object. See nbiot5_t object definition for detailed explanation.
[in]stateOutput value setting.
  • 0 - digital out high,
  • 1 - digital out low.

◆ nbiot5_set_en()

void nbiot5_set_en ( nbiot5_t ctx,
uint8_t  state 
)

Sets state of the en pin setting.

This function sets en pin output to state setting.

Parameters
[in]ctxClick context object. See nbiot5_t object definition for detailed explanation.
[in]stateOutput value setting.
  • 0 - digital out high,
  • 1 - digital out low.

◆ nbiot5_set_rst()

void nbiot5_set_rst ( nbiot5_t ctx,
uint8_t  state 
)

Sets state of the rst pin setting.

This function sets rst pin output to state setting.

Parameters
[in]ctxClick context object. See nbiot5_t object definition for detailed explanation.
[in]stateOutput value setting.
  • 0 - digital out high,
  • 1 - digital out low.

◆ nbiot5_set_sim_apn()

void nbiot5_set_sim_apn ( nbiot5_t ctx,
char *  sim_apn 
)

Set sim card APN.

This function sets APN for sim card.

Parameters
[in]ctx: Click context object. See nbiot5_t object definition for detailed explanation.
[in]sim_apnSIM card APN.
Returns
Nothing.
Note
Example of sim_apn -> "vip.mobile".

◆ nbiot5_set_wkp()

void nbiot5_set_wkp ( nbiot5_t ctx,
uint8_t  state 
)

Sets state of the wkp pin setting.

This function sets wkp pin output to state setting.

Parameters
[in]ctxClick context object. See nbiot5_t object definition for detailed explanation.
[in]stateOutput value setting.
  • 0 - digital out high,
  • 1 - digital out low.