Go to the source code of this file.
Classes | |
struct | sub_cfg_vpd |
union | sub_mdio_frame |
struct | sub_version |
Defines | |
#define | __SUB_DECL__ extern |
#define | ADC_ENABLE 0x8000 |
#define | ADC_REF_2_56 0x00C0 |
#define | ADC_REF_VCC 0x0040 |
#define | BB_I2C_FAST 0x01 |
#define | BB_I2C_FAST_P 0x00 |
#define | BB_I2C_STD 0x03 |
#define | DEF_SUB_ERROR(NAME, VAL, DESCR) NAME=VAL, |
#define | ETIMEDOUT 116 |
#define | FIFO_CLEAR 0x100 |
#define | FIFO_READ_FULL 0x200 |
#define | FIFO_SELECT_I2C 0x10 |
#define | FIFO_SELECT_SPI 0x01 |
#define | FIFO_SELECT_UART 0x02 |
#define | FPWM_EN0 0x8000 |
#define | FPWM_EN1 0x2000 |
#define | FPWM_EN2 0x0800 |
#define | FPWM_ENABLE 0x0001 |
#define | I2C_GCE 0x01 |
#define | IR_ROW_MODE 0x01 |
#define | IR_UART_MODE 0x00 |
#define | RS_CHAR_5 0x00 |
#define | RS_CHAR_6 0x02 |
#define | RS_CHAR_7 0x04 |
#define | RS_CHAR_8 0x06 |
#define | RS_CHAR_9 0x07 |
#define | RS_PARITY_EVEN 0x20 |
#define | RS_PARITY_NONE 0x00 |
#define | RS_PARITY_ODD 0x30 |
#define | RS_RX_AFTER_TX 0x02 |
#define | RS_RX_BEFORE_TX 0x01 |
#define | RS_RX_ENABLE 0x80 |
#define | RS_STOP_1 0x00 |
#define | RS_STOP_2 0x08 |
#define | RS_TX_ENABLE 0x40 |
#define | SPI_CLK_125KHZ 0x03 |
#define | SPI_CLK_1MHZ 0x01 |
#define | SPI_CLK_250KHZ 0x02 |
#define | SPI_CLK_2MHZ 0x81 |
#define | SPI_CLK_4MHZ 0x00 |
#define | SPI_CLK_500KHZ 0x82 |
#define | SPI_CLK_8MHZ 0x80 |
#define | SPI_CPOL_FALL 0x08 |
#define | SPI_CPOL_RISE 0x00 |
#define | SPI_ENABLE 0x40 |
#define | SPI_LSB_FIRST 0x20 |
#define | SPI_MSB_FIRST 0x00 |
#define | SPI_SETUP_SMPL 0x04 |
#define | SPI_SLAVE 0x10 |
#define | SPI_SMPL_SETUP 0x00 |
#define | SS_CONF(SS_N, SS_MODE) ((SS_N)<<4)|((SS_MODE)&0x0F) |
#define | SS_H 0x0F |
#define | SS_HHHHL 0x0C |
#define | SS_HHHL 0x0B |
#define | SS_HHL 0x0A |
#define | SS_HI 0x0D |
#define | SS_HiZ 0x08 |
#define | SS_HL 0x09 |
#define | SS_L 0x07 |
#define | SS_LH 0x01 |
#define | SS_LLH 0x02 |
#define | SS_LLLH 0x03 |
#define | SS_LLLLH 0x04 |
#define | SS_LO 0x05 |
#define | SUB_BOOT_MODE 0 |
#define | SUB_ERRORS |
#define | SUB_MDIO22 0x80 |
#define | SUB_MDIO22_READ (0x02|SUB_MDIO22) |
#define | SUB_MDIO22_WRITE (0x01|SUB_MDIO22) |
#define | SUB_MDIO45_ADDR 0x00 |
#define | SUB_MDIO45_PRIA 0x02 |
#define | SUB_MDIO45_READ 0x03 |
#define | SUB_MDIO45_WRITE 0x01 |
Typedefs | |
typedef void * | sub_device |
typedef void * | sub_handle |
typedef int | sub_int32_t |
Enumerations | |
enum | { SUB_LASTERROR } |
enum | { ADC_S0, ADC_S1, ADC_S2, ADC_S3, ADC_S4, ADC_S5, ADC_S6, ADC_S7, ADC_D10_10X = 9, ADC_D10_200X = 11, ADC_D32_10X = 13, ADC_D32_200X = 15, ADC_D01 = 16, ADC_D21 = 18, ADC_D31 = 19, ADC_D41 = 20, ADC_D51 = 21, ADC_D61 = 22, ADC_D71 = 23, ADC_D02 = 24, ADC_D12 = 25, ADC_D32 = 27, ADC_D42 = 28, ADC_D52 = 29, ADC_1_1V = 30, ADC_GND = 31 } |
Functions | |
int | sub_adc_config (sub_handle hndl, int flags) |
int | sub_adc_read (sub_handle hndl, int *data, int *mux, int reads) |
int | sub_adc_single (sub_handle hndl, int *data, int mux) |
int | sub_bb_i2c_config (sub_handle hndl, int mode, int stretch_ms) |
int | sub_bb_i2c_read (sub_handle hndl, int channel, int sa, sub_int32_t ma, int ma_sz, char *buf, int sz) |
int | sub_bb_i2c_scan (sub_handle hndl, int channel, int *slave_cnt, char *slave_buf) |
int | sub_bb_i2c_write (sub_handle hndl, int channel, int sa, sub_int32_t ma, int ma_sz, char *buf, int sz) |
int | sub_close (sub_handle hndl) |
int | sub_control_request (sub_handle hndl, int type, int request, int value, int index, char *buf, int sz, int timeout) |
int | sub_fifo_config (sub_handle hndl, int config) |
int | sub_fifo_read (sub_handle hndl, char *buf, int sz, int to_ms) |
int | sub_fifo_write (sub_handle hndl, char *buf, int sz, int to_ms) |
sub_device | sub_find_devices (sub_device first) |
int | sub_fpwm_config (sub_handle hndl, double freq_hz, int flags) |
int | sub_fpwm_set (sub_handle hndl, int pwm_n, double duty) |
struct sub_cfg_vpd * | sub_get_cfg_vpd (sub_handle hndl) |
int | sub_get_errno (void) |
int | sub_get_i2c_status (void) |
int | sub_get_mode (sub_handle hndl, int *boot) |
int | sub_get_product_id (sub_handle hndl, char *buf, int sz) |
int | sub_get_serial_number (sub_handle hndl, char *buf, int sz) |
struct sub_version * | sub_get_version (sub_handle hndl) |
int | sub_gpio_config (sub_handle hndl, sub_int32_t set, sub_int32_t *get, sub_int32_t mask) |
int | sub_gpio_read (sub_handle hndl, sub_int32_t *get) |
int | sub_gpio_write (sub_handle hndl, sub_int32_t set, sub_int32_t *get, sub_int32_t mask) |
int | sub_gpiob_config (sub_handle hndl, sub_int32_t set, sub_int32_t *get, sub_int32_t mask) |
int | sub_gpiob_read (sub_handle hndl, sub_int32_t *get) |
int | sub_gpiob_write (sub_handle hndl, sub_int32_t set, sub_int32_t *get, sub_int32_t mask) |
int | sub_i2c_config (sub_handle hndl, int sa, int flags) |
int | sub_i2c_freq (sub_handle hndl, sub_int32_t *freq) |
int | sub_i2c_read (sub_handle hndl, int sa, sub_int32_t ma, int ma_sz, char *buf, int sz) |
int | sub_i2c_scan (sub_handle hndl, int *slave_cnt, char *slave_buf) |
int | sub_i2c_start (sub_handle hndl) |
int | sub_i2c_stop (sub_handle hndl) |
int | sub_i2c_write (sub_handle hndl, int sa, sub_int32_t ma, int ma_sz, char *buf, int sz) |
int | sub_ir_config (sub_handle hndl, int carrier, int duty, int mode,...) |
int | sub_ir_tx (sub_handle hndl, int sz, char *buf) |
int | sub_lcd_write (sub_handle hndl, char *str) |
int | sub_mdio22 (sub_handle hndl, int op, int phyad, int regad, int data, int *content) |
int | sub_mdio45 (sub_handle hndl, int op, int prtad, int devad, int data, int *content) |
int | sub_mdio_xfer (sub_handle hndl, int count, union sub_mdio_frame *mdios) |
int | sub_mdio_xfer_ex (sub_handle hndl, int channel, int count, union sub_mdio_frame *mdios) |
sub_handle | sub_open (sub_device dev) |
int | sub_pwm_config (sub_handle hndl, int res_us, int limit) |
int | sub_pwm_set (sub_handle hndl, int pwm_n, int duty) |
int | sub_rs_get_config (sub_handle hndl, int *config, sub_int32_t *baud) |
int | sub_rs_set_config (sub_handle hndl, int config, sub_int32_t baud) |
int | sub_rs_timing (sub_handle hndl, int flags, int tx_space_us, int rx_msg_us, int rx_byte_us) |
int | sub_rs_xfer (sub_handle hndl, char *tx_buf, int tx_sz, char *rx_buf, int rx_sz) |
int | sub_sdio_transfer (sub_handle hndl, char *out_buf, char *in_buf, int out_sz, int in_sz, int ss_config) |
int | sub_set_debug_level (int level) |
int | sub_spi_config (sub_handle hndl, int cfg_set, int *cfg_get) |
int | sub_spi_transfer (sub_handle hndl, char *out_buf, char *in_buf, int sz, int ss_config) |
char * | sub_strerror (int errnum) |
int | usb_transaction (sub_handle hndl, char *out_buf, int out_sz, char *in_buf, int in_sz, int timeout) |
Variables | |
__SUB_DECL__ int | sub_errno |
__SUB_DECL__ int | sub_i2c_status |
#define SS_CONF | ( | SS_N, | |||
SS_MODE | ) | ((SS_N)<<4)|((SS_MODE)&0x0F) |
#define SUB_ERRORS |
DEF_SUB_ERROR( SE_OK, 0, "OK" )\ DEF_SUB_ERROR( SE_NODEV, 1, "SUB Device not found" )\ DEF_SUB_ERROR( SE_OPEN, 2, "Can't open SUB device" )\ DEF_SUB_ERROR( SE_SETCONF, 3, "Can't set configuration" )\ DEF_SUB_ERROR( SE_CLAIM, 4, "Can't claim interface" )\ DEF_SUB_ERROR( SE_SETA, 5, "Failed to setup async transaction" )\ DEF_SUB_ERROR( SE_SUBMIT, 6, "Failed to submit async transaction" )\ DEF_SUB_ERROR( SE_BULKOUT, 7, "Bulk write failed" )\ DEF_SUB_ERROR( SE_BULKIN_RC, 8, "Bulk read failed" )\ DEF_SUB_ERROR( SE_BULKIN_SZ, 9, "Bulk read incomplete" )\ DEF_SUB_ERROR( SE_OUT_OVF, 10, "Out buffer overflow" )\ DEF_SUB_ERROR( SE_I2C, 11, "I2C error" )\ DEF_SUB_ERROR( SE_TAG_CODE, 12, "Wrong tag code in response" )\ DEF_SUB_ERROR( SE_TAG_SIZE, 13, "Wrong tag size in response" )\ DEF_SUB_ERROR( SE_PARAM, 14, "Wrong parameters" )\ DEF_SUB_ERROR( SE_SPI_DIS, 15, "SPI Disabled" )\ DEF_SUB_ERROR( SE_NSUPPORTED, 16, "Feature not supported" )\ DEF_SUB_ERROR( SE_TIMEOUT, 17, "Timeout" )\ DEF_SUB_ERROR( SE_INIT, 18, "Init Failed" )\ DEF_SUB_ERROR( SE_BAD_HNDL, 19, "Bad Handle" )\ DEF_SUB_ERROR( SE_IR, 20, "InfraRed Failure" )
typedef void* sub_device |
typedef void* sub_handle |
typedef int sub_int32_t |
anonymous enum |
int sub_adc_config | ( | sub_handle | hndl, | |
int | flags | |||
) |
Definition at line 1442 of file lib/libsub.c.
int sub_adc_read | ( | sub_handle | hndl, | |
int * | data, | |||
int * | mux, | |||
int | reads | |||
) |
Definition at line 1461 of file lib/libsub.c.
int sub_adc_single | ( | sub_handle | hndl, | |
int * | data, | |||
int | mux | |||
) |
Definition at line 1457 of file lib/libsub.c.
int sub_bb_i2c_config | ( | sub_handle | hndl, | |
int | mode, | |||
int | stretch_ms | |||
) |
Definition at line 1624 of file lib/libsub.c.
int sub_bb_i2c_read | ( | sub_handle | hndl, | |
int | channel, | |||
int | sa, | |||
sub_int32_t | ma, | |||
int | ma_sz, | |||
char * | buf, | |||
int | sz | |||
) |
Definition at line 1664 of file lib/libsub.c.
int sub_bb_i2c_scan | ( | sub_handle | hndl, | |
int | channel, | |||
int * | slave_cnt, | |||
char * | slave_buf | |||
) |
Definition at line 1642 of file lib/libsub.c.
int sub_bb_i2c_write | ( | sub_handle | hndl, | |
int | channel, | |||
int | sa, | |||
sub_int32_t | ma, | |||
int | ma_sz, | |||
char * | buf, | |||
int | sz | |||
) |
Definition at line 1710 of file lib/libsub.c.
int sub_close | ( | sub_handle | hndl | ) |
Definition at line 485 of file lib/libsub.c.
int sub_control_request | ( | sub_handle | hndl, | |
int | type, | |||
int | request, | |||
int | value, | |||
int | index, | |||
char * | buf, | |||
int | sz, | |||
int | timeout | |||
) |
Definition at line 2189 of file lib/libsub.c.
int sub_fifo_config | ( | sub_handle | hndl, | |
int | config | |||
) |
Definition at line 1936 of file lib/libsub.c.
int sub_fifo_read | ( | sub_handle | hndl, | |
char * | buf, | |||
int | sz, | |||
int | to_ms | |||
) |
Definition at line 1869 of file lib/libsub.c.
int sub_fifo_write | ( | sub_handle | hndl, | |
char * | buf, | |||
int | sz, | |||
int | to_ms | |||
) |
Definition at line 1836 of file lib/libsub.c.
sub_device sub_find_devices | ( | sub_device | first | ) |
Definition at line 238 of file lib/libsub.c.
int sub_fpwm_config | ( | sub_handle | hndl, | |
double | freq_hz, | |||
int | flags | |||
) |
Definition at line 1259 of file lib/libsub.c.
int sub_fpwm_set | ( | sub_handle | hndl, | |
int | pwm_n, | |||
double | duty | |||
) |
Definition at line 1319 of file lib/libsub.c.
struct sub_cfg_vpd* sub_get_cfg_vpd | ( | sub_handle | hndl | ) | [read] |
Definition at line 582 of file lib/libsub.c.
int sub_get_errno | ( | void | ) |
Definition at line 2378 of file lib/libsub.c.
int sub_get_i2c_status | ( | void | ) |
Definition at line 2383 of file lib/libsub.c.
int sub_get_mode | ( | sub_handle | hndl, | |
int * | boot | |||
) |
Definition at line 505 of file lib/libsub.c.
int sub_get_product_id | ( | sub_handle | hndl, | |
char * | buf, | |||
int | sz | |||
) |
Definition at line 2218 of file lib/libsub.c.
int sub_get_serial_number | ( | sub_handle | hndl, | |
char * | buf, | |||
int | sz | |||
) |
Definition at line 2206 of file lib/libsub.c.
struct sub_version* sub_get_version | ( | sub_handle | hndl | ) | [read] |
Definition at line 530 of file lib/libsub.c.
int sub_gpio_config | ( | sub_handle | hndl, | |
sub_int32_t | set, | |||
sub_int32_t * | get, | |||
sub_int32_t | mask | |||
) |
Definition at line 1151 of file lib/libsub.c.
int sub_gpio_read | ( | sub_handle | hndl, | |
sub_int32_t * | get | |||
) |
Definition at line 1168 of file lib/libsub.c.
int sub_gpio_write | ( | sub_handle | hndl, | |
sub_int32_t | set, | |||
sub_int32_t * | get, | |||
sub_int32_t | mask | |||
) |
Definition at line 1183 of file lib/libsub.c.
int sub_gpiob_config | ( | sub_handle | hndl, | |
sub_int32_t | set, | |||
sub_int32_t * | get, | |||
sub_int32_t | mask | |||
) |
Definition at line 1205 of file lib/libsub.c.
int sub_gpiob_read | ( | sub_handle | hndl, | |
sub_int32_t * | get | |||
) |
Definition at line 1222 of file lib/libsub.c.
int sub_gpiob_write | ( | sub_handle | hndl, | |
sub_int32_t | set, | |||
sub_int32_t * | get, | |||
sub_int32_t | mask | |||
) |
Definition at line 1237 of file lib/libsub.c.
int sub_i2c_config | ( | sub_handle | hndl, | |
int | sa, | |||
int | flags | |||
) |
Definition at line 672 of file lib/libsub.c.
int sub_i2c_freq | ( | sub_handle | hndl, | |
sub_int32_t * | freq | |||
) |
Definition at line 617 of file lib/libsub.c.
int sub_i2c_read | ( | sub_handle | hndl, | |
int | sa, | |||
sub_int32_t | ma, | |||
int | ma_sz, | |||
char * | buf, | |||
int | sz | |||
) |
Definition at line 759 of file lib/libsub.c.
int sub_i2c_scan | ( | sub_handle | hndl, | |
int * | slave_cnt, | |||
char * | slave_buf | |||
) |
Definition at line 727 of file lib/libsub.c.
int sub_i2c_start | ( | sub_handle | hndl | ) |
Definition at line 687 of file lib/libsub.c.
int sub_i2c_stop | ( | sub_handle | hndl | ) |
Definition at line 708 of file lib/libsub.c.
int sub_i2c_write | ( | sub_handle | hndl, | |
int | sa, | |||
sub_int32_t | ma, | |||
int | ma_sz, | |||
char * | buf, | |||
int | sz | |||
) |
Definition at line 827 of file lib/libsub.c.
int sub_ir_config | ( | sub_handle | hndl, | |
int | carrier, | |||
int | duty, | |||
int | mode, | |||
... | ||||
) |
Definition at line 1751 of file lib/libsub.c.
int sub_ir_tx | ( | sub_handle | hndl, | |
int | sz, | |||
char * | buf | |||
) |
Definition at line 1804 of file lib/libsub.c.
int sub_lcd_write | ( | sub_handle | hndl, | |
char * | str | |||
) |
Definition at line 1498 of file lib/libsub.c.
int sub_mdio22 | ( | sub_handle | hndl, | |
int | op, | |||
int | phyad, | |||
int | regad, | |||
int | data, | |||
int * | content | |||
) |
Definition at line 1041 of file lib/libsub.c.
int sub_mdio45 | ( | sub_handle | hndl, | |
int | op, | |||
int | prtad, | |||
int | devad, | |||
int | data, | |||
int * | content | |||
) |
Definition at line 1057 of file lib/libsub.c.
int sub_mdio_xfer | ( | sub_handle | hndl, | |
int | count, | |||
union sub_mdio_frame * | mdios | |||
) |
Definition at line 1096 of file lib/libsub.c.
int sub_mdio_xfer_ex | ( | sub_handle | hndl, | |
int | channel, | |||
int | count, | |||
union sub_mdio_frame * | mdios | |||
) |
Definition at line 1073 of file lib/libsub.c.
sub_handle sub_open | ( | sub_device | dev | ) |
Definition at line 363 of file lib/libsub.c.
int sub_pwm_config | ( | sub_handle | hndl, | |
int | res_us, | |||
int | limit | |||
) |
Definition at line 1349 of file lib/libsub.c.
int sub_pwm_set | ( | sub_handle | hndl, | |
int | pwm_n, | |||
int | duty | |||
) |
Definition at line 1410 of file lib/libsub.c.
int sub_rs_get_config | ( | sub_handle | hndl, | |
int * | config, | |||
sub_int32_t * | baud | |||
) |
Definition at line 1550 of file lib/libsub.c.
int sub_rs_set_config | ( | sub_handle | hndl, | |
int | config, | |||
sub_int32_t | baud | |||
) |
Definition at line 1524 of file lib/libsub.c.
int sub_rs_timing | ( | sub_handle | hndl, | |
int | flags, | |||
int | tx_space_us, | |||
int | rx_msg_us, | |||
int | rx_byte_us | |||
) |
Definition at line 1573 of file lib/libsub.c.
int sub_rs_xfer | ( | sub_handle | hndl, | |
char * | tx_buf, | |||
int | tx_sz, | |||
char * | rx_buf, | |||
int | rx_sz | |||
) |
Definition at line 1597 of file lib/libsub.c.
int sub_sdio_transfer | ( | sub_handle | hndl, | |
char * | out_buf, | |||
char * | in_buf, | |||
int | out_sz, | |||
int | in_sz, | |||
int | ss_config | |||
) |
Definition at line 1009 of file lib/libsub.c.
int sub_set_debug_level | ( | int | level | ) |
int sub_spi_config | ( | sub_handle | hndl, | |
int | cfg_set, | |||
int * | cfg_get | |||
) |
Definition at line 891 of file lib/libsub.c.
int sub_spi_transfer | ( | sub_handle | hndl, | |
char * | out_buf, | |||
char * | in_buf, | |||
int | sz, | |||
int | ss_config | |||
) |
Definition at line 915 of file lib/libsub.c.
char* sub_strerror | ( | int | errnum | ) |
Definition at line 2173 of file lib/libsub.c.
int usb_transaction | ( | sub_handle | hndl, | |
char * | out_buf, | |||
int | out_sz, | |||
char * | in_buf, | |||
int | in_sz, | |||
int | timeout | |||
) |
Definition at line 2022 of file lib/libsub.c.
__SUB_DECL__ int sub_i2c_status |