Lines Matching +full:read +full:- +full:cmd

4  * SPDX-License-Identifier: Apache-2.0
50 * +-+-+-+-+-+-+-+-+-+-+-+
52 * +-+-+-+-+-+-+-+-+-+-+-+
65 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
69 * Byte Read
73 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
82 * by read or write one byte.
89 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
91 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
93 * Byte Data Read
97 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
99 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
100 * | Data Read |N|P|
101 * +-+-+-+-+-+-+-+-+-+-+
108 * by read or write two bytes.
115 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
117 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
119 * +-+-+-+-+-+-+-+-+-+-+
121 * Word Data Read
125 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
127 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
128 * |A| Data Read Low |A| Data Read Hi |N|P|
129 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
136 * Read Word. It is named so because the command sends data and waits
142 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
144 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
145 * | Data Write Hi |A|S| Periph Addr |R|A| Data Read Low |A|
146 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
147 * | Data Read Hi |N|P|
148 * +-+-+-+-+-+-+-+-+-+-+
163 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
165 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
167 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
169 * SMBus Block Read
173 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
175 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
176 * |A| Recv Count=N |A| Data Read 1 |A| ... |A|
177 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
178 * | Data Read N |N|P|
179 * +-+-+-+-+-+-+-+-+-+-+
185 * SMBus Block Write - Block Read Process Call protocol is
186 * Block Write followed by Block Read.
191 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
193 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
195 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
196 * | Periph Addr |R|A| Recv Count=N |A| Data Read 1 |A| |
197 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
198 * | ... |A| Data Read N |N|P|
199 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
247 * @name SMBus read / write direction
251 /** @brief SMBus read / write direction */
255 /** Read a message from SMBus peripheral */
352 uint16_t addr, uint8_t cmd,
355 uint16_t addr, uint8_t cmd,
358 uint16_t addr, uint8_t cmd,
361 uint16_t addr, uint8_t cmd,
364 uint16_t addr, uint8_t cmd,
367 uint16_t addr, uint8_t cmd,
370 uint16_t addr, uint8_t cmd,
373 uint16_t addr, uint8_t cmd,
446 CONTAINER_OF(dev->state, \
449 stats_init(&state->stats.s_hdr, STATS_SIZE_32, 4, \
451 stats_register(dev->name, &(state->stats.s_hdr)); \
469 CONTAINER_OF(dev->state, struct smbus_device_state, devstate); in smbus_xfer_stats()
471 STATS_INC(state->stats, command_count); in smbus_xfer_stats()
472 STATS_INCN(state->stats, bytes_read, recv); in smbus_xfer_stats()
473 STATS_INCN(state->stats, bytes_written, sent); in smbus_xfer_stats()
555 * @param dev_config Bit-packed 32-bit value to the device runtime configuration
559 * @retval -EIO General input / output error.
567 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_configure()
569 return api->configure(dev, dev_config); in z_impl_smbus_configure()
584 * @param dev_config Pointer to return bit-packed 32-bit value of
588 * @retval -EIO General input / output error.
589 * @retval -ENOSYS If function smbus_get_config() is not implemented
598 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_get_config()
600 if (api->get_config == NULL) { in z_impl_smbus_get_config()
601 return -ENOSYS; in z_impl_smbus_get_config()
604 return api->get_config(dev, dev_config); in z_impl_smbus_get_config()
614 * @retval -EIO General input / output error.
615 * @retval -ENOSYS If function smbus_smbalert_set_cb() is not implemented
622 (const struct smbus_driver_api *)dev->api; in smbus_smbalert_set_cb()
624 if (api->smbus_smbalert_set_cb == NULL) { in smbus_smbalert_set_cb()
625 return -ENOSYS; in smbus_smbalert_set_cb()
628 return api->smbus_smbalert_set_cb(dev, cb); in smbus_smbalert_set_cb()
638 * @retval -EIO General input / output error.
639 * @retval -ENOSYS If function smbus_smbalert_remove_cb() is not implemented
649 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_smbalert_remove_cb()
651 if (api->smbus_smbalert_remove_cb == NULL) { in z_impl_smbus_smbalert_remove_cb()
652 return -ENOSYS; in z_impl_smbus_smbalert_remove_cb()
655 return api->smbus_smbalert_remove_cb(dev, cb); in z_impl_smbus_smbalert_remove_cb()
665 * @retval -EIO General input / output error.
666 * @retval -ENOSYS If function smbus_host_notify_set_cb() is not implemented
673 (const struct smbus_driver_api *)dev->api; in smbus_host_notify_set_cb()
675 if (api->smbus_host_notify_set_cb == NULL) { in smbus_host_notify_set_cb()
676 return -ENOSYS; in smbus_host_notify_set_cb()
679 return api->smbus_host_notify_set_cb(dev, cb); in smbus_host_notify_set_cb()
689 * @retval -EIO General input / output error.
690 * @retval -ENOSYS If function smbus_host_notify_remove_cb() is not implemented
700 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_host_notify_remove_cb()
702 if (api->smbus_host_notify_remove_cb == NULL) { in z_impl_smbus_host_notify_remove_cb()
703 return -ENOSYS; in z_impl_smbus_host_notify_remove_cb()
706 return api->smbus_host_notify_remove_cb(dev, cb); in z_impl_smbus_host_notify_remove_cb()
718 * @param direction Direction Read or Write.
721 * @retval -EIO General input / output error.
722 * @retval -ENOSYS If function smbus_quick() is not implemented
732 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_quick()
734 if (api->smbus_quick == NULL) { in z_impl_smbus_quick()
735 return -ENOSYS; in z_impl_smbus_quick()
739 return -EINVAL; in z_impl_smbus_quick()
742 return api->smbus_quick(dev, addr, direction); in z_impl_smbus_quick()
756 * @retval -EIO General input / output error.
757 * @retval -ENOSYS If function smbus_byte_write() is not implemented
767 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_byte_write()
769 if (api->smbus_byte_write == NULL) { in z_impl_smbus_byte_write()
770 return -ENOSYS; in z_impl_smbus_byte_write()
773 return api->smbus_byte_write(dev, addr, byte); in z_impl_smbus_byte_write()
777 * @brief Perform SMBus Byte Read operation
780 * Byte Read operation.
787 * @retval -EIO General input / output error.
788 * @retval -ENOSYS If function smbus_byte_read() is not implemented
798 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_byte_read()
800 if (api->smbus_byte_read == NULL) { in z_impl_smbus_byte_read()
801 return -ENOSYS; in z_impl_smbus_byte_read()
804 return api->smbus_byte_read(dev, addr, byte); in z_impl_smbus_byte_read()
815 * @param cmd Command byte which is sent to peripheral device first.
819 * @retval -EIO General input / output error.
820 * @retval -ENOSYS If function smbus_byte_data_write() is not implemented
824 uint8_t cmd, uint8_t byte);
827 uint16_t addr, uint8_t cmd, in z_impl_smbus_byte_data_write() argument
831 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_byte_data_write()
833 if (api->smbus_byte_data_write == NULL) { in z_impl_smbus_byte_data_write()
834 return -ENOSYS; in z_impl_smbus_byte_data_write()
837 return api->smbus_byte_data_write(dev, addr, cmd, byte); in z_impl_smbus_byte_data_write()
841 * @brief Perform SMBus Byte Data Read operation
844 * Byte Data Read operation.
848 * @param cmd Command byte which is sent to peripheral device first.
852 * @retval -EIO General input / output error.
853 * @retval -ENOSYS If function smbus_byte_data_read() is not implemented
857 uint8_t cmd, uint8_t *byte);
860 uint16_t addr, uint8_t cmd, in z_impl_smbus_byte_data_read() argument
864 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_byte_data_read()
866 if (api->smbus_byte_data_read == NULL) { in z_impl_smbus_byte_data_read()
867 return -ENOSYS; in z_impl_smbus_byte_data_read()
870 return api->smbus_byte_data_read(dev, addr, cmd, byte); in z_impl_smbus_byte_data_read()
881 * @param cmd Command byte which is sent to peripheral device first.
882 * @param word Word (16-bit) to be sent to the peripheral device.
885 * @retval -EIO General input / output error.
886 * @retval -ENOSYS If function smbus_word_data_write() is not implemented
890 uint8_t cmd, uint16_t word);
893 uint16_t addr, uint8_t cmd, in z_impl_smbus_word_data_write() argument
897 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_word_data_write()
899 if (api->smbus_word_data_write == NULL) { in z_impl_smbus_word_data_write()
900 return -ENOSYS; in z_impl_smbus_word_data_write()
903 return api->smbus_word_data_write(dev, addr, cmd, word); in z_impl_smbus_word_data_write()
907 * @brief Perform SMBus Word Data Read operation
910 * Word Data Read operation.
914 * @param cmd Command byte which is sent to peripheral device first.
915 * @param word Word (16-bit) received from the peripheral device.
918 * @retval -EIO General input / output error.
919 * @retval -ENOSYS If function smbus_word_data_read() is not implemented
923 uint8_t cmd, uint16_t *word);
926 uint16_t addr, uint8_t cmd, in z_impl_smbus_word_data_read() argument
930 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_word_data_read()
932 if (api->smbus_word_data_read == NULL) { in z_impl_smbus_word_data_read()
933 return -ENOSYS; in z_impl_smbus_word_data_read()
936 return api->smbus_word_data_read(dev, addr, cmd, word); in z_impl_smbus_word_data_read()
944 * Read 2 bytes.
948 * @param cmd Command byte which is sent to peripheral device first.
949 * @param send_word Word (16-bit) to be sent to the peripheral device.
950 * @param recv_word Word (16-bit) received from the peripheral device.
953 * @retval -EIO General input / output error.
954 * @retval -ENOSYS If function smbus_pcall() is not implemented
958 uint8_t cmd, uint16_t send_word, uint16_t *recv_word);
961 uint16_t addr, uint8_t cmd, in z_impl_smbus_pcall() argument
965 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_pcall()
967 if (api->smbus_pcall == NULL) { in z_impl_smbus_pcall()
968 return -ENOSYS; in z_impl_smbus_pcall()
971 return api->smbus_pcall(dev, addr, cmd, send_word, recv_word); in z_impl_smbus_pcall()
982 * @param cmd Command byte which is sent to peripheral device first.
987 * @retval -EIO General input / output error.
988 * @retval -ENOSYS If function smbus_block_write() is not implemented
992 uint8_t cmd, uint8_t count, uint8_t *buf);
995 uint16_t addr, uint8_t cmd, in z_impl_smbus_block_write() argument
999 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_block_write()
1001 if (api->smbus_block_write == NULL) { in z_impl_smbus_block_write()
1002 return -ENOSYS; in z_impl_smbus_block_write()
1006 return -EINVAL; in z_impl_smbus_block_write()
1009 return api->smbus_block_write(dev, addr, cmd, count, buf); in z_impl_smbus_block_write()
1013 * @brief Perform SMBus Block Read operation
1016 * Block Read operation.
1020 * @param cmd Command byte which is sent to peripheral device first.
1025 * @retval -EIO General input / output error.
1026 * @retval -ENOSYS If function smbus_block_read() is not implemented
1030 uint8_t cmd, uint8_t *count, uint8_t *buf);
1033 uint16_t addr, uint8_t cmd, in z_impl_smbus_block_read() argument
1037 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_block_read()
1039 if (api->smbus_block_read == NULL) { in z_impl_smbus_block_read()
1040 return -ENOSYS; in z_impl_smbus_block_read()
1043 return api->smbus_block_read(dev, addr, cmd, count, buf); in z_impl_smbus_block_read()
1051 * Block Write followed by Block Read.
1055 * @param cmd Command byte which is sent to peripheral device first.
1062 * @retval -EIO General input / output error.
1063 * @retval -ENOSYS If function smbus_block_pcall() is not implemented
1067 uint16_t addr, uint8_t cmd,
1072 uint16_t addr, uint8_t cmd, in z_impl_smbus_block_pcall() argument
1077 (const struct smbus_driver_api *)dev->api; in z_impl_smbus_block_pcall()
1079 if (api->smbus_block_pcall == NULL) { in z_impl_smbus_block_pcall()
1080 return -ENOSYS; in z_impl_smbus_block_pcall()
1083 return api->smbus_block_pcall(dev, addr, cmd, snd_count, snd_buf, in z_impl_smbus_block_pcall()