spirit 2.0.0.0
spirit.h File Reference

This file contains API for SPIRIT Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  spirit_t
 SPIRIT Click context object. More...
 
struct  spirit_cfg_t
 SPIRIT Click configuration object. More...
 

Macros

#define SPIRIT_MAP_MIKROBUS(cfg, mikrobus)
 
#define SPIRIT_MODULE_POWER_ON   1
 
#define SPIRIT_MODULE_POWER_OFF   0
 
#define DRV_RX_BUFFER_SIZE   500
 
#define DRV_TX_BUFFER_SIZE   200
 
#define SPIRIT_OPERATING_MODE   0x01
 
#define SPIRIT_COMMAND_MODE   0x00
 
#define SPIRIT_MODULE_WAKE_UP   0x01
 
#define SPIRIT_MODULE_SHUTDOWN   0x00
 
#define SPIRIT_CMD_ENTER_COMMAND_MODE   "+++"
 
#define SPIRIT_CMD_ENTER_OPERATING_MODE   "ATO"
 
#define SPIRIT_CMD_READ_MODULE_VERSION   "AT/V"
 
#define SPIRIT_CMD_READ_ALL_CONFIG_REG   "AT/S"
 
#define SPIRIT_CMD_STORE_CURRENT_CONFIG   "AT/C"
 
#define SPIRIT_CMD_RESET_CONFIG   "ATR"
 
#define SPIRIT_CMD_RESET_MODULE   "ATZ"
 
#define SPIRIT_CMD_READ_INFO_PER   "ATI0"
 
#define SPIRIT_CMD_READ_INFO_PSSI   "ATI1"
 
#define SPIRIT_CMD_READ_INFO_LQI   "ATI2"
 
#define SPIRIT_CMD_READ_INFO_PQI   "ATI3"
 
#define SPIRIT_CMD_READ_INFO_SQI   "ATI4"
 
#define SPIRIT_CMD_READ_INFO_PACKET_COUNT   "ATI5"
 
#define SPIRIT_CMD_READ_INFO_PACKETS_LOST   "ATI6"
 
#define SPIRIT_CMD_CFG_BAUD_RATE   "ATS00"
 
#define SPIRIT_CMD_CFG_FREQUENCY   "ATS01"
 
#define SPIRIT_CMD_CFG_DATA_RATE   "ATS02"
 
#define SPIRIT_CMD_CFG_MODULATION   "ATS03"
 
#define SPIRIT_CMD_CFG_OUTPUT_POWER   "ATS04"
 
#define SPIRIT_CMD_CFG_FREQ_DEVIATION   "ATS05"
 
#define SPIRIT_CMD_CFG_RX_FILTER   "ATS06"
 
#define SPIRIT_CMD_CFG_CS_MODE   "ATS07"
 
#define SPIRIT_CMD_CFG_RSSI_THRESHOLD   "ATS08"
 
#define SPIRIT_CMD_CFG_PREAMBLE_LEN   "ATS09"
 
#define SPIRIT_CMD_CFG_SYNC_LENGTH   "ATS10"
 
#define SPIRIT_CMD_CFG_SYNC_VALUE   "ATS11"
 
#define SPIRIT_CMD_CFG_CRC_MODE   "ATS12"
 
#define SPIRIT_CMD_CFG_WHITENING   "ATS13"
 
#define SPIRIT_CMD_CFG_FEC   "ATS14"
 
#define SPIRIT_CMD_CFG_SOURCE_ADDR   "ATS15"
 
#define SPIRIT_CMD_CFG_DESTINATION_ADDR   "ATS16"
 
#define SPIRIT_CMD_CFG_MULTICAST_ADDR   "ATS17"
 
#define SPIRIT_CMD_CFG_BROADCAST_ADDR   "ATS18"
 
#define SPIRIT_CMD_CFG_FILTER_CRC   "ATS19"
 
#define SPIRIT_CMD_CFG_FILTER_SOURCE   "ATS20"
 
#define SPIRIT_CMD_CFG_FILTER_DESTINATION   "ATS21"
 
#define SPIRIT_CMD_CFG_FILTER_MULTICAST   "ATS22"
 
#define SPIRIT_CMD_CFG_FILTER_BROADCAST   "ATS23"
 
#define SPIRIT_CMD_CFG_TXRX_LED   "ATS24"
 
#define SPIRIT_CMD_CFG_ESCAPE_SEQ   "ATS26"
 
