mathertel / Radio

An Arduino library to control FM radio chips like SI4703, SI4705, RDA5807M, TEA5767.
http://mathertel.github.io/Radio
BSD 3-Clause "New" or "Revised" License
297 stars 89 forks source link

Si7403 #define IN_EUROPE hardcoded #60

Closed fjansson closed 1 year ago

fjansson commented 1 year ago

For Si4703, the region setting is hardcoded: https://github.com/mathertel/Radio/blob/5772c7cda2ce4c58176d9eb688cae46af2579464/src/SI4703.cpp#L27 Would it be possible to make this configurable? The European spacing (100 kHz) is finer than the US spacing (200 kHz), so US stations can still be tuned. The IN_EUROPE flag also forces the European de-emphasis setting of 50 us.

Related: would it be possible to support the Japanese FM band 76–95 MHz ?

mathertel commented 1 year ago

The IN_EUROPE definition was used to locate where the library has to be changed for other countries.

This was used for channel spacing and de-emphasis settings and the library used the settings typically used in Europe.

With the next version you can control this using the radio.setup function that must be called with the required settings before calling init() or initWire().

For example:

radio.setup(RADIO_FMSPACING, RADIO_FMSPACING_100); // for EUROPE
radio.setup(RADIO_DEEMPHASIS, RADIO_DEEMPHASIS_50); // for EUROPE