enocan3  2.0.0.0
Data Structures | Macros | Typedefs | Functions
enocan3.h File Reference

This file contains API for EnOcean 3 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  enocean3_packet_t
 
struct  enocan3_t
 Click ctx object definition. More...
 
struct  enocan3_cfg_t
 Click configuration structure definition. More...
 

Macros

#define ENOCEAN3_MAP_MIKROBUS(cfg, mikrobus)
 
#define ENOCEAN3_RETVAL   uint8_t
 
#define ENOCEAN3_OK   0x00
 
#define ENOCEAN3_INIT_ERROR   0xFF
 
#define ENOCEAN3_NEMA_GPGGA   1
 
#define ENOCEAN3_NEMA_GPGLL   3
 
#define ENOCEAN3_NEMA_GPGGA_NUM_ELEMENT   15
 
#define ENOCEAN3_NEMA_GPGLL_NUM_ELEMENT   5
 
#define ENOCEAN3_GPGGA_TIME   1
 
#define ENOCEAN3_GPGGA_LATITUDE   2
 
#define ENOCEAN3_GPGGA_LATITUDE_SIDE   3
 
#define ENOCEAN3_GPGGA_LONGITUDE   4
 
#define ENOCEAN3_GPGGA_LONGITUDE_SIDE   5
 
#define ENOCEAN3_GPGGA_QUALITY_INDICATOR   6
 
#define ENOCEAN3_GPGGA_NUMBER_OF_SATELLITES   7
 
#define ENOCEAN3_GPGGA_H_DILUTION_OF_POS   8
 
#define ENOCEAN3_GPGGA_ALTITUDE   9
 
#define ENOCEAN3_GPGGA_ALTITUDE_UNIT   10
 
#define ENOCEAN3_GPGGA_GEOIDAL_SEPARATION   11
 
#define ENOCEAN3_GPGGA_GEOIDAL_SEPARATION_UNIT   12
 
#define ENOCEAN3_GPGGA_TIME_SINCE_LAST_DGPS   13
 
#define ENOCEAN3_GPGGA_DGPS_REFERENCE_STATION_ID   14
 
#define ENOCEAN3_GPGLL_LATITUDE   1
 
#define ENOCEAN3_GPGLL_LATITUDE_SIDE   2
 
#define ENOCEAN3_GPGLL_LONGITUDE   3
 
#define ENOCEAN3_GPGLL_LONGITUDE_SIDE   4
 
#define ENOCEAN3_ERROR_COMMAND_OR_ELEMENT   0xFF
 
#define ENOCEAN3_ERROR_START_OR_END_COMMAND   0x8F
 
#define ENOCEAN3_ERROR_NEXT_ELEMENT   0x4F
 
#define ENOCEAN3_ERROR_CURRENT_ELEMENT   0x2F
 
#define ENOCEAN3_NO_ERROR   0x00
 
#define DRV_RX_BUFFER_SIZE   500
 
#define ENOCEAN3_SYNC_BYTE   0x55
 
#define ENOCEAN3_MAX_BUFF_SIZE   256
 
#define ENOCEAN3_HEADER_SIZE   0x04
 
#define ENOCEAN3_BUFF_EMPTY   0x00
 
#define ENOCEAN3_RESPONSE_READY   0x01
 
#define ENOCEAN3_RESPONSE_NOT_READY   0x00
 
#define ENOCEAN3_UART_RX_READY   0x01
 
#define ENOCEAN3_UART_RX_NOT_READY   0x00
 
#define ENOCEAN3_OK   0x00
 
#define ENOCEAN3_INVALID_PACKET_SIZE   0x01
 
#define ENOCEAN3_PACK_TYPE_EVENT   0x04
 
#define ENOCEAN3_PACK_TYPE_COMMON_COMMAND   0x05
 
#define ENOCEAN3_CO_EVENT_SECUREDEVICES   0x05
 
#define ENOCEAN3_CO_WR_FILTER_ADD   0x0B
 
#define ENOCEAN3_CO_WR_FILTER_ENABLE   0x0E
 
#define ENOCEAN3_CO_WR_REPEATER   0x09
 
#define ENOCEAN3_CO_SET_NOISETHRESHOLD   0x32
 
#define ENOCEAN3_FILT_TYPE_SOURCE_ID   0x00
 
