Added definitions for the MAIN register.
This commit is contained in:
parent
d6ec25e37c
commit
c0686e80f1
1 changed files with 32 additions and 15 deletions
|
@ -53,6 +53,21 @@
|
||||||
#define CC1020_STATUS6 0x4A
|
#define CC1020_STATUS6 0x4A
|
||||||
#define CC1020_STATUS7 0x4B
|
#define CC1020_STATUS7 0x4B
|
||||||
|
|
||||||
|
/* Flags for the MAIN register. */
|
||||||
|
#define RESET_N 1
|
||||||
|
#define BIAS_PD (1<<1)
|
||||||
|
#define XOSC_PD (1<<2)
|
||||||
|
#define FS_PD (1<<3)
|
||||||
|
#define PD_MODE_1 (1<<4)
|
||||||
|
#define PD_MODE_2 (1<<5)
|
||||||
|
#define F_REG (1<<6)
|
||||||
|
#define RXTX (1<<7)
|
||||||
|
|
||||||
|
/* In power up mode, the MAIN register modifies some flags to the following. */
|
||||||
|
#define SEQ_PD (1<<1)
|
||||||
|
#define SEQ_CAL_1 (1<<2)
|
||||||
|
#define SEQ_CAL_2 (1<<3)
|
||||||
|
|
||||||
// For CC1020_STATUS
|
// For CC1020_STATUS
|
||||||
#define LOCK_CONTINUOUS 0x10
|
#define LOCK_CONTINUOUS 0x10
|
||||||
#define CAL_COMPLETE 0x80
|
#define CAL_COMPLETE 0x80
|
||||||
|
@ -101,7 +116,7 @@
|
||||||
|
|
||||||
#define MHZ_869525 1
|
#define MHZ_869525 1
|
||||||
|
|
||||||
const u8_t cc1020_config_19200[41] = {
|
const uint8_t cc1020_config_19200[41] = {
|
||||||
0x01, // 0x00, MAIN
|
0x01, // 0x00, MAIN
|
||||||
0x0F, // 0x01, INTERFACE
|
0x0F, // 0x01, INTERFACE
|
||||||
0xFF, // 0x02, RESET
|
0xFF, // 0x02, RESET
|
||||||
|
@ -147,7 +162,7 @@ const u8_t cc1020_config_19200[41] = {
|
||||||
ACK_TIMEOUT_19
|
ACK_TIMEOUT_19
|
||||||
};
|
};
|
||||||
|
|
||||||
const u8_t cc1020_config_115200[41] = {
|
const uint8_t cc1020_config_115200[41] = {
|
||||||
0x01, // 0x00, MAIN
|
0x01, // 0x00, MAIN
|
||||||
0x0F, // 0x01, INTERFACE
|
0x0F, // 0x01, INTERFACE
|
||||||
0xFF, // 0x02, RESET
|
0xFF, // 0x02, RESET
|
||||||
|
@ -205,11 +220,13 @@ enum cc1020_state {
|
||||||
* @{
|
* @{
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const u8_t syncword[2] = {0xD3,0x91};
|
const uint8_t syncword[2] = {0xD3,0x91};
|
||||||
__attribute__((packed))
|
|
||||||
|
// header: number of bytes in packet including header
|
||||||
struct cc1020_header {
|
struct cc1020_header {
|
||||||
u8_t length; // header: number of bytes in packet including header
|
uint8_t length;
|
||||||
};
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
|
||||||
#define PREAMBLESIZE 6
|
#define PREAMBLESIZE 6
|
||||||
#define PREAMBLE 0xAA
|
#define PREAMBLE 0xAA
|
||||||
|
|
Loading…
Add table
Reference in a new issue