-
Notifications
You must be signed in to change notification settings - Fork 29
Other functions
Alex edited this page Sep 9, 2019
·
4 revisions
This page is reserved for functions that are not necessarily in the actual panStamp API list but they may be used if someone finds good fit for them. These are mainly core functions that change voltages, clocks and more so they aren't recommended for general projects but rather fine tuning the MCU.
//Arduino-specific functions (other values than AVR generally expects)
pinMode(pin, INPUT_PULLDOWN);
pinMode_int(pin, mode & OUTPUT/INPUT/INPUT_PULLUP/INPUT_PULLDOWN) //multi-mode pin
analogReference(DEFAULT(AVcc)/INTERNAL1V5/INTERNAL2V0/INTERNAL2V5);
//Core functions
panstamp.core.init(uint8_t vCore=2, uint16_t dcorsel=DCORSEL_5, uint16_t flln=0x16E);
panstamp.core.init20mhz(); //Initialize CC430 core at VCORE = 2 and SCLK = 20 MHz
panstamp.core.setLowPowerMode(); //Enter low power mode, used in panstamp.sleep();
panstamp.core.setNormalMode(); //Revert from low power mode used in panstamp.wakeUp();
panstamp.core.begin(); //Initialize CC430 core depending on Vcc, used in panstamp.init();
enableWatchDog();
disableWatchDog();
sleep(); //milliseconds
sleepSeconds(); //seconds
//Radio functions
panstamp.radio.init(uint8_t freq, uint8_t mode); //* @param mode Working mode (speed, ...) (0, MODE_LOW_SPEED, ...); * @param freq Carrier frequency (CFREQ_868,...)
panstamp.radio.reset(); //Reset CC1101 radio
panstamp.radio.wakeUp(); //Wake up core (CC1101)
panstamp.radio.setRxOnState(); //Put radio in Rx mode, used in panstamp.rxOn();
panstamp.radio.setRxOffState(); //Disable RX mode, used in panstamp.rxOff();
panstamp.radio.setTxState(); //Enter Tx state
panstamp.radio.setPowerDownState(); //Put CC1101 into power-down state(sleep), used in panstamp.sleep();
panstamp.radio.setWorState(uint16_t millis); //Enter Wake-On-Radio state (millis must be between 12 and 2000)
panstamp.radio.setTxPowerAmp(uint8_t paLevel); //Set PATABLE value, paLevel is amplification value
panstamp.radio.enableHGM(); //Enable Long-distance board with CC1190 IC in high-gain mode
panstamp.radio.disableHGM(); //Disable high-gain mode on the LD-Board
//Disable LNA or PA (requires extra CC1190 chip/NRG 3)
digitalWrite(LNA_EN, LOW);
digitalWrite(PA_EN, LOW);
RTCA_STOP(); //Halt the RTC, used in panstamp.rtc.stopCalendar();
RTCA_START(); //Resume the RTC, used in panstamp.rtc.startCalendar();
RTC_SET_DAY_ALARM(day)
RTC_SET_DOW_ALARM(dow)
RTC_SET_HOUR_ALARM(hour)
RTC_SET_MIN_ALARM(min)