class pah8011 for mbed
pah8011/pah_drv_comm.h@6:d196b612b14a, 2019-01-23 (annotated)
- Committer:
- bell_huang
- Date:
- Wed Jan 23 08:01:57 2019 +0000
- Revision:
- 6:d196b612b14a
Remove mbed
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
bell_huang | 6:d196b612b14a | 1 | #pragma once |
bell_huang | 6:d196b612b14a | 2 | |
bell_huang | 6:d196b612b14a | 3 | |
bell_huang | 6:d196b612b14a | 4 | #include "pah_ret.h" |
bell_huang | 6:d196b612b14a | 5 | #include <stdint.h> |
bell_huang | 6:d196b612b14a | 6 | |
bell_huang | 6:d196b612b14a | 7 | |
bell_huang | 6:d196b612b14a | 8 | struct pah_drv_comm_s; |
bell_huang | 6:d196b612b14a | 9 | |
bell_huang | 6:d196b612b14a | 10 | typedef enum { |
bell_huang | 6:d196b612b14a | 11 | pah_drv_comm_i2c, |
bell_huang | 6:d196b612b14a | 12 | pah_drv_comm_spi, |
bell_huang | 6:d196b612b14a | 13 | } pah_drv_comm_type_e; |
bell_huang | 6:d196b612b14a | 14 | |
bell_huang | 6:d196b612b14a | 15 | |
bell_huang | 6:d196b612b14a | 16 | typedef struct pah_drv_comm_s { |
bell_huang | 6:d196b612b14a | 17 | |
bell_huang | 6:d196b612b14a | 18 | void *user_data; |
bell_huang | 6:d196b612b14a | 19 | pah_drv_comm_type_e type; |
bell_huang | 6:d196b612b14a | 20 | uint32_t max_length; |
bell_huang | 6:d196b612b14a | 21 | |
bell_huang | 6:d196b612b14a | 22 | pah_ret (*write)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t data); |
bell_huang | 6:d196b612b14a | 23 | pah_ret (*write_delay)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t data, uint32_t delay_ms); |
bell_huang | 6:d196b612b14a | 24 | pah_ret (*read)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t *data); |
bell_huang | 6:d196b612b14a | 25 | pah_ret (*burst_read)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t *data, uint32_t rx_size); |
bell_huang | 6:d196b612b14a | 26 | |
bell_huang | 6:d196b612b14a | 27 | } pah_drv_comm_s; |
bell_huang | 6:d196b612b14a | 28 | |
bell_huang | 6:d196b612b14a | 29 |