-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFMTX.h
84 lines (68 loc) · 1.73 KB
/
FMTX.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*****************************************************************************/
/*!
@file FMTX.h
@author www.elechouse.com
@version V1.0
@date 2012-11-1
@brief FMTX demo header file
@section HISTORY
V1.0 Initial version.
Copyright (c) 2012 www.elechouse.com All right reserved.
*/
/*****************************************************************************/
#ifndef __FMTX_H
#define __FMTX_H
#if defined(ARDUINO) && ARDUINO >= 100
#include "Arduino.h"
#else
#include "WProgram.h"
#endif
#include "wiring_private.h"
#ifndef __TYPE_REDEFINE
#define __TYPE_REDEFINE
typedef uint8_t u8;
typedef int8_t s8;
//typedef uint16_t u16;
typedef int16_t s16;
typedef uint32_t u32;
typedef int32_t s32;
#endif
#ifndef I2C_FREQ
#define I2C_FREQ 100000L
#endif
#define FMTX_CMD_WRITE (0x7C)
#define FMTX_CMD_READ (0x7D)
typedef enum{
PGA_0DB = 4,
PGA_4DB = 5,
PGA_8DB = 6,
PGA_12DB = 7,
PGA_N0DB = 0,
PGA_N4DB = 1,
PGA_N8DB = 2,
PGA_N12DB = 3,
}fmtx_pga_type;
typedef enum{
USA,
JAPAN,
EUROPE,
AUSTRALIA,
CHINA,
}country_type;
// void i2c_init(void);
// void fmtx_write_reg(u8 reg, u8 dt);
// u8 fmtx_read_reg(u8 reg);
// void fmtx_read_all(u8 *buf);
// void fmtx_set_alc(u8 sta);
// void fmtx_set_pga(fmtx_pga_type pga);
// void fmtx_pa_external();
// void fmtx_set_sl(void);
// void fmtx_set_rfgain(u8 rfgain);
// void fmtx_set_phcnst(country_type country);
// void fmtx_set_au_enhance(void);
// void fmtx_set_xtal(void);
void fmtx_init(float freq, country_type country);
void fmtx_set_freq(float freq);
// extern u8 fmtx_reg_val[18];
// extern u8 fmtx_reg[18];
#endif