Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
SC16IS750.h
00001 #ifndef MBED_SC16IS750 00002 #define MBED_SC16IS750 00003 00004 00005 #define DEFAULT_SC16IS750_ADDR 0x9A 00006 #define DEFAULT_BAUD_RATE 9600 00007 00008 class SC16IS750 { 00009 public: 00010 00011 typedef enum { 00012 RHR = 0x00 << 3, 00013 THR = 0x00 << 3, 00014 IER = 0x01 << 3, 00015 FCR = 0x02 << 3, 00016 IIR = 0x02 << 3, 00017 LCR = 0x03 << 3, 00018 MCR = 0x04 << 3, 00019 LSR = 0x05 << 3, 00020 MSR = 0x06 << 3, 00021 SPR = 0x07 << 3, 00022 TCR = 0x06 << 3, 00023 TLR = 0x07 << 3, 00024 TXLVL = 0x08 << 3, 00025 RXLVL = 0x09 << 3, 00026 IODir = 0x0A << 3, 00027 IOState = 0x0B << 3, 00028 IOIntEna = 0x0C << 3, 00029 reserved = 0x0D << 3, 00030 IOControl = 0x0E << 3, 00031 EFCR = 0x0F << 3, 00032 DLL = 0x00 << 3, 00033 DLH = 0x01 << 3, 00034 EFR = 0x02 << 3, 00035 XON1 = 0x04 << 3, 00036 XON2 = 0x05 << 3, 00037 XOFF1 = 0x06 << 3, 00038 XOFF2 = 0x07 << 3, 00039 } RegisterName; 00040 00041 SC16IS750( 00042 PinName I2C_sda, 00043 PinName I2C_scl, 00044 int baud_rate = DEFAULT_BAUD_RATE, 00045 char I2C_address = DEFAULT_SC16IS750_ADDR 00046 ); 00047 00048 void init_registers( void ); 00049 void set_baud( int ); 00050 void send_str( const char *s ); 00051 void register_write( char register_address, char data ); 00052 char register_read( char register_address ); 00053 00054 private: 00055 I2C i2c; 00056 int baud_rate; 00057 char i2c_addr; 00058 }; 00059 00060 #endif // MBED_SC16IS750
Generated on Wed Jul 13 2022 17:45:05 by
1.7.2