Routines to access the AR1000 FM radio chip. More...
#include "pic_utils.h"
#include "i2c.h"
Go to the source code of this file.
ITS networking routines - common to mode 1 and 2.
Definition in file ar1000.h.
#define AR1000_CHIP_ID 28 |
#define AR1000_DEV_ADDR 0b00100000 |
Definition at line 46 of file ar1000.h.
Referenced by ar1000_init(), ar1000_read_register(), ar1000_seek(), ar1000_seek_more(), ar1000_test(), ar1000_tune(), and ar1000_write_register().
#define ar1000_setup | ( | ) | ar1000_setup_io() |
#define AR1000_STATUS 19 |
Definition at line 220 of file ar1000.h.
Referenced by ar1000_seek_more().
#define R13_GPIO1_1 1 |
#define R13_GPIO2_1 3 |
#define R13_GPIO3_1 5 |
#define R15_RDS_CTRL 0 |
#define R15_RDS_MECC_1 4 |
#define R1_HARD_MUTE_ENABLE 1 |
Hard mute enable
Definition at line 79 of file ar1000.h.
Referenced by ar1000_seek(), ar1000_test(), and ar1000_tune().
#define R1_STC_INT_ENABLE 5 |
#define R2_TUNE_ENABLE 9 |
Tune channel enable
Definition at line 88 of file ar1000.h.
Referenced by ar1000_seek(), ar1000_seek_more(), and ar1000_tune().
#define R3_BAND_0 11 |
#define R3_BAND_1 12 |
Band control 0=US/EUROPE 1=Japan
Definition at line 115 of file ar1000.h.
Referenced by ar1000_seek(), and ar1000_tune().
#define R3_SEEK_CHANNEL_SPACING 13 |
Seek channel spacing 1=100k 0=200k
Definition at line 113 of file ar1000.h.
Referenced by ar1000_seek(), and ar1000_tune().
#define R3_SEEK_ENABLE 14 |
Seek enable
Definition at line 111 of file ar1000.h.
Referenced by ar1000_seek(), and ar1000_tune().
#define R3_SEEK_UP 15 |
#define STATUS_SEEK_TUNE_COMPLETE 5 |
void ar1000_init | ( | ) |
Definition at line 224 of file ar1000.c.
References AR1000_DEV_ADDR, ar1000_seek_threshold, i2c_write_eeprom_16bit(), regs, and uns8.
Referenced by ar1000_seek2(), ar1000_seek_more(), ar1000_set_volume(), and ar1000_tune().
uns16 ar1000_read_register | ( | uns8 | reg | ) |
Definition at line 70 of file ar1000.c.
References AR1000_DEV_ADDR, and i2c_read_eeprom_16bit().
void ar1000_seek | ( | uns16 | frequency, | |
bit | seek_up | |||
) |
Definition at line 83 of file ar1000.c.
References AR1000_DEV_ADDR, ar1000_seek_threshold, i2c_read_eeprom_16bit(), i2c_write_eeprom_16bit(), R1_HARD_MUTE_ENABLE, R2_TUNE_ENABLE, R3_BAND_1, R3_SEEK_CHANNEL_SPACING, R3_SEEK_ENABLE, R3_SEEK_UP, and uns16.
void ar1000_seek2 | ( | ) |
Definition at line 234 of file ar1000.c.
References ar1000_init(), and regs.
void ar1000_seek_more | ( | ) |
Definition at line 273 of file ar1000.c.
References AR1000_DEV_ADDR, ar1000_init(), AR1000_STATUS, channel, i2c_read_eeprom_16bit(), R2_TUNE_ENABLE, regs, serial_print_int(), serial_print_nl(), serial_print_str(), and uns16.
void ar1000_set_register | ( | uns8 | reg, | |
uns8 | data | |||
) |
void ar1000_set_seek_threshold | ( | uns8 | new_seek_threshold | ) |
Definition at line 219 of file ar1000.c.
References ar1000_seek_threshold.
void ar1000_set_volume | ( | uns8 | volume | ) |
Definition at line 321 of file ar1000.c.
References ar1000_init(), regs, uns16, uns8, and vol_lookup.
void ar1000_test | ( | ) |
Definition at line 255 of file ar1000.c.
References AR1000_DEV_ADDR, i2c_read_eeprom_16bit(), i2c_write_eeprom_16bit(), R1_HARD_MUTE_ENABLE, and uns16.
void ar1000_tune | ( | uns16 | frequency | ) |
Definition at line 145 of file ar1000.c.
References AR1000_DEV_ADDR, ar1000_init(), i2c_read_eeprom_16bit(), i2c_write_eeprom_16bit(), R1_HARD_MUTE_ENABLE, R2_TUNE_ENABLE, R3_BAND_1, R3_SEEK_CHANNEL_SPACING, R3_SEEK_ENABLE, regs, serial_print_int_hex(), serial_print_str(), and uns16.
void ar1000_write_register | ( | uns8 | reg, | |
uns16 | data | |||
) |
Definition at line 77 of file ar1000.c.
References AR1000_DEV_ADDR, and i2c_write_eeprom_16bit().