expand5 2.0.0.0
|
Functions | |
void | expand5_cfg_setup (expand5_cfg_t *cfg) |
Config Object Initialization function. | |
EXPAND5_RETVAL | expand5_init (expand5_t *ctx, expand5_cfg_t *cfg) |
Initialization function. | |
void | expand5_generic_write (expand5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | expand5_generic_read (expand5_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
uint8_t | expand5_read_bit (expand5_t *ctx, uint8_t reg_adr, uint8_t bit_num) |
Read bit function. | |
void | expand5_write_bit (expand5_t *ctx, uint8_t reg_adr, uint8_t bit_num, uint8_t pin_val) |
Write bit function. | |
uint8_t | expand5_read_pin (expand5_t *ctx, uint16_t pin) |
Get a single INPUT pin's logic level function. | |
uint8_t | expand5_read_bank (expand5_t *ctx, uint8_t bank) |
Get all pin logic levels from one bank function. | |
void | expand5_read_all_banks (expand5_t *ctx, uint8_t *bank0, uint8_t *bank1, uint8_t *bank2) |
Get all pins logic levels from all banks function. | |
uint8_t | expand5_get_pin_out_lvl (expand5_t *ctx, uint16_t pin) |
Get a single OUTPUT pin's setting function. | |
uint8_t | expand5_get_bank_out_lvl (expand5_t *ctx, uint8_t bank) |
Get all pin output settings from one bank function. | |
void | expand5_get_all_banks_out_lvl (expand5_t *ctx, uint8_t *bank0, uint8_t *bank1, uint8_t *bank2) |
Get all pin output settings from all banks function. | |
void | expand5_write_pin (expand5_t *ctx, uint16_t pin, uint8_t pin_val) |
Set a single OUTPUT pin's logic level function. | |
void | expand5_write_bank (expand5_t *ctx, uint8_t bank, uint8_t value) |
Set all OUTPUT pins' logic levels in one bank function. | |
void | expand5_write_all_banks (expand5_t *ctx, uint8_t bank0, uint8_t bank1, uint8_t bank2) |
Set all OUTPUT pins' logic levels in all banks function. | |
uint8_t | expand5_get_pin_pol (expand5_t *ctx, uint16_t pin) |
Get a single pin's polarity ( normal/inverted ) setting function. | |
uint8_t | expand5_get_bank_pol (expand5_t *ctx, uint8_t bank) |
Get all pin polarity ( normal/inverted ) settings from one bank function. | |
void | expand5_get_all_banks_pol (expand5_t *ctx, uint8_t *bank0, uint8_t *bank1, uint8_t *bank2) |
Get all pin polarity ( normal/inverted ) settings from all banks function. | |
void | expand5_set_pin_pol (expand5_t *ctx, uint16_t pin, uint8_t polarity) |
Set a single pin's polarity ( normal/inverted ) setting function. | |
void | expand5_set_bank_pol (expand5_t *ctx, uint8_t bank, uint8_t polarity) |
Set all pin polarity ( normal/inverted ) settings in one bank function. | |
void | expand5_set_all_banks_pol (expand5_t *ctx, uint8_t bank0, uint8_t bank1, uint8_t bank2) |
Set all pin polarity ( normal/inverted ) settings in all banks function. | |
uint8_t | expand5_get_pin_dir (expand5_t *ctx, uint16_t pin) |
Get a single pin's direction ( I/O ) setting function. | |
uint8_t | expand5_get_bank_dir (expand5_t *ctx, uint8_t bank) |
Get all pin direction ( I/O ) settings from one bank function. | |
void | expand5_get_all_dir (expand5_t *ctx, uint8_t *bank0, uint8_t *bank1, uint8_t *bank2) |
Get all pin direction ( I/O ) settings from all banks function. | |
void | expand5_set_pin_dir (expand5_t *ctx, uint16_t pin, uint8_t direction) |
Set a single pin's direction ( I/O ) setting function. | |
void | expand5_set_bank_dir (expand5_t *ctx, uint8_t bank, uint8_t direction) |
Set all pin direction ( I/O ) settings in one bank function. | |
void | expand5_set_all_dir (expand5_t *ctx, uint8_t bank0, uint8_t bank1, uint8_t bank2) |
Set all pin direction ( I/O ) settings in all banks function. | |
void | expand5_reset (expand5_t *ctx) |
Reset function. | |
uint8_t | expand5_check_int (expand5_t *ctx) |
Get Interrupt state function. | |
void expand5_cfg_setup | ( | expand5_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
uint8_t expand5_check_int | ( | expand5_t * | ctx | ) |
Get Interrupt state function.
ctx | Click object. |
Function is used to check if an interrupt has occured.
void expand5_generic_read | ( | expand5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic read function.
ctx | Click object. |
reg | Register address. |
data_buf | Output data buf |
len | Number of the bytes to be read |
@description This function reads data from the desired register.
void expand5_generic_write | ( | expand5_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | data_buf, | ||
uint8_t | len ) |
Generic write function.
ctx | Click object. |
reg | Register address. |
data_buf | Data buf to be written. |
len | Number of the bytes in data buf. |
@description This function writes data to the desired register.
void expand5_get_all_banks_out_lvl | ( | expand5_t * | ctx, |
uint8_t * | bank0, | ||
uint8_t * | bank1, | ||
uint8_t * | bank2 ) |
Get all pin output settings from all banks function.
ctx | Click object. |
bank0 | 8-bit value that represents the pin output setting of the first bank |
bank1 | 8-bit value that represents the pin output setting of the second bank |
bank2 | 8-bit value that represents the pin output setting of the third bank |
Function is used to get all pin output settings from all banks.
void expand5_get_all_banks_pol | ( | expand5_t * | ctx, |
uint8_t * | bank0, | ||
uint8_t * | bank1, | ||
uint8_t * | bank2 ) |
Get all pin polarity ( normal/inverted ) settings from all banks function.
ctx | Click object. |
bank0 | 8-bit value that represents the pin polarity settings of the first bank |
bank1 | 8-bit value that represents the pin polarity settings of the second bank |
bank2 | 8-bit value that represents the pin polarity settings of the third bank |
Function is used to get polarity settings from all banks.
void expand5_get_all_dir | ( | expand5_t * | ctx, |
uint8_t * | bank0, | ||
uint8_t * | bank1, | ||
uint8_t * | bank2 ) |
Get all pin direction ( I/O ) settings from all banks function.
ctx | Click object. |
bank0 | 8-bit value that represents pins' direction settings of the first bank |
bank1 | 8-bit value that represents pins' direction settings of the second bank |
bank2 | 8-bit value that represents pins' direction settings of the third bank |
Function is used to get all pins direction settings from all banks.
uint8_t expand5_get_bank_dir | ( | expand5_t * | ctx, |
uint8_t | bank ) |
Get all pin direction ( I/O ) settings from one bank function.
ctx | Click object. |
bank | 8-bit value that defines which bank to read ( 0/1/2 for P0*, P1*, P2* respectively ) |
Function is used to get all pins direction settings from one bank.
uint8_t expand5_get_bank_out_lvl | ( | expand5_t * | ctx, |
uint8_t | bank ) |
Get all pin output settings from one bank function.
ctx | Click object. |
bank | 8-bit value that defines the bank |
Function is used to get all pin output settings from one bank.
uint8_t expand5_get_bank_pol | ( | expand5_t * | ctx, |
uint8_t | bank ) |
Get all pin polarity ( normal/inverted ) settings from one bank function.
ctx | Click object. |
bank | 8-bit value that defines which bank to read ( 0/1/2 for P0*, P1*, P2* respectively ) |
Function is used to get polarity settings from one bank.
uint8_t expand5_get_pin_dir | ( | expand5_t * | ctx, |
uint16_t | pin ) |
Get a single pin's direction ( I/O ) setting function.
ctx | Click object. |
pin | 16-bit value that defines the specific pin |
Function is used to get a single pin's direction ( I/O ) setting.
uint8_t expand5_get_pin_out_lvl | ( | expand5_t * | ctx, |
uint16_t | pin ) |
Get a single OUTPUT pin's setting function.
ctx | Click object. |
pin | 16-bit value that defines the specific pin |
Function is used to get a single OUTPUT pin's setting.
uint8_t expand5_get_pin_pol | ( | expand5_t * | ctx, |
uint16_t | pin ) |
Get a single pin's polarity ( normal/inverted ) setting function.
ctx | Click object. |
pin | 16-bit value that defines the specific pin |
Function is used to get a single pin's polarity.
EXPAND5_RETVAL expand5_init | ( | expand5_t * | ctx, |
expand5_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void expand5_read_all_banks | ( | expand5_t * | ctx, |
uint8_t * | bank0, | ||
uint8_t * | bank1, | ||
uint8_t * | bank2 ) |
Get all pins logic levels from all banks function.
ctx | Click object. |
bank0 | 8-bit value that represents the states of pins in first bank |
bank1 | 8-bit value that represents the states of pins in second bank |
bank2 | 8-bit value that represents the states of pins in third bank |
Function is used to read the states of pins in all banks.
uint8_t expand5_read_bank | ( | expand5_t * | ctx, |
uint8_t | bank ) |
Get all pin logic levels from one bank function.
ctx | Click object. |
bank | 8-bit value that defines the bank |
Function is used to read the states of pins in selected bank.
uint8_t expand5_read_bit | ( | expand5_t * | ctx, |
uint8_t | reg_adr, | ||
uint8_t | bit_num ) |
Read bit function.
ctx | Click object. |
reg_adr | 8-bit value that defines the register |
bit_num | 8-bit value that defines the specific bit |
Function is used to read state of a single bit of data from user defined register.
uint8_t expand5_read_pin | ( | expand5_t * | ctx, |
uint16_t | pin ) |
Get a single INPUT pin's logic level function.
ctx | Click object. |
pin | 16-bit value that defines the specific pin |
Function is used to read the state of a defined pin.
void expand5_reset | ( | expand5_t * | ctx | ) |
Reset function.
ctx | Click object. |
Function is used to reset the device.
void expand5_set_all_banks_pol | ( | expand5_t * | ctx, |
uint8_t | bank0, | ||
uint8_t | bank1, | ||
uint8_t | bank2 ) |
Set all pin polarity ( normal/inverted ) settings in all banks function.
ctx | Click object. |
bank0 | 8-bit value that defines the new pin polarity settings of the first bank |
bank1 | 8-bit value that defines the new pin polarity settings of the second bank |
bank2 | 8-bit value that defines the new pin polarity settings of the third bank |
Function is used to set a pin polarity settings in all banks.
void expand5_set_all_dir | ( | expand5_t * | ctx, |
uint8_t | bank0, | ||
uint8_t | bank1, | ||
uint8_t | bank2 ) |
Set all pin direction ( I/O ) settings in all banks function.
ctx | Click object. |
bank0 | 8-bit value that defines pins' new direction settings of the first bank |
bank1 | 8-bit value that defines pins' new direction settings of the second bank |
bank2 | 8-bit value that defines pins' new direction settings of the third bank |
Function is used to set pins' direction ( I/O ) setting in all banks.
void expand5_set_bank_dir | ( | expand5_t * | ctx, |
uint8_t | bank, | ||
uint8_t | direction ) |
Set all pin direction ( I/O ) settings in one bank function.
ctx | Click object. |
bank | 8-bit value that defines which bank to write to ( 0/1/2 for P0*, P1*, P2* respectively ) |
direction | pins' direction settings (0 or 1) for each pin. |
Function is used to set pins' direction ( I/O ) setting in one bank.
void expand5_set_bank_pol | ( | expand5_t * | ctx, |
uint8_t | bank, | ||
uint8_t | polarity ) |
Set all pin polarity ( normal/inverted ) settings in one bank function.
ctx | Click object. |
bank | 8-bit value that defines which bank to write to (0/1/2 for P0*, P1*, P2* respectively) |
polarity | 8-bit value that defines new pins' polarity settings (0 or 1 for each pin) |
Function is used to set a pin polarity settings in one bank.
void expand5_set_pin_dir | ( | expand5_t * | ctx, |
uint16_t | pin, | ||
uint8_t | direction ) |
Set a single pin's direction ( I/O ) setting function.
ctx | Click object. |
pin | 16-bit value that defines the specific pin |
direction | pin's direction setting (0 or 1) |
Function is used to set a single pin's direction ( I/O ) setting.
void expand5_set_pin_pol | ( | expand5_t * | ctx, |
uint16_t | pin, | ||
uint8_t | polarity ) |
Set a single pin's polarity ( normal/inverted ) setting function.
ctx | Click object. |
pin | 16-bit value that defines the specific pin |
polarity | pin polarity setting (0 or 1) |
Function is used to set a single pin's polarity.
void expand5_write_all_banks | ( | expand5_t * | ctx, |
uint8_t | bank0, | ||
uint8_t | bank1, | ||
uint8_t | bank2 ) |
Set all OUTPUT pins' logic levels in all banks function.
ctx | Click object. |
bank0 | 8-bit value that defines the first bank's new logic values |
bank1 | 8-bit value that defines the second bank's new logic values |
bank2 | 8-bit value that defines the third bank's new logic values |
Function is used to set logic levels in all banks.
void expand5_write_bank | ( | expand5_t * | ctx, |
uint8_t | bank, | ||
uint8_t | value ) |
Set all OUTPUT pins' logic levels in one bank function.
ctx | Click object. |
bank | 8-bit value that defines which bank to write to ( 0/1/2 for P0*, P1*, P2* respectively ) |
value | 8-bit value that defines pins' output logic level (0 or 1 for each pin). |
Function is used to set logic levels in one bank.
void expand5_write_bit | ( | expand5_t * | ctx, |
uint8_t | reg_adr, | ||
uint8_t | bit_num, | ||
uint8_t | pin_val ) |
Write bit function.
ctx | Click object. |
reg_adr | 8-bit value that defines the register |
bit_num | 8-bit value that defines the specific bit |
pin_val | 8-bit value that defines the specific bit's value |
Function is used to set or clear the specific bit.
void expand5_write_pin | ( | expand5_t * | ctx, |
uint16_t | pin, | ||
uint8_t | pin_val ) |
Set a single OUTPUT pin's logic level function.
ctx | Click object. |
pin | 8-bit value that defines the specific pin |
pin_val | 8-bit value that defines the specific pin's value |
Function is used to set a single output pin's logic level.