Sakai Ritaro / KT0915
Embed: (wiki syntax)

« Back to documentation index

KT0915 Class Reference

KT0915 Class Reference

Library for KT0915. More...

#include <KT0915.h>

Public Member Functions

 KT0915 (PinName sda, PinName scl)
 Create a KT0915 instance connected to specified I2C pins.
void init (void)
 Initialize KT0915.
int getID (void)
 read KT0915_WHO_AM_I
void set_vol (int vol)
 set volume
void set_freq (bool mode, int freq)
 set frequency and tune
void set_xtal (int xtal)
 set xtal frequency
int get_rssi (bool mode)
 read RSSI (dB)
void set_space (bool mode, int space)
 set channel space
int get_snr (bool mode)
 read SNR (dB)
bool get_ready (void)
 read Chip Ready Indicator
void cali (void)
 re-cali

Detailed Description

Library for KT0915.

Definition at line 10 of file KT0915.h.


Constructor & Destructor Documentation

KT0915 ( PinName  sda,
PinName  scl 
)

Create a KT0915 instance connected to specified I2C pins.

Parameters:
sdaI2C-bus SDA pin
sclI2C-bus SCL pin

Definition at line 4 of file KT0915.cpp.


Member Function Documentation

void cali ( void   )

re-cali

Definition at line 135 of file KT0915.cpp.

bool get_ready ( void   )

read Chip Ready Indicator

0...Chip is not ready.

1...Chip is ready.

Definition at line 129 of file KT0915.cpp.

int get_rssi ( bool  mode )

read RSSI (dB)

AM...mode=0

FM...mode=1

Definition at line 105 of file KT0915.cpp.

int get_snr ( bool  mode )

read SNR (dB)

for FM only

Definition at line 119 of file KT0915.cpp.

int getID ( void   )

read KT0915_WHO_AM_I

return 0x4B54

Definition at line 31 of file KT0915.cpp.

void init ( void   )

Initialize KT0915.

Set paramaters below

0x02:0b0000000000000111 FM space:100KHz, R/L mute:disable

0x04:0b1110000010010000 FM/AM/device mute:disable, bass:disable DAC cap:60uF

0x05:0b1001100000100000 Mono:enable, de-emphasis:50uF, blend:disable

0x0A:0b0000010000000000 LDO:highest, FM AFC:enable

0x0C:0b0000000000101100 FM wide freq:enable

0x0F:0b1000100000000000 Stanby:disable, volume:0

0x16:0b0000000011000010 Mode:FM, use internal defined band, Audio gain:0dB, AM AFC:enable

0x22:0b1010001011101100 AM AGC fast win:fastest, AM AGC short win:slowest

AM bandwidth:6KHz, AM gain:12dB, Left Inverse Control:enable

0x23:0bxxx111xxxxxxxxxx low th:B

0x2E:0b0010100010001100 softmute:fast, AM softmute start level:0b100

softmute target volume:0b0100, softmute mode:RSSI, FM softmute start threshold:0b100

0x33:0b0101010000000001 AM space:9KHz

0x3F:0bxxxxxxxxx001x011 RF AGC patch

Definition at line 10 of file KT0915.cpp.

void set_freq ( bool  mode,
int  freq 
)

set frequency and tune

AM...mode=1, freq=frequency (KHz)

FM...mode=0, freq=100*frequency (MHz)

Definition at line 86 of file KT0915.cpp.

void set_space ( bool  mode,
int  space 
)

set channel space

AM...mode=0, space=1,9,10 (KHz)

If space=1, bandwidth sets 2KHz.

If space=9 or 10, bandwidth sets 6KHz.

FM...mode=1, space=50,100,200 (KHz)

Definition at line 51 of file KT0915.cpp.

void set_vol ( int  vol )

set volume

vol...0~31

Definition at line 78 of file KT0915.cpp.

void set_xtal ( int  xtal )

set xtal frequency

xtal=32,38,12000,24000 (KHz)

If your xtal is 32.768Khz,set to 32.

Definition at line 37 of file KT0915.cpp.