class pah8011 for mbed
Diff: pah8011/pah_drv_comm.h
- Revision:
- 6:d196b612b14a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/pah8011/pah_drv_comm.h Wed Jan 23 08:01:57 2019 +0000 @@ -0,0 +1,29 @@ +#pragma once + + +#include "pah_ret.h" +#include <stdint.h> + + +struct pah_drv_comm_s; + +typedef enum { + pah_drv_comm_i2c, + pah_drv_comm_spi, +} pah_drv_comm_type_e; + + +typedef struct pah_drv_comm_s { + + void *user_data; + pah_drv_comm_type_e type; + uint32_t max_length; + + pah_ret (*write)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t data); + pah_ret (*write_delay)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t data, uint32_t delay_ms); + pah_ret (*read)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t *data); + pah_ret (*burst_read)(struct pah_drv_comm_s *comm, uint8_t addr, uint8_t *data, uint32_t rx_size); + +} pah_drv_comm_s; + +