expand7 2.0.0.0
|
Functions | |
void | expand7_cfg_setup (expand7_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | expand7_init (expand7_t *ctx, expand7_cfg_t *cfg) |
Initialization function. | |
void | expand7_generic_write (expand7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic write function. | |
void | expand7_generic_read (expand7_t *ctx, uint8_t reg, uint8_t *data_buf, uint8_t len) |
Generic read function. | |
void | expand7_write_byte (expand7_t *ctx, uint8_t reg_adr, uint8_t wr_data) |
Write byte function. | |
uint8_t | expand7_read_byte (expand7_t *ctx, uint8_t reg_adr) |
Read byte function. | |
void | expand7_write_port_exp (expand7_t *ctx, uint8_t reg, uint8_t *buf, uint8_t len) |
Port Expander Write function. | |
void | expand7_read_port_exp (expand7_t *ctx, uint8_t reg, uint8_t *buf, uint8_t len) |
Port Expander Read function. | |
void | expand7_send_eeprom_cmd (expand7_t *ctx, uint8_t cmd) |
Send Command function. | |
void | expand7_write_eeprom (expand7_t *ctx, uint16_t mem_adr, uint8_t *buf, uint8_t len) |
EEPROM Write function. | |
void | expand7_read_eeprom (expand7_t *ctx, uint16_t mem_adr, uint8_t *buf, uint8_t len) |
EEPROM Read function. | |
uint8_t | expand7_read_bit (expand7_t *ctx, uint8_t reg_adr, uint8_t bit_num) |
Read bit function. | |
void | expand7_write_bit (expand7_t *ctx, uint8_t reg_adr, uint8_t bit_num, uint8_t pin_val) |
Write bit function. | |
uint8_t | expand7_read_pin (expand7_t *ctx, uint8_t pin, uint8_t inv) |
Get a single INPUT pin's logic level function. | |
uint8_t | expand7_read_port (expand7_t *ctx, uint8_t port, uint8_t inv) |
Get all pin logic levels from one port function. | |
uint8_t | expand7_get_pin_out_lvl (expand7_t *ctx, uint8_t pin) |
Get a single OUTPUT pin's setting function. | |
uint8_t | expand7_get_port_out_lvl (expand7_t *ctx, uint8_t port) |
Get all pin output settings from one port function. | |
void | expand7_write_pin (expand7_t *ctx, uint8_t pin, uint8_t pin_val) |
Set a single OUTPUT pin's logic level function. | |
void | expand7_write_port (expand7_t *ctx, uint8_t port, uint8_t value) |
Set all OUTPUT pins' logic levels in one port function. | |
void | expand7_write_all (expand7_t *ctx, uint8_t value) |
Set all OUTPUT pins' logic levels function. | |
void | expand7_sel_pwm_pin (expand7_t *ctx, uint8_t pin, uint8_t pwm_en) |
Select a PWM output pin function. | |
void | expand7_pwm_cfg (expand7_t *ctx, expand7_pwm_cfg_t pwm_cfg, float *duty_cyc, float *freq) |
PWM Configuration function. | |
void | expand7_eeprom_enable (expand7_t *ctx, uint8_t cmd) |
Enable Register Configuration function. | |
void | expand7_reset (expand7_t *ctx) |
Reset function. | |
uint8_t | expand7_check_int (expand7_t *ctx) |
Get Interrupt state function. | |
void expand7_cfg_setup | ( | expand7_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
This function initializes click configuration structure to init state.
uint8_t expand7_check_int | ( | expand7_t * | ctx | ) |
Get Interrupt state function.
ctx | Click object. |
Function is used to check if an interrupt has occured.
void expand7_eeprom_enable | ( | expand7_t * | ctx, |
uint8_t | cmd ) |
Enable Register Configuration function.
ctx | Click object. |
cmd | value that represents input data to Enable Register |
Function is used to write to Enable Register.
void expand7_generic_read | ( | expand7_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 |
This function reads data from the desired register.
void expand7_generic_write | ( | expand7_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. |
This function writes data to the desired register.
uint8_t expand7_get_pin_out_lvl | ( | expand7_t * | ctx, |
uint8_t | pin ) |
Get a single OUTPUT pin's setting function.
ctx | Click object. |
pin | 8-bit value that defines the specific pin |
Function is used to get a single OUTPUT pin's setting.
uint8_t expand7_get_port_out_lvl | ( | expand7_t * | ctx, |
uint8_t | port ) |
Get all pin output settings from one port function.
ctx | Click object. |
port | 8-bit value that defines the port |
Function is used to get all pin output settings from one port.
err_t expand7_init | ( | expand7_t * | ctx, |
expand7_cfg_t * | cfg ) |
Initialization function.
expand7 | Click object. |
cfg | Click configuration structure. |
This function initializes all necessary pins and peripherals used for this click.
void expand7_pwm_cfg | ( | expand7_t * | ctx, |
expand7_pwm_cfg_t | pwm_cfg, | ||
float * | duty_cyc, | ||
float * | freq ) |
PWM Configuration function.
ctx | Click object. |
expand7_pwm_cfg_t | structure where PWM Configuration data are stored. |
duty_cyc | float value representing PWM duty cycle |
freq | float value representing output frequency |
Function is used to configure PWM output.
uint8_t expand7_read_bit | ( | expand7_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 expand7_read_byte | ( | expand7_t * | ctx, |
uint8_t | reg_adr ) |
Read byte function.
ctx | Click object. |
reg_adr | 8-bit value that defines the register |
Function is used to read single byte of data from user defined register.
void expand7_read_eeprom | ( | expand7_t * | ctx, |
uint16_t | mem_adr, | ||
uint8_t * | buf, | ||
uint8_t | len ) |
EEPROM Read function.
ctx | Click object. |
reg | 8-bit register address |
buf | 8-bit read data |
len | 8-bit number of bytes |
Reads user defined number of bytes from EEPROM defined by 8-bit address
uint8_t expand7_read_pin | ( | expand7_t * | ctx, |
uint8_t | pin, | ||
uint8_t | inv ) |
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.
uint8_t expand7_read_port | ( | expand7_t * | ctx, |
uint8_t | port, | ||
uint8_t | inv ) |
Get all pin logic levels from one port function.
ctx | Click object. |
port | 8-bit value that defines the port |
Function is used to read the states of pins in selected port.
void expand7_read_port_exp | ( | expand7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | buf, | ||
uint8_t | len ) |
Port Expander Read function.
ctx | Click object. |
reg | 8-bit register address |
buf | 8-bit read data |
len | 8-bit number of bytes |
Reads user defined number of bytes from registers defined by 8-bit register address
void expand7_reset | ( | expand7_t * | ctx | ) |
Reset function.
ctx | Click object. |
Function is used to reset the device.
void expand7_sel_pwm_pin | ( | expand7_t * | ctx, |
uint8_t | pin, | ||
uint8_t | pwm_en ) |
Select a PWM output pin function.
ctx | Click object. |
port | 8-bit value that defines PWM output pin. |
value | 8-bit value that enables or disables PWM output (0 or 1 for each pin). |
Function is used to enable or disable PWM output on a specific pin.
void expand7_send_eeprom_cmd | ( | expand7_t * | ctx, |
uint8_t | cmd ) |
Send Command function.
ctx | Click object. |
cmd | 8-bit value that defines the command |
Function is used to send the command to Command Register.
void expand7_write_all | ( | expand7_t * | ctx, |
uint8_t | value ) |
Set all OUTPUT pins' logic levels function.
ctx | Click object. |
value | 8-bit value that defines pins' output logic level (0 or 1 for each pin). |
Function is used to set logic levels of all ouptut pins.
void expand7_write_bit | ( | expand7_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 expand7_write_byte | ( | expand7_t * | ctx, |
uint8_t | reg_adr, | ||
uint8_t | wr_data ) |
Write byte function.
ctx | Click object. |
reg_adr | 8-bit value that defines the register |
wr_data | 8-bit value that defines the input data |
Function is used to write single byte of data into user defined register.
void expand7_write_eeprom | ( | expand7_t * | ctx, |
uint16_t | mem_adr, | ||
uint8_t * | buf, | ||
uint8_t | len ) |
EEPROM Write function.
ctx | Click object. |
reg | 8-bit register address |
wr_data | 8-bit write data |
len | 8-bit number of bytes |
Writes user defined number of bytes into EEPROM defined by 8-bit address
void expand7_write_pin | ( | expand7_t * | ctx, |
uint8_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.
void expand7_write_port | ( | expand7_t * | ctx, |
uint8_t | port, | ||
uint8_t | value ) |
Set all OUTPUT pins' logic levels in one port function.
ctx | Click object. |
port | 8-bit value that defines which port to write to. |
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 port.
void expand7_write_port_exp | ( | expand7_t * | ctx, |
uint8_t | reg, | ||
uint8_t * | buf, | ||
uint8_t | len ) |
Port Expander Write function.
ctx | Click object. |
reg | 8-bit register address |
buf | 8-bit write data |
len | 8-bit number of bytes |
Writes user defined number of bytes into registers defined by 8-bit register address