123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- /*
- * THE FOLLOWING FIRMWARE IS PROVIDED: (1) "AS IS" WITH NO WARRANTY; AND
- * (2)TO ENABLE ACCESS TO CODING INFORMATION TO GUIDE AND FACILITATE CUSTOMER.
- * CONSEQUENTLY, CMOSTEK SHALL NOT BE HELD LIABLE FOR ANY DIRECT, INDIRECT OR
- * CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE CONTENT
- * OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING INFORMATION
- * CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
- *
- * Copyright (C) CMOSTEK SZ.
- */
- /*!
- * @file cmt2300.h
- * @brief CMT2300 transceiver RF chip driver
- *
- * @version 1.2
- * @date Feb 08 2017
- * @author CMOSTEK R@D
- */
- #ifndef __CMT2300_H
- #define __CMT2300_H
- #include <stdint.h>
- #include <stdbool.h>
- #include "cmt2300_defs.h"
- #include "cmt2300_hal.h"
- #ifdef __cplusplus
- extern "C" {
- #endif
- #define ENABLE_WAIT_CHIP_STATUS /* Enable the wait when switch chip status */
- /* ************************************************************************
- The following are for chip status controls.
- * ************************************************************************ */
- void Cmt2300_SoftReset(void);
- uint8_t Cmt2300_GetChipStatus(void);
- bool Cmt2300_WaitChipStatus(uint8_t nStatus);
- bool Cmt2300_GoSleep(void);
- bool Cmt2300_GoStby(void);
- bool Cmt2300_GoTFS(void);
- bool Cmt2300_GoRFS(void);
- bool Cmt2300_GoTx(void);
- bool Cmt2300_GoRx(void);
- /* ************************************************************************
- * The following are for chip interrupts, GPIO, FIFO operations.
- * ************************************************************************ */
- void Cmt2300_ConfigGpio(uint8_t nGpioSel);
- void Cmt2300_ConfigInterrupt(uint8_t nInt1Sel, uint8_t nInt2Sel);
- void Cmt2300_SetInterruptPolar(bool bActiveHigh);
- void Cmt2300_SetFifoThreshold(uint8_t nFifoThreshold);
- void Cmt2300_EnableAntennaSwitch(uint8_t nMode);
- void Cmt2300_EnableInterrupt(uint8_t nEnable);
- void Cmt2300_EnableRxFifoAutoClear(bool bEnable);
- void Cmt2300_EnableFifoMerge(bool bEnable);
- void Cmt2300_EnableReadFifo(void);
- void Cmt2300_EnableWriteFifo(void);
- void Cmt2300_RestoreFifo(void);
- uint8_t Cmt2300_ClearFifo(void);
- uint8_t Cmt2300_ClearInterruptFlags(void);
- /* ************************************************************************
- * The following are for Tx DIN operations in direct mode.
- * ************************************************************************ */
- void Cmt2300_ConfigTxDin(uint8_t nDinSel);
- void Cmt2300_EnableTxDin(bool bEnable);
- void Cmt2300_EnableTxDinInvert(bool bEnable);
- /* ************************************************************************
- * The following are general operations.
- * ************************************************************************ */
- bool Cmt2300_IsExist(void);
- uint8_t Cmt2300_GetRssiCode(void);
- int Cmt2300_GetRssiDBm(void);
- void Cmt2300_SetFrequencyChannel(uint8_t nChann);
- void Cmt2300_SetFrequencyStep(uint8_t nOffset);
- void Cmt2300_SetPayloadLength(uint16_t nLength);
- void Cmt2300_EnableLfosc(bool bEnable);
- void Cmt2300_EnableLfoscOutput(bool bEnable);
- /* ************************************************************************
- * The following are for chip initializes.
- * ************************************************************************ */
- void Cmt2300_Init(void);
- bool Cmt2300_ConfigRegBank(uint8_t base_addr, const uint8_t bank[], uint8_t len);
- void Cmt2300_SetCrcSeed(uint16_t seed);
- void Cmt2300_SetCrc(void);
- void Cmt2300_SetPacketType(bool type);
- uint16_t Cmt2300_GetPacketLen(void);
- void Cmt2300_SetRssiDetMode(uint8_t mode);
- void Cmt2300_SetGfskGsnBt(uint8_t bt);
- void Cmt2300_SetRfBandWidth(uint8_t bw);
- void Cmt2300_SetRxPreamLengSize(uint8_t unit, uint8_t size);
- void Cmt2300_SetSyncWord(uint8_t *value, uint8_t len);
- #ifdef __cplusplus
- }
- #endif
- #endif
|