expand 2.0.0.0
|
Functions | |
void | expand_cfg_setup (expand_cfg_t *cfg) |
Config Object Initialization function. | |
EXPAND_RETVAL | expand_init (expand_t *ctx, expand_cfg_t *cfg) |
Initialization function. | |
uint8_t | expand_read_byte (expand_t *ctx, uint8_t mod_cmd, uint8_t reg_addr) |
Generic read one bayt from register function. | |
void | expand_write_byte (expand_t *ctx, uint8_t mod_cmd, uint8_t reg_addr, uint8_t write_data) |
Generic write one bayt to register function. | |
void | expand_default_configuration (expand_t *ctx, uint8_t mod_cmd) |
Generic write one bayt to register function. | |
void | expand_set_bits (expand_t *ctx, uint8_t mod_cmd, uint8_t reg_addr, uint8_t bit_mask) |
Set register bits function. | |
void | expand_clear_bits (expand_t *ctx, uint8_t mod_cmd, uint8_t reg_addr, uint8_t bit_mask) |
Clear register bits function. | |
void | expand_toggle_bits (expand_t *ctx, uint8_t mod_cmd, uint8_t reg_addr, uint8_t bit_mask) |
Toggle register bits function. | |
uint8_t | expand_read_port_a (expand_t *ctx, uint8_t mod_cmd) |
Read one byte of data from PORTA function. | |
uint8_t | expand_read_port_b (expand_t *ctx, uint8_t mod_cmd) |
Read one byte of data from PORTB function. | |
uint16_t | expand_read_both_porta (expand_t *ctx, uint8_t mod_cmd) |
Read two byte of data from PORTA & PORTB function. | |
void | expand_write_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t write_data) |
Write one byte of data to register for PORTA function. | |
void | expand_clear_bit_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Clear bit from register for PORTA function. | |
void | expand_set_bit_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Set bit to register for PORTA function. | |
void | expand_toggle_bit_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Toggle bit to register for PORTA function. | |
void | expand_write_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t write_data) |
Write one byte of data to register for PORTB function. | |
void | expand_clear_bit_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Clear bit from register for PORTB function. | |
void | expand_set_bit_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Set bit to register for PORTB function. | |
void | expand_toggle_bit_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Toggle bit to register for PORTB function. | |
void | expand_set_direction_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t write_data) |
Set expander PORTA direction function. | |
void | expand_set_input_dir_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Set expander PORTA input direction function. | |
void | expand_set_output_dir_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Set expander PORTA output direction function. | |
void | expand_set_direction_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t write_data) |
Set expander PORTB direction function. | |
void | expand_set_input_dir_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Set expander PORTB input direction function. | |
void | expand_set_output_dir_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t bit_mask) |
Set expander PORTB output direction function. | |
void | expand_set_pull_ups_port_a (expand_t *ctx, uint8_t mod_cmd, uint8_t write_data) |
Set pull-ups of the expander for PORTA pins function. | |
void | expand_set_pull_ups_port_b (expand_t *ctx, uint8_t mod_cmd, uint8_t write_data) |
Set pull-ups of the expander for PORTB pins function. | |
void | expand_set_potr_a (expand_t *ctx, uint8_t position) |
Active pin by position on PORTA function. | |
void | expand_set_potr_b (expand_t *ctx, uint8_t position) |
Active pin by position on PORTB function. | |
void | expand_reset (expand_t *ctx) |
Reset function. | |
uint8_t | expand_get_interrupt (expand_t *ctx) |
Get state of interrupt pin function. | |
void expand_cfg_setup | ( | expand_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void expand_clear_bit_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Clear bit from register for PORTA function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bits mask. |
@description Function clear bit from 8-bit register address from PORTA of MCP23S17 chip.
void expand_clear_bit_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Clear bit from register for PORTB function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bits mask. |
@description Function clear bit from 8-bit register address from PORTB of MCP23S17 chip.
void expand_clear_bits | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | reg_addr, | ||
uint8_t | bit_mask ) |
Clear register bits function.
ctx | Click object. |
mod_cmd | Module command. |
reg_addr | Register address. |
bit_mask | Bits mask. |
@description Function clear bits from 8-bit register address of MCP23S17 chip.
void expand_default_configuration | ( | expand_t * | ctx, |
uint8_t | mod_cmd ) |
Generic write one bayt to register function.
ctx | Click object. |
mod_cmd | Module command. |
@description Function set default configuration to MCP23S17 chip.
uint8_t expand_get_interrupt | ( | expand_t * | ctx | ) |
Get state of interrupt pin function.
ctx | Click object. |
@description Function get state of interrupt ( INT ) pin.
EXPAND_RETVAL expand_init | ( | expand_t * | ctx, |
expand_cfg_t * | cfg ) |
Initialization function.
expand | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
uint16_t expand_read_both_porta | ( | expand_t * | ctx, |
uint8_t | mod_cmd ) |
Read two byte of data from PORTA & PORTB function.
ctx | Click object. |
mod_cmd | Module command. |
@description Function read 16-bit of data from PORTA & PORTB from 8-bit register address of MCP23S17 chip.
uint8_t expand_read_byte | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | reg_addr ) |
Generic read one bayt from register function.
ctx | Click object. |
mod_amd | Module command. |
reg_addr | Register address. |
@description Function read 8-bit of data from 8-bit register address of MCP23S17 chip.
uint8_t expand_read_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd ) |
Read one byte of data from PORTA function.
ctx | Click object. |
mod_cmd | Module command. |
@description Function read 8-bit of data from PORTA from 8-bit register address of MCP23S17 chip.
uint8_t expand_read_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd ) |
Read one byte of data from PORTB function.
ctx | Click object. |
mod_cmd | Module command. |
@description Function read 8-bit of data from PORTB from 8-bit register address of MCP23S17 chip.
void expand_reset | ( | expand_t * | ctx | ) |
Reset function.
ctx | Click object. |
mod_cmd | Module command. |
write_data | Pull up value. |
@description Function reset Expand 2 click by set RST pin from low to high.
void expand_set_bit_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Set bit to register for PORTA function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bits mask. |
@description Function set bit to 8-bit register address from PORTA of MCP23S17 chip.
void expand_set_bit_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Set bit to register for PORTB function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bits mask. |
@description Function set bit to 8-bit register address from PORTB of MCP23S17 chip.
void expand_set_bits | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | reg_addr, | ||
uint8_t | bit_mask ) |
Set register bits function.
ctx | Click object. |
mod_cmd | Module command. |
reg_addr | Register address. |
bit_mask | Bits mask. |
@description Function set bits to 8-bit register address of MCP23S17 chip.
void expand_set_direction_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | write_data ) |
Set expander PORTA direction function.
ctx | Click object. |
mod_cmd | Module command. |
write_data | Data to write. |
@description Function set expander direction by write 8-bit data to 8-bit register address from PORTA of MCP23S17 chip.
void expand_set_direction_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | write_data ) |
Set expander PORTB direction function.
ctx | Click object. |
mod_cmd | Module command. |
write_data | Data to write. |
@description Function set expander direction by write 8-bit data to 8-bit register address from PORTB of MCP23S17 chip.
void expand_set_input_dir_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Set expander PORTA input direction function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bit mask. |
@description Function write bit, when expander direction of PORTA set as input, to 8-bit register address from PORTA of MCP23S17 chip.
void expand_set_input_dir_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Set expander PORTB input direction function.
ctx | Click object |
mod_cmd | Module command. |
bit_mask | Bit mask. |
@description Function write bit, when expander direction of PORTB set as input, to 8-bit register address from PORTB of MCP23S17 chip.
void expand_set_output_dir_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Set expander PORTA output direction function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bit mask. |
@description Function write bit, when expander direction of PORTA set as output, to 8-bit register address from PORTA of MCP23S17 chip.
void expand_set_output_dir_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Set expander PORTB output direction function.
ctx | Click object |
mod_cmd | Module command. |
bit_mask | Bit mask. |
@description Function write bit, when expander direction of PORTB set as output, to 8-bit register address from PORTB of MCP23S17 chip.
void expand_set_potr_a | ( | expand_t * | ctx, |
uint8_t | position ) |
Active pin by position on PORTA function.
ctx | Click object. |
position | Pin position. |
@description Function activate pin on PORTA by position, from PA0 to PA7.
void expand_set_potr_b | ( | expand_t * | ctx, |
uint8_t | position ) |
Active pin by position on PORTB function.
ctx | Click object. |
position | Pin position. |
@description Function activate pin on PORTB by position, from PB0 to PB7.
void expand_set_pull_ups_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | write_data ) |
Set pull-ups of the expander for PORTA pins function.
ctx | Click object |
mod_cmd | Module command. |
write_data | Pull up value. |
@description Function set pull-ups of the expander for PORTA pins by write 8-bit pull up value data to 8-bit register address from PORTA of MCP23S17 chip.
void expand_set_pull_ups_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | write_data ) |
Set pull-ups of the expander for PORTB pins function.
ctx | Click object |
mod_cmd | Module command. |
write_data | Pull up value. |
@description Function set pull-ups of the expander for PORTB pins by write 8-bit pull up value data to 8-bit register address from PORTB of MCP23S17 chip.
void expand_toggle_bit_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Toggle bit to register for PORTA function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bits mask. |
@description Function toggle bit from 8-bit register address from PORTA of MCP23S17 chip.
void expand_toggle_bit_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | bit_mask ) |
Toggle bit to register for PORTB function.
ctx | Click object. |
mod_cmd | Module command. |
bit_mask | Bits mask. |
@description Function toggle bit from 8-bit register address from PORTB of MCP23S17 chip.
void expand_toggle_bits | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | reg_addr, | ||
uint8_t | bit_mask ) |
Toggle register bits function.
ctx | Click object. |
mod_cmd | Module command. |
reg_addr | Register address. |
bit_mask | Bits mask. |
@description Function toggle bits from 8-bit register address of MCP23S17 chip.
void expand_write_byte | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | reg_addr, | ||
uint8_t | write_data ) |
Generic write one bayt to register function.
ctx | Click object. |
mod_cmd | Module command. |
reg_addr | Register address. |
write_data | Data to write to register. |
@description Function write 8-bit of data to 8-bit register address of MCP23S17 chip.
void expand_write_port_a | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | write_data ) |
Write one byte of data to register for PORTA function.
ctx | Click object. |
mod_cmd | Module command. |
write_data | Data to write. |
@description Function write 8-bit of data to 8-bit register address from PORTA of MCP23S17 chip.
void expand_write_port_b | ( | expand_t * | ctx, |
uint8_t | mod_cmd, | ||
uint8_t | write_data ) |
Write one byte of data to register for PORTB function.
ctx | Click object. |
mod_cmd | Module command. |
write_data | Data to write. |
@description Function write 8-bit of data to 8-bit register address from PORTB of MCP23S17 chip.