| 418 | } |
| 419 | |
| 420 | owb_status owb_read_bytes(const OneWireBus * bus, uint8_t * buffer, unsigned int len) |
| 421 | { |
| 422 | owb_status status; |
| 423 | |
| 424 | if(!bus || !buffer) |
| 425 | { |
| 426 | status = OWB_STATUS_PARAMETER_NULL; |
| 427 | } else if (!_is_init(bus)) |
| 428 | { |
| 429 | status = OWB_STATUS_NOT_INITIALIZED; |
| 430 | } else |
| 431 | { |
| 432 | for (int i = 0; i < len; ++i) |
| 433 | { |
| 434 | uint8_t out; |
| 435 | bus->driver->read_bits(bus, &out, 8); |
| 436 | buffer[i] = out; |
| 437 | } |
| 438 | |
| 439 | status = OWB_STATUS_OK; |
| 440 | } |
| 441 | |
| 442 | return status; |
| 443 | } |
| 444 | |
| 445 | owb_status owb_write_bytes(const OneWireBus * bus, const uint8_t * buffer, unsigned int len) |
| 446 | { |
no test coverage detected