|
貌似在HARDWARE.H里找到了相关代码
#else
// RX operation
#define PPM_OUT 9 // OCP1A
#define RSSI_OUT 3 // PD3 OC2B
#define PWM_1 9 // PB1 - also PPM
#define PWM_2 A4 // PC4 - also SDA
#define PWM_3 3 // PD3 - also RSSI
#define PWM_4 A5 // PC5 - also SCL
#define PWM_5 A0 // PC0
#define PWM_6 A1 // PC1
#define OUTPUTS 8 // outputs available
const pinMask_t OUTPUT_MASKS[OUTPUTS] = {
{0x02,0x00,0x00}, {0x00,0x10,0x00}, {0x00,0x00,0x08},// CH1/PPM, CH2/SDA, CH3/RSSI
{0x00,0x20,0x00}, {0x00,0x01,0x00}, {0x00,0x02,0x00},// CH4/SCL, CH5/AIN, CH6/AIN,
{0x00,0x00,0x01}, {0x00,0x00,0x02}, // CH7/RXD, CH8/TXD - only on 6ch
};
#define PPM_OUTPUT 0
#define RSSI_OUTPUT 2
#define ANALOG0_OUTPUT 1 // actually input
#define ANALOG1_OUTPUT 3 // actually input
#define ANALOG0_OUTPUT_ALT 4 // actually input
#define ANALOG1_OUTPUT_ALT 5 // actually input
#define SDA_OUTPUT 1
#define SCL_OUTPUT 3
#define LLIND_OUTPUT 5
#define RXD_OUTPUT 6
#define TXD_OUTPUT 7
const uint8_t OUTPUT_PIN[OUTPUTS] = { 9, A4, 3, A5, A0, A1, 0, 1};
struct rxSpecialPinMap rxSpecialPins[] = {
{ 0, PINMAP_PPM},
{ 1, PINMAP_SDA},
{ 1, PINMAP_ANALOG}, // AIN0
{ 2, PINMAP_RSSI},
{ 2, PINMAP_LBEEP},
{ 3, PINMAP_SCL},
{ 3, PINMAP_ANALOG}, // AIN1
{ 4, PINMAP_ANALOG},
{ 5, PINMAP_ANALOG},
{ 5, PINMAP_LLIND},
{ 6, PINMAP_RXD},
{ 7, PINMAP_TXD},
{ 7, PINMAP_SPKTRM},
{ 7, PINMAP_SBUS},
{ 7, PINMAP_SUMD},
};
大神你是多么牛啊,这都能找到,我没系统的学过C语言,就看过一本“爱上ARDUINO”的书,有些定义看不很懂,像CH1,也就是D9,同时也是PPM,系统是如何判断到底输出通道信号还是PPM信号的,代码在哪一段呢?
|
|