Herzog Library 00.00.01  rel_libdev.herzog.00.00.01.10606
Macros | Functions | Variables
rf_codec.c File Reference
#include <string.h>
#include "rf_codec.h"
#include "errno.h"

Macros

#define DCM_3BIT_MASK   0x07
 
#define DCM_3BIT_LENGTH   0x03
 
#define DCM_3BIT_ONE   0x04
 
#define DCM_3BIT_ZERO   0x06
 
#define DCM_4BIT_MASK   0x0F
 
#define DCM_4BIT_LENGTH   0x04
 
#define DCM_4BIT_ONE   0x08
 
#define DCM_4BIT_ZERO   0x0E
 
#define DCM_5BIT_MASK   0x1F
 
#define DCM_5BIT_LENGTH   0x05
 
#define DCM_5BIT_ONE   0x10
 
#define DCM_5BIT_ZERO   0x3E
 
#define MAX_TX_BURST_BIT_SIZE   1024
 
#define MAX_TX_PREAMBLE_BIT_SIZE   16
 
#define MAX_TX_SYNC_BIT_SIZE   16
 
#define MAX_TX_CRC_BIT_SIZE   8
 
#define MAX_TX_MAX_DATA_BIT_SIZE
 
#define MAX_TX_BYTE_SIZE   (MAX_TX_MAX_DATA_BIT_SIZE / 8);
 
#define ASK3DCM_PAYLOAD_BYTE_TEMPLATE   0x00924924UL
 

Functions

static uint32_t EncodeASK3DCMByte (const uint8_t pay)
 
int32_t DCM_Encoder (DCM_FMT_t mode, uint8_t *src, uint8_t *des, uint8_t len)
 Encode data. More...
 

Variables

static const uint16_t dcm_4bit_lut [16]
 
static const uint16_t ASK3DCM_PAYLOAD_NIBBLE_LUT [16]
 

Detailed Description

This file is proprietary to Indie Semiconductor. All rights reserved. Reproduction or distribution, in whole or in part, is forbidden except by express written permission of Indie Semiconductor.

Macro Definition Documentation

#define ASK3DCM_PAYLOAD_BYTE_TEMPLATE   0x00924924UL
#define DCM_3BIT_LENGTH   0x03
#define DCM_3BIT_MASK   0x07
#define DCM_3BIT_ONE   0x04
#define DCM_3BIT_ZERO   0x06
#define DCM_4BIT_LENGTH   0x04
#define DCM_4BIT_MASK   0x0F
#define DCM_4BIT_ONE   0x08
#define DCM_4BIT_ZERO   0x0E
#define DCM_5BIT_LENGTH   0x05
#define DCM_5BIT_MASK   0x1F
#define DCM_5BIT_ONE   0x10
#define DCM_5BIT_ZERO   0x3E
#define MAX_TX_BURST_BIT_SIZE   1024
#define MAX_TX_BYTE_SIZE   (MAX_TX_MAX_DATA_BIT_SIZE / 8);
#define MAX_TX_CRC_BIT_SIZE   8
#define MAX_TX_MAX_DATA_BIT_SIZE
Value:
#define MAX_TX_SYNC_BIT_SIZE
Definition: rf_codec.c:53
#define MAX_TX_CRC_BIT_SIZE
Definition: rf_codec.c:54
#define MAX_TX_PREAMBLE_BIT_SIZE
Definition: rf_codec.c:52
#define MAX_TX_BURST_BIT_SIZE
Definition: rf_codec.c:51
#define MAX_TX_PREAMBLE_BIT_SIZE   16
#define MAX_TX_SYNC_BIT_SIZE   16

Function Documentation

int32_t DCM_Encoder ( DCM_FMT_t  mode,
uint8_t *  src,
uint8_t *  des,
uint8_t  len 
)

Encode data.

Parameters
modeThe format for the data to be encoded.
srcThe pointer to the data to be encoded.
desThe pointer to the decoded data to be saved.
lenThe length bytes of the source data in number of bytes.
Returns
0 for success or error code upon a failure. The function doesn't do memory boundary check, the caller needs to ensure the both src and des pointing to sufficient memory space.
static uint32_t EncodeASK3DCMByte ( const uint8_t  pay)
static

Variable Documentation

const uint16_t ASK3DCM_PAYLOAD_NIBBLE_LUT[16]
static
Initial value:
= {
0x0492,
0x0490,
0x0482,
0x0480,
0x0412,
0x0410,
0x0402,
0x0400,
0x0092,
0x0090,
0x0082,
0x0080,
0x0012,
0x0010,
0x0002,
0x0000
}
const uint16_t dcm_4bit_lut[16]
static
Initial value:
= {
[0] = 0xEEEE,
[1] = 0xEEE8,
[2] = 0xEE8E,
[3] = 0xEE88,
[4] = 0xE8EE,
[5] = 0xE8E8,
[6] = 0xE88E,
[7] = 0xE888,
[8] = 0x8EEE,
[9] = 0x8EE8,
[10] = 0x8E8E,
[11] = 0x8E88,
[12] = 0x88EE,
[13] = 0x88E8,
[14] = 0x888E,
[15] = 0x8888,
}