rs232toi2c
2.0.0.0
|
API for configuring and manipulating RS232 to I2C Click driver. More...
Modules | |
RS232 to I2C Registers List | |
List of registers of RS232 to I2C Click driver. | |
RS232 to I2C Registers Settings | |
Settings for registers of RS232 to I2C Click driver. | |
RS232 to I2C MikroBUS Map | |
MikroBUS pin mapping of RS232 to I2C Click driver. | |
Functions | |
void | rs232toi2c_cfg_setup (rs232toi2c_cfg_t *cfg) |
RS232 to I2C configuration object setup function. More... | |
err_t | rs232toi2c_init (rs232toi2c_t *ctx, rs232toi2c_cfg_t *cfg) |
RS232 to I2C initialization function. More... | |
err_t | rs232toi2c_default_cfg (rs232toi2c_t *ctx) |
RS232 to I2C default configuration function. More... | |
err_t | rs232toi2c_write_command (rs232toi2c_t *ctx, uint8_t cmd, uint8_t *data_in, uint8_t data_len) |
RS232 to I2C write command function. More... | |
err_t | rs232toi2c_read_command (rs232toi2c_t *ctx, uint8_t cmd, uint8_t *data_out, uint8_t data_len) |
RS232 to I2C read command function. More... | |
err_t | rs232toi2c_write_eeprom (rs232toi2c_t *ctx, uint16_t address, uint8_t *data_in, uint8_t data_len) |
RS232 to I2C write eeprom function. More... | |
err_t | rs232toi2c_read_eeprom (rs232toi2c_t *ctx, uint16_t address, uint8_t *data_out, uint8_t data_len) |
RS232 to I2C read eeprom function. More... | |
err_t | rs232toi2c_erase_eeprom_page (rs232toi2c_t *ctx, uint8_t page_num) |
RS232 to I2C erase eeprom page function. More... | |
err_t | rs232toi2c_set_gpio_out (rs232toi2c_t *ctx, uint8_t mask, uint8_t state) |
RS232 to I2C set gpio out function. More... | |
err_t | rs232toi2c_get_gpio_in (rs232toi2c_t *ctx, uint8_t *state) |
RS232 to I2C get gpio in function. More... | |
err_t | rs232toi2c_write_gpio_config (rs232toi2c_t *ctx, uint8_t sub_cmd, uint8_t mask, uint8_t config) |
RS232 to I2C write gpio config function. More... | |
err_t | rs232toi2c_read_gpio_config (rs232toi2c_t *ctx, uint8_t sub_cmd, uint8_t *config) |
RS232 to I2C read gpio config function. More... | |
err_t | rs232toi2c_write_uart_config (rs232toi2c_t *ctx, uint8_t sub_cmd, uint8_t config) |
RS232 to I2C write uart config function. More... | |
err_t | rs232toi2c_read_uart_config (rs232toi2c_t *ctx, uint8_t *config) |
RS232 to I2C read uart config function. More... | |
err_t | rs232toi2c_enable_uart (rs232toi2c_t *ctx, uint8_t state) |
RS232 to I2C enable uart function. More... | |
err_t | rs232toi2c_set_baud_rate (rs232toi2c_t *ctx, uint32_t baud_rate) |
RS232 to I2C set baud rate function. More... | |
err_t | rs232toi2c_get_baud_rate (rs232toi2c_t *ctx, uint32_t *baud_rate) |
RS232 to I2C get baud rate function. More... | |
err_t | rs232toi2c_enable_interrupts (rs232toi2c_t *ctx, uint8_t int_mask) |
RS232 to I2C enable interrupts function. More... | |
err_t | rs232toi2c_get_interrupt_status (rs232toi2c_t *ctx, uint8_t *int_status) |
RS232 to I2C get interrupt status function. More... | |
err_t | rs232toi2c_get_uart_status (rs232toi2c_t *ctx, uint8_t *uart_status) |
RS232 to I2C get uart status function. More... | |
err_t | rs232toi2c_get_gpio_status (rs232toi2c_t *ctx, uint8_t *gpio_status) |
RS232 to I2C get gpio status function. More... | |
err_t | rs232toi2c_write_tx_fifo (rs232toi2c_t *ctx, uint8_t *data_in, uint8_t data_len) |
RS232 to I2C write tx fifo function. More... | |
err_t | rs232toi2c_read_rx_fifo (rs232toi2c_t *ctx, uint8_t *data_out, uint8_t *data_len) |
RS232 to I2C read rx fifo function. More... | |
err_t | rs232toi2c_read_system_version (rs232toi2c_t *ctx, uint32_t *system_version) |
RS232 to I2C read system version function. More... | |
void | rs232toi2c_set_rst_pin (rs232toi2c_t *ctx, uint8_t state) |
RS232 to I2C set rst pin function. More... | |
void | rs232toi2c_set_wp_pin (rs232toi2c_t *ctx, uint8_t state) |
RS232 to I2C set wp pin function. More... | |
void | rs232toi2c_reset_device (rs232toi2c_t *ctx) |
RS232 to I2C reset device function. More... | |
uint8_t | rs232toi2c_get_int_pin (rs232toi2c_t *ctx) |
RS232 to I2C get int pin function. More... | |
API for configuring and manipulating RS232 to I2C Click driver.
void rs232toi2c_cfg_setup | ( | rs232toi2c_cfg_t * | cfg | ) |
RS232 to I2C configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See rs232toi2c_cfg_t object definition for detailed explanation. |
err_t rs232toi2c_default_cfg | ( | rs232toi2c_t * | ctx | ) |
RS232 to I2C default configuration function.
This function executes a default configuration of RS232 to I2C click board.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_enable_interrupts | ( | rs232toi2c_t * | ctx, |
uint8_t | int_mask | ||
) |
RS232 to I2C enable interrupts function.
This function enables the specified interrupts.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | int_mask | : Interrupt enable mask. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_enable_uart | ( | rs232toi2c_t * | ctx, |
uint8_t | state | ||
) |
RS232 to I2C enable uart function.
This function enables the UART RX/TX features.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | state | :
|
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_erase_eeprom_page | ( | rs232toi2c_t * | ctx, |
uint8_t | page_num | ||
) |
RS232 to I2C erase eeprom page function.
This function erases the specified eeprom memory page.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | page_num | : EEPROM page number [0-15]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_get_baud_rate | ( | rs232toi2c_t * | ctx, |
uint32_t * | baud_rate | ||
) |
RS232 to I2C get baud rate function.
This function reads the actual UART baud rate.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | baud_rate | : Baud rate. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_get_gpio_in | ( | rs232toi2c_t * | ctx, |
uint8_t * | state | ||
) |
RS232 to I2C get gpio in function.
This function reads the GPIO in pins logic state.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | state | : GPIO pin state [3-bit, 1-HIGH, 0-LOW]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_get_gpio_status | ( | rs232toi2c_t * | ctx, |
uint8_t * | gpio_status | ||
) |
RS232 to I2C get gpio status function.
This function reads the gpio status register and clears it.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | gpio_status | : GPIO status register read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t rs232toi2c_get_int_pin | ( | rs232toi2c_t * | ctx | ) |
RS232 to I2C get int pin function.
This function returns the INT pin logic state.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
err_t rs232toi2c_get_interrupt_status | ( | rs232toi2c_t * | ctx, |
uint8_t * | int_status | ||
) |
RS232 to I2C get interrupt status function.
This function reads the interrupt status register and clears it.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | int_status | : Interrupt status register read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_get_uart_status | ( | rs232toi2c_t * | ctx, |
uint8_t * | uart_status | ||
) |
RS232 to I2C get uart status function.
This function reads the uart status register and clears it.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | uart_status | : UART status register read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_init | ( | rs232toi2c_t * | ctx, |
rs232toi2c_cfg_t * | cfg | ||
) |
RS232 to I2C initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See rs232toi2c_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_read_command | ( | rs232toi2c_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_out, | ||
uint8_t | data_len | ||
) |
RS232 to I2C read command function.
This function reads a desired number of data bytes from the selected command by using I2C serial interface.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | cmd | : Command address. |
[out] | data_out | : Output read data. |
[in] | data_len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_read_eeprom | ( | rs232toi2c_t * | ctx, |
uint16_t | address, | ||
uint8_t * | data_out, | ||
uint8_t | data_len | ||
) |
RS232 to I2C read eeprom function.
This function reads a desired number of data bytes from the selected eeprom address by using I2C serial interface.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | address | : EEPROM address [0-511]. |
[out] | data_out | : Output read data. |
[in] | data_len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_read_gpio_config | ( | rs232toi2c_t * | ctx, |
uint8_t | sub_cmd, | ||
uint8_t * | config | ||
) |
RS232 to I2C read gpio config function.
This function reads a desired config from the selected GPIO config sub command.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | sub_cmd | : GPIO pin config sub command. |
[out] | config | : GPIO pin config [3-bit]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_read_rx_fifo | ( | rs232toi2c_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t * | data_len | ||
) |
RS232 to I2C read rx fifo function.
This function reads all data from RX fifo.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | data_out | : Output data read. |
[out] | data_len | : Output number of data bytes read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_read_system_version | ( | rs232toi2c_t * | ctx, |
uint32_t * | system_version | ||
) |
RS232 to I2C read system version function.
This function reads the system version.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | system_version | : System version [3 bytes]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_read_uart_config | ( | rs232toi2c_t * | ctx, |
uint8_t * | config | ||
) |
RS232 to I2C read uart config function.
This function reads the UART config.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[out] | config | : UART config [2 bytes]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void rs232toi2c_reset_device | ( | rs232toi2c_t * | ctx | ) |
RS232 to I2C reset device function.
This function resets the device by toggling the RST pin.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
err_t rs232toi2c_set_baud_rate | ( | rs232toi2c_t * | ctx, |
uint32_t | baud_rate | ||
) |
RS232 to I2C set baud rate function.
This function sets the UART baud rate.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | baud_rate | : Baud rate. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_set_gpio_out | ( | rs232toi2c_t * | ctx, |
uint8_t | mask, | ||
uint8_t | state | ||
) |
RS232 to I2C set gpio out function.
This function sets the specified GPIO out pin logic state.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | mask | : GPIO pin mask [3-bit]. |
[in] | state | : GPIO pin state [3-bit, 1-HIGH, 0-LOW]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void rs232toi2c_set_rst_pin | ( | rs232toi2c_t * | ctx, |
uint8_t | state | ||
) |
RS232 to I2C set rst pin function.
This function sets the RST pin logic state.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
void rs232toi2c_set_wp_pin | ( | rs232toi2c_t * | ctx, |
uint8_t | state | ||
) |
RS232 to I2C set wp pin function.
This function sets the WP pin logic state.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | state | : Pin logic state. |
err_t rs232toi2c_write_command | ( | rs232toi2c_t * | ctx, |
uint8_t | cmd, | ||
uint8_t * | data_in, | ||
uint8_t | data_len | ||
) |
RS232 to I2C write command function.
This function writes a desired number of data bytes to the selected command by using I2C serial interface.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | cmd | : Command address. |
[in] | data_in | : Data to be written. |
[in] | data_len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_write_eeprom | ( | rs232toi2c_t * | ctx, |
uint16_t | address, | ||
uint8_t * | data_in, | ||
uint8_t | data_len | ||
) |
RS232 to I2C write eeprom function.
This function writes a desired number of data bytes to the selected eeprom address by using I2C serial interface.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | address | : EEPROM address [0-511]. |
[in] | data_in | : Data to be written. |
[in] | data_len | : Number of bytes to be written (up to 32 bytes). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_write_gpio_config | ( | rs232toi2c_t * | ctx, |
uint8_t | sub_cmd, | ||
uint8_t | mask, | ||
uint8_t | config | ||
) |
RS232 to I2C write gpio config function.
This function writes a desired config to the selected GPIO config sub command.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | sub_cmd | : GPIO pin config sub command. |
[in] | mask | : GPIO pin mask [3-bit]. |
[in] | config | : GPIO pin config [3-bit]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_write_tx_fifo | ( | rs232toi2c_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | data_len | ||
) |
RS232 to I2C write tx fifo function.
This function writes a desired number of data bytes to the TX fifo.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | data_len | : Number of data bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t rs232toi2c_write_uart_config | ( | rs232toi2c_t * | ctx, |
uint8_t | sub_cmd, | ||
uint8_t | config | ||
) |
RS232 to I2C write uart config function.
This function writes a desired config to the selected UART config sub command.
[in] | ctx | : Click context object. See rs232toi2c_t object definition for detailed explanation. |
[in] | sub_cmd | : UART config sub command. |
[in] | config | : Sub command config. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.