Go to the documentation of this file.
35 #include "mikrosdk_version.h"
38 #if mikroSDK_GET_VERSION < 20800ul
39 #include "rcu_delays.h"
45 #include "drv_digital_out.h"
46 #include "drv_digital_in.h"
47 #include "drv_one_wire.h"
69 #define EXPAND3_CMD_READ_PIO_REGISTERS 0xF0
70 #define EXPAND3_CMD_CHANNEL_ACCESS_READ 0xF5
71 #define EXPAND3_CMD_CHANNEL_ACCESS_WRITE 0x5A
72 #define EXPAND3_CMD_WRITE_CONDITIONAL 0xCC
73 #define EXPAND3_CMD_RESET_ACTIVITY_LATCHES 0xC3
79 #define EXPAND3_REG_PIO_LOGIC 0x0088
80 #define EXPAND3_REG_PIO_OUT_LATCH 0x0089
81 #define EXPAND3_REG_PIO_ACTIVITY_LATCH 0x008A
82 #define EXPAND3_REG_CHANNEL_MASK 0x008B
83 #define EXPAND3_REG_CHANNEL_POLARITY 0x008C
84 #define EXPAND3_REG_CONTROL 0x008D
102 #define EXPAND3_STATUS_VCCP 0x80
103 #define EXPAND3_CONTROL_PORL 0x08
104 #define EXPAND3_CONTROL_ROS 0x04
105 #define EXPAND3_CONTROL_CT 0x02
106 #define EXPAND3_CONTROL_PLS 0x01
107 #define EXPAND3_CONTROL_DEFAULT 0x00
108 #define EXPAND3_MASK_DEFAULT 0x00
109 #define EXPAND3_POLARITY_DEFAULT 0x00
115 #define EXPAND3_CONFIRMATION_BYTE 0xAA
121 #define EXPAND3_PIN_0 0x01
122 #define EXPAND3_PIN_1 0x02
123 #define EXPAND3_PIN_2 0x04
124 #define EXPAND3_PIN_3 0x08
125 #define EXPAND3_PIN_4 0x10
126 #define EXPAND3_PIN_5 0x20
127 #define EXPAND3_PIN_6 0x40
128 #define EXPAND3_PIN_7 0x80
134 #define EXPAND3_FAMILY_CODE 0x29
140 #define EXPAND3_ADDRESS_0 0x00
141 #define EXPAND3_ADDRESS_ALL 0xFF
159 #define EXPAND3_MAP_MIKROBUS( cfg, mikrobus ) \
160 cfg.ow0 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
161 cfg.ow1 = MIKROBUS( mikrobus, MIKROBUS_AN ); \
162 cfg.rst = MIKROBUS( mikrobus, MIKROBUS_RST );
pin_name_t ow0
Definition: expand3.h:202
one_wire_rom_address_t rom_addr
Definition: expand3.h:190
void expand3_set_rst_pin(expand3_t *ctx, uint8_t state)
Expand 3 set rst pin function.
Expand 3 Click configuration object.
Definition: expand3.h:200
void expand3_cfg_setup(expand3_cfg_t *cfg)
Expand 3 configuration object setup function.
err_t expand3_write_register(expand3_t *ctx, uint16_t reg, uint8_t data_in)
Expand 3 write register function.
@ EXPAND3_OK
Definition: expand3.h:218
err_t expand3_select_device(expand3_t *ctx)
Expand 3 select device function.
expand3_gpio_sel_t gpio_sel
Definition: expand3.h:208
pin_name_t rst
Definition: expand3.h:206
digital_out_t rst
Definition: expand3.h:185
Expand 3 Click context object.
Definition: expand3.h:183
one_wire_t ow
Definition: expand3.h:188
err_t expand3_read_state(expand3_t *ctx, uint8_t *state)
Expand 3 read state function.
void expand3_reset_device(expand3_t *ctx)
Expand 3 reset device function.
void expand3_gpio_selection(expand3_cfg_t *cfg, expand3_gpio_sel_t gpio_sel)
Expand 3 driver interface setup function.
err_t expand3_default_cfg(expand3_t *ctx)
Expand 3 default configuration function.
@ EXPAND3_GPIO_OW0
Definition: expand3.h:173
expand3_return_value_t
Expand 3 Click return value data.
Definition: expand3.h:217
err_t expand3_read_current_state(expand3_t *ctx, uint8_t *curr_state)
Expand 3 read current state function.
expand3_gpio_sel_t
Expand 3 Click gpio selector.
Definition: expand3.h:172
err_t expand3_write_control(expand3_t *ctx, uint8_t control)
Expand 3 write control function.
err_t expand3_read_activity(expand3_t *ctx, uint8_t *activity)
Expand 3 read activity function.
err_t expand3_init(expand3_t *ctx, expand3_cfg_t *cfg)
Expand 3 initialization function.
err_t expand3_write_state(expand3_t *ctx, uint8_t state)
Expand 3 write state function.
err_t expand3_read_register(expand3_t *ctx, uint16_t reg, uint8_t *data_out)
Expand 3 read register function.
err_t expand3_check_communication(expand3_t *ctx)
Expand 3 check communication function.
err_t expand3_write_mask(expand3_t *ctx, uint8_t mask)
Expand 3 write mask function.
pin_name_t ow1
Definition: expand3.h:203
err_t expand3_read_last_state(expand3_t *ctx, uint8_t *last_state)
Expand 3 read last state function.
@ EXPAND3_GPIO_OW1
Definition: expand3.h:174
err_t expand3_write_polarity(expand3_t *ctx, uint8_t polarity)
Expand 3 write polarity function.
@ EXPAND3_ERROR
Definition: expand3.h:219
uint8_t address
Definition: expand3.h:191
err_t expand3_reset_activity(expand3_t *ctx)
Expand 3 reset activity function.
err_t expand3_read_control(expand3_t *ctx, uint8_t *control)
Expand 3 read control function.