Skip to content

Commit

Permalink
Default CC1190 initialization for NRG3
Browse files Browse the repository at this point in the history
  • Loading branch information
dberenguer committed Jul 26, 2018
1 parent 9856937 commit adec8c5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions cores/panstamp/cc430radio.cpp
Expand Up @@ -79,6 +79,15 @@ void CC430RADIO::init(uint8_t freq, uint8_t mode)

// Enter RX state
setRxOnState();

#ifdef CC1190_AVAILABLE
pinMode(HGM, OUTPUT);
pinMode(LNA_EN, OUTPUT);
pinMode(PA_EN, OUTPUT);
digitalWrite(HGM, LOW);
digitalWrite(LNA_EN, LOW);
digitalWrite(PA_EN, LOW);
#endif
}

/**
Expand Down Expand Up @@ -257,7 +266,9 @@ void CC430RADIO::setRxOnState(void)
rfState = RFSTATE_RXON;

// Enable LNA on LD-board if any
#ifndef CC1190_AVAILABLE
if (hgmEnabled)
#endif
enableLNA();
}

Expand Down Expand Up @@ -287,7 +298,9 @@ void CC430RADIO::setRxOffState(void)
rfState = RFSTATE_RXOFF;

// Disable LNA on LD-board if any
#ifndef CC1190_AVAILABLE
if (hgmEnabled)
#endif
disableLNA();
}

Expand Down
2 changes: 2 additions & 0 deletions cores/panstamp/cc430radio.h
Expand Up @@ -413,9 +413,11 @@ class CC430RADIO
{
hgmEnabled = true;

#ifndef CC1190_AVAILABLE // CC1190 as an external board
pinMode(HGM, OUTPUT);
pinMode(LNA_EN, OUTPUT);
pinMode(PA_EN, OUTPUT);
#endif

digitalWrite(HGM, HIGH);
enableLNA();
Expand Down

0 comments on commit adec8c5

Please sign in to comment.