Adapted to T3 S3 V1.2 without PA

This commit is contained in:
lewishe 2023-06-12 11:46:53 +08:00
commit 227e29e2d9
19 changed files with 295 additions and 55 deletions

View file

@ -75,21 +75,49 @@ void setup()
while (true);
}
#if defined(RADIO_RX_PIN) && defined(RADIO_TX_PIN)
//Set ANT Control pins
radio.setRfSwitchPins(RADIO_RX_PIN, RADIO_TX_PIN);
#endif
// Set output power to 3 dBm !!Cannot be greater than 3dbm!!
if (radio.setOutputPower(3) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
#ifdef LILYGO_T3_S3_V1_0
// T3 S3 V1.1 with PA Version Set output power to 3 dBm !!Cannot be greater than 3dbm!!
int8_t TX_Power = 3;
#else
// T3 S3 V1.2 (No PA) Version Set output power to 3 dBm !!Cannot be greater than 3dbm!!
int8_t TX_Power = 13;
#endif
if (radio.setOutputPower(TX_Power) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
Serial.println(F("Selected output power is invalid for this module!"));
while (true);
}
// set carrier frequency to 2410.5 MHz
if (radio.setFrequency(2400.0) == RADIOLIB_ERR_INVALID_FREQUENCY) {
Serial.println(F("Selected frequency is invalid for this module!"));
while (true);
}
// set bandwidth to 203.125 kHz
if (radio.setBandwidth(203.125) == RADIOLIB_ERR_INVALID_BANDWIDTH) {
Serial.println(F("Selected bandwidth is invalid for this module!"));
while (true);
}
// set spreading factor to 10
if (radio.setSpreadingFactor(10) == RADIOLIB_ERR_INVALID_SPREADING_FACTOR) {
Serial.println(F("Selected spreading factor is invalid for this module!"));
while (true);
}
// set coding rate to 6
if (radio.setCodingRate(6) == RADIOLIB_ERR_INVALID_CODING_RATE) {
Serial.println(F("Selected coding rate is invalid for this module!"));
while (true);
}
// set the function that will be called
// when packet transmission is finished
radio.setDio1Action(setFlag);
@ -108,7 +136,7 @@ void setup()
// state = radio.startTransmit(byteArr, 8);
transmissionState = radio.startTransmit((uint8_t *)&counter, 4);
transmissionState = radio.startTransmit("Hello Word!");
}
@ -144,7 +172,7 @@ void loop()
}
// wait a second before transmitting again
delay(500);
delay(2);
// send another one
Serial.print(F("[SX1280] Sending another packet ... "));
@ -160,7 +188,7 @@ void loop()
int state = radio.startTransmit(byteArr, 8);
*/
transmissionState = radio.startTransmit((uint8_t *)&counter, 4);
transmissionState = radio.startTransmit("Hello Word!");
counter++;
// we're ready to send more packets,

View file

@ -11,9 +11,8 @@
// #define LILYGO_T3_V1_6 //NO SUPPOTR
// #define LILYGO_T3_V2_0 //NO SUPPOTR
// #define LILYGO_T3_V1_8
#ifndef LILYGO_T3_S3_V1_0
#define LILYGO_T3_S3_V1_0
#endif
// #define LILYGO_T3_S3_V1_0 //SUPPORT
// #define LILYGO_T3_S3_V1_2 //SUPPORT
#define UNUSE_PIN (0)
@ -209,6 +208,36 @@
#define HAS_SDCARD
#define HAS_DISPLAY
#elif defined(LILYGO_T3_S3_V1_2)
#define I2C_SDA 18
#define I2C_SCL 17
#define OLED_RST UNUSE_PIN
#define RADIO_SCLK_PIN 5
#define RADIO_MISO_PIN 3
#define RADIO_MOSI_PIN 6
#define RADIO_CS_PIN 7
#define RADIO_DIO1_PIN 9
#define RADIO_DIO2_PIN 33
#define RADIO_DIO3_PIN 34
#define RADIO_RST_PIN 8
#define RADIO_BUSY_PIN 36
#define SDCARD_MOSI 11
#define SDCARD_MISO 2
#define SDCARD_SCLK 14
#define SDCARD_CS 13
#define BOARD_LED 37
#define LED_ON HIGH
#define BAT_ADC_PIN 1
#define BUTTON_PIN 0
#define HAS_SDCARD
#define HAS_DISPLAY
#else
#error "For the first use, please define the board version and model in <utilities. h>"
#endif