#define ENOCEAN3_FILT_TYPE_R_ORG   0x01
 
#define ENOCEAN3_FILT_TYPE_RSSI   0x02
 
#define ENOCEAN3_FILT_TYPE_DEST_ID   0x03
 
#define ENOCEAN3_FILT_KIND_NEG_TEL_FWRD   0x00
 
#define ENOCEAN3_FILT_KIND_POS_TEL_FWRD   0x80
 
#define ENOCEAN3_FILT_KIND_NEG_TEL_RPT   0x40
 
#define ENOCEAN3_FILT_KIND_POS_TEL_RPT   0xC0
 
#define ENOCEAN3_FILT_FWRD_OFF   0x00
 
#define ENOCEAN3_FILT_FWRD_ON   0x01
 
#define ENOCEAN3_FILT_OP_OR_ALL_FILT   0x00
 
#define ENOCEAN3_FILT_OP_AND_ALL_FILT   0x01
 
#define ENOCEAN3_FILT_OP_OR_RADIO_INTER_AND_FILT_RPT   0x08
 
#define ENOCEAN3_FILT_OP_AND_RADIO_INTER_OR_FILT_RPT   0x09
 
#define ENOCEAN3_RPT_OFF   0x00
 
#define ENOCEAN3_RPT_ALL_TELEG   0x01
 
#define ENOCEAN3_RPT_SELECTIVE   0x02
 
#define ENOCEAN3_RPT_LEVEL_OFF   0x00
 
#define ENOCEAN3_RPT_LEVEL_ONE   0x01
 
#define ENOCEAN3_RPT_LEVEL_TWO   0x02
 
#define ENOCEAN3_RSSI_LEVEL_100_DBM_NEG   0x2E
 
#define ENOCEAN3_RSSI_LEVEL_99_DBM_NEG   0x2F
 
#define ENOCEAN3_RSSI_LEVEL_98_DBM_NEG   0x30
 
#define ENOCEAN3_RSSI_LEVEL_97_DBM_NEG   0x31
 
#define ENOCEAN3_RSSI_LEVEL_96_DBM_NEG   0x32
 
#define ENOCEAN3_RSSI_LEVEL_95_DBM_NEG   0x33
 
#define ENOCEAN3_RSSI_LEVEL_94_DBM_NEG   0x34
 
#define ENOCEAN3_RSSI_LEVEL_93_DBM_NEG   0x35
 
#define ENOCEAN3_RSSI_LEVEL_92_DBM_NEG   0x36
 
#define ENOCEAN3_RSSI_LEVEL_91_DBM_NEG   0x37
 
#define ENOCEAN3_RSSI_LEVEL_90_DBM_NEG   0x38
 

Typedefs

typedef void(* enocean3_hdl_t) (enocean3_packet_t *, uint16_t *)
 
typedef uint8_t enocan3_error_t
 Error type. More...
 

Functions

void enocan3_cfg_setup (enocan3_cfg_t *cfg)
 Config Object Initialization function. More...
 
ENOCEAN3_RETVAL enocan3_init (enocan3_t *ctx, enocan3_cfg_t *cfg)
 Initialization function. More...
 
void enocan3_set_rst_pin (enocan3_t *ctx, uint8_t state)
 Set RST ( reset ) pin state. More...
 
void enocan3_generic_write (enocan3_t *ctx, char *data_buf, uint16_t len)
 Generic write function. More...
 
uint16_t enocan3_generic_read (enocan3_t *ctx, char *data_buf, uint16_t max_len)
 Generic read function. More...
 
enocan3_error_t enocan3_generic_parser (char *rsp, uint8_t command, uint8_t element, char *parser_buf)
 Generic parser function. More...
 
void enocean3_response_handler_set (enocan3_t *ctx, enocean3_hdl_t handler)
 Handler Set function. More...
 
uint8_t enocean3_send_packet (enocan3_t *ctx, enocean3_packet_t *packet)
 Packet Send function. More...
 
uint8_t enocean3_response_ready (enocan3_t *ctx)
 Response Ready function. More...
 
void enocean3_uart_isr (enocan3_t *ctx)
 UART Interrupt Routine function. More...
 

Detailed Description

This file contains API for EnOcean 3 Click driver.