#define SPIRIT_CMD_CFG_SOURCE_FILT_MASK   "ATS27"
 
#define SPIRIT_CMD_CFG_PAYLOAD_SIZE   "ATS28"
 
#define SPIRIT_PCFG_ENABLE   "1"
 
#define SPIRIT_PCFG_DISABLE   "0"
 
#define SPIRIT_PCFG_BAUD_RATE_9600   "9600"
 
#define SPIRIT_PCFG_BAUD_RATE_19200   "19200"
 
#define SPIRIT_PCFG_BAUD_RATE_38400   "38400"
 
#define SPIRIT_PCFG_BAUD_RATE_56000   "56000"
 
#define SPIRIT_PCFG_BAUD_RATE_57600   "57600"
 
#define SPIRIT_PCFG_BAUD_RATE_115200   "115200"
 
#define SPIRIT_PCFG_BAUD_RATE_128000   "128000"
 
#define SPIRIT_PCFG_BAUD_RATE_256000   "256000"
 
#define SPIRIT_PCFG_CSMODE_STATIC_SENSING   "0"
 
#define SPIRIT_PCFG_CSMODE_DYNAMIC_SENSING_6dB   "1"
 
#define SPIRIT_PCFG_CSMODE_DYNAMIC_SENSING_12dB   "2"
 
#define SPIRIT_PCFG_CSMODE_DYNAMIC_SENSING_18dB   "3"
 
#define SPIRIT_PCFG_CRCMODE_POLY_0x07   "1"
 
#define SPIRIT_PCFG_CRCMODE_POLY_0x8005   "2"
 
#define SPIRIT_PCFG_CRCMODE_POLY_0x1021   "3"
 
#define SPIRIT_PCFG_CRCMODE_POLY_0x864CFB   "4"
 
#define SPIRIT_PCFG_TXRXLED_DISABLED   "0"
 
#define SPIRIT_PCFG_TXRXLED_OPEN_DRAIN   "1"
 
#define SPIRIT_PCFG_TXRXLED_PUSH_PULL   "2"
 
#define SPIRIT_PCFG_MODULATION_2_FSK   "0"
 
#define SPIRIT_PCFG_MODULATION_GFSK05   "1"
 
#define SPIRIT_PCFG_MODULATION_GFSK1   "2"
 
#define SPIRIT_PCFG_MODULATION_GMSK   "3"
 
#define SPIRIT_PCFG_MODULATION_OOK   "4"
 
#define SPIRIT_PCFG_MODULATION_ASK   "5"
 
#define SPIRIT_CMD_SET_RF_TEST_MODE_DISABLE   "AT/T0"
 
#define SPIRIT_CMD_SET_RF_TEST_MODE_PN9   "AT/T1"
 
#define SPIRIT_CMD_SET_RF_TEST_MODE_CW   "AT/T2"
 

Enumerations

enum  spirit_return_value_t { SPIRIT_OK = 0 , SPIRIT_ERROR = -1 }
 SPIRIT Click return value data. More...
 

Functions

void spirit_cfg_setup (spirit_cfg_t *cfg)
 SPIRIT configuration object setup function.
 
err_t spirit_init (spirit_t *ctx, spirit_cfg_t *cfg)
 SPIRIT initialization function.
 
void spirit_power_module (spirit_t *ctx, uint8_t power_state)
 Power module function.
 
void spirit_reset (spirit_t *ctx)
 Software reset function.
 
void spirit_set_mode (spirit_t *ctx, uint8_t mode)
 Set mode function.
 
void spirit_generic_write (spirit_t *ctx, char *data_buf, uint16_t len)
 SPIRIT data writing function.
 
int32_t spirit_generic_read (spirit_t *ctx, char *data_buf, uint16_t max_len)
 SPIRIT data reading function.
 
void spirit_send_cmd (spirit_t *ctx, char *cmd)
 Send command function.
 
void spirit_send_cmd_with_parameter (spirit_t *ctx, char *at_cmd_buf, char *param_buf)
 Send command function with parameter.
 
void spirit_send_cmd_check (spirit_t *ctx, char *at_cmd_buf)
 Check the sent command.
 
void spirit_send_cmd_parameter_check (spirit_t *ctx, char *at_cmd_buf)
 Check the command parameters.
 

Detailed Description

This file contains API for SPIRIT Click Driver.