Skip to content

Commit

Permalink
SI4844 Arduino Library
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Lima Caratti committed Jun 8, 2020
1 parent 179f982 commit ec52adb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
10 changes: 7 additions & 3 deletions SI4844.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,23 @@ void SI4844::waitInterrupt(void)
* @ingroup GB
* @brief Initiates the SI4844 instance and connect the device (SI4844) to Arduino.
* @details Calling this library should be the first thing to do to control the SI4844.
* @details If interruptPin is -1, it means you will control interrupt in your sketch.
* @details In this case, you have to call interrupt_hundler() (see SI4844.h)
* @param resetPin arduino pin used to reset the device
* @param interruptPin interruprPin arduino pin used to handle interrupt
* @param defaultBand band that the radio should start
*/
void SI4844::setup(uint16_t resetPin, uint16_t interruptPin, byte defaultBand)
void SI4844::setup(uint16_t resetPin, int interruptPin, byte defaultBand)
{

this->resetPin = resetPin;
this->interruptPin = interruptPin;

// Arduino interrupt setup.
pinMode(interruptPin, INPUT);
attachInterrupt(digitalPinToInterrupt(interruptPin), interrupt_hundler, RISING);
if (interruptPin != -1 ) {
pinMode(interruptPin, INPUT);
attachInterrupt(digitalPinToInterrupt(interruptPin), interrupt_hundler, RISING);
}

pinMode(resetPin, OUTPUT);
digitalWrite(resetPin, HIGH);
Expand Down
2 changes: 1 addition & 1 deletion SI4844.h
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public :
void sendCommand(uint8_t cmd, int parameter_size, const uint8_t *parameter);
void getCommandResponse(int response_size, uint8_t *response);

void setup(uint16_t, uint16_t, byte);
void setup(uint16_t resetPin, int interruptPin, byte defaultBand);
void debugDevice(uint16_t resetPin, uint16_t interruptPin, uint8_t defaultBand, void (*showFunc)(char *msg));
void reset(void );
void setBand(byte);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/*
Test and validation of the SI4735 Arduino Library on ATtiny85.
ATTENTION: Under construction......
Test and validation of the SI4844 Arduino Library with ATtiny85.
It is a simple AM/FM radio implementation.
Prototype documentation : https://pu2clr.github.io/SI4735/
Expand Down Expand Up @@ -37,7 +39,7 @@ void setup()
oled.on();
oled.setFont(FONT8X16);
oled.setCursor(0, 0);
oled.print("Si4735-Attiny85");
oled.print("Si4844-Attiny85");
oled.setCursor(0, 2);
oled.print(" By PU2CLR ");
delay(2000);
Expand Down

0 comments on commit ec52adb

Please sign in to comment.