Lines Matching refs:addr
26 static int coil_rd(uint16_t addr, bool *state) in coil_rd() argument
28 if (addr >= ARRAY_SIZE(led_dev)) { in coil_rd()
32 if (coils_state & BIT(addr)) { in coil_rd()
38 LOG_INF("Coil read, addr %u, %d", addr, (int)*state); in coil_rd()
43 static int coil_wr(uint16_t addr, bool state) in coil_wr() argument
47 if (addr >= ARRAY_SIZE(led_dev)) { in coil_wr()
53 coils_state |= BIT(addr); in coil_wr()
56 coils_state &= ~BIT(addr); in coil_wr()
60 gpio_pin_set(led_dev[addr].port, led_dev[addr].pin, (int)on); in coil_wr()
62 LOG_INF("Coil write, addr %u, %d", addr, (int)state); in coil_wr()
67 static int holding_reg_rd(uint16_t addr, uint16_t *reg) in holding_reg_rd() argument
69 if (addr >= ARRAY_SIZE(holding_reg)) { in holding_reg_rd()
73 *reg = holding_reg[addr]; in holding_reg_rd()
75 LOG_INF("Holding register read, addr %u", addr); in holding_reg_rd()
80 static int holding_reg_wr(uint16_t addr, uint16_t reg) in holding_reg_wr() argument
82 if (addr >= ARRAY_SIZE(holding_reg)) { in holding_reg_wr()
86 holding_reg[addr] = reg; in holding_reg_wr()
88 LOG_INF("Holding register write, addr %u", addr); in holding_reg_wr()