c1wireswitch 2.1.0.0
|
API for configuring and manipulating 1-Wire Switch Click driver. More...
Topics | |
1-Wire Switch Commands List | |
List of commands of 1-Wire Switch Click driver. | |
1-Wire Switch Settings | |
Settings of 1-Wire Switch Click driver. | |
1-Wire Switch MikroBUS Map | |
MikroBUS pin mapping of 1-Wire Switch Click driver. | |
Functions | |
void | c1wireswitch_cfg_setup (c1wireswitch_cfg_t *cfg) |
1-Wire Switch configuration object setup function. | |
void | c1wireswitch_gpio_selection (c1wireswitch_cfg_t *cfg, c1wireswitch_gpio_sel_t gpio_sel) |
1-Wire Switch driver interface setup function. | |
err_t | c1wireswitch_init (c1wireswitch_t *ctx, c1wireswitch_cfg_t *cfg) |
1-Wire Switch initialization function. | |
err_t | c1wireswitch_default_cfg (c1wireswitch_t *ctx) |
1-Wire Switch default configuration function. | |
err_t | c1wireswitch_check_communication (c1wireswitch_t *ctx) |
1-Wire Switch check communication function. | |
err_t | c1wireswitch_select_device (c1wireswitch_t *ctx) |
1-Wire Switch select device function. | |
err_t | c1wireswitch_read_scratchpad (c1wireswitch_t *ctx, uint8_t *scratchpad, uint8_t scratchpad_len) |
1-Wire Switch read scratchpad function. | |
err_t | c1wireswitch_write_scratchpad (c1wireswitch_t *ctx, uint8_t *scratchpad, uint8_t scratchpad_len) |
1-Wire Switch write scratchpad function. | |
err_t | c1wireswitch_write_pio (c1wireswitch_t *ctx, uint8_t state) |
1-Wire Switch write programmable I/O state function. | |
err_t | c1wireswitch_read_pio (c1wireswitch_t *ctx, uint8_t *state) |
1-Wire Switch read programmable I/O state function. | |
err_t | c1wireswitch_set_pio_state (c1wireswitch_t *ctx, uint8_t pio_a, uint8_t pio_b) |
1-Wire Switch write specific programmable I/O state function. | |
err_t | c1wireswitch_get_pio_state (c1wireswitch_t *ctx, uint8_t *pio_a, uint8_t *pio_b) |
1-Wire Switch read specific programmable I/O state function. | |
err_t | c1wireswitch_get_pio_latch_state (c1wireswitch_t *ctx, uint8_t *pio_a_latch, uint8_t *pio_b_latch) |
1-Wire Switch read programmable I/O latch state function. | |
API for configuring and manipulating 1-Wire Switch Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void c1wireswitch_cfg_setup | ( | c1wireswitch_cfg_t * | cfg | ) |
1-Wire Switch configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See c1wireswitch_cfg_t object definition for detailed explanation. |
err_t c1wireswitch_check_communication | ( | c1wireswitch_t * | ctx | ) |
1-Wire Switch check communication function.
This function checks the communication by reading the ROM address as well as verifying family code and Maxim CRC 8.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_default_cfg | ( | c1wireswitch_t * | ctx | ) |
1-Wire Switch default configuration function.
This function executes a default configuration of 1-Wire Switch click board.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_get_pio_latch_state | ( | c1wireswitch_t * | ctx, |
uint8_t * | pio_a_latch, | ||
uint8_t * | pio_b_latch ) |
1-Wire Switch read programmable I/O latch state function.
This function reads a programmable I/O latch state using One Wire communication protocol.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[out] | pio_a_latch | : State of the latch A. |
[out] | pio_b_latch | : State of the latch B. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_get_pio_state | ( | c1wireswitch_t * | ctx, |
uint8_t * | pio_a, | ||
uint8_t * | pio_b ) |
1-Wire Switch read specific programmable I/O state function.
This function reads a specific programmable I/O state using One Wire communication protocol.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[out] | pio_a | : State of the I/O A. |
[out] | pio_b | : State of the I/O B. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. void c1wireswitch_gpio_selection | ( | c1wireswitch_cfg_t * | cfg, |
c1wireswitch_gpio_sel_t | gpio_sel ) |
1-Wire Switch driver interface setup function.
This function sets a communication GPIO pin which will be used further in the click driver.
[out] | cfg | : Click configuration structure. See c1wireswitch_cfg_t object definition for detailed explanation. |
[in] | gpio_sel | : GPIO pin selection. See c1wireswitch_gpio_sel_t object definition for detailed explanation. |
err_t c1wireswitch_init | ( | c1wireswitch_t * | ctx, |
c1wireswitch_cfg_t * | cfg ) |
1-Wire Switch initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See c1wireswitch_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_read_pio | ( | c1wireswitch_t * | ctx, |
uint8_t * | state ) |
1-Wire Switch read programmable I/O state function.
This function reads a programmable I/O state using One Wire communication protocol.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[out] | state | : State of the I/O. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_read_scratchpad | ( | c1wireswitch_t * | ctx, |
uint8_t * | scratchpad, | ||
uint8_t | scratchpad_len ) |
1-Wire Switch read scratchpad function.
This function reads a desired number of scratchpad bytes using One Wire communication protocol.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[out] | scratchpad | : Output read scratchpad. |
[in] | scratchpad_len | : Scratchpad length in bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_select_device | ( | c1wireswitch_t * | ctx | ) |
1-Wire Switch select device function.
This function selects the device by performing a skip or match ROM commands depending on the address value set in the ctx->address.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_set_pio_state | ( | c1wireswitch_t * | ctx, |
uint8_t | pio_a, | ||
uint8_t | pio_b ) |
1-Wire Switch write specific programmable I/O state function.
This function writes a specific programmable I/O state using One Wire communication protocol.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[in] | pio_a | : State of the PIO A to be written. |
[in] | pio_b | : State of the PIO B to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_write_pio | ( | c1wireswitch_t * | ctx, |
uint8_t | state ) |
1-Wire Switch write programmable I/O state function.
This function writes a programmable I/O state using One Wire communication protocol.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[in] | state | : State to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c1wireswitch_write_scratchpad | ( | c1wireswitch_t * | ctx, |
uint8_t * | scratchpad, | ||
uint8_t | scratchpad_len ) |
1-Wire Switch write scratchpad function.
This function writes a desired number of scratchpad bytes using One Wire communication protocol.
[in] | ctx | : Click context object. See c1wireswitch_t object definition for detailed explanation. |
[in] | scratchpad | : Scratchpad to be written. |
[in] | scratchpad_len | : Scratchpad length in bytes. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.