class pah8011 for mbed
Diff: pah8011/pah_platform_functions.h
- Revision:
- 5:37451de228e4
- Parent:
- 3:0b9497a4b249
- Child:
- 6:d196b612b14a
diff -r cbc49829af39 -r 37451de228e4 pah8011/pah_platform_functions.h --- a/pah8011/pah_platform_functions.h Fri Oct 27 06:05:38 2017 +0000 +++ b/pah8011/pah_platform_functions.h Fri Oct 27 08:21:32 2017 +0000 @@ -12,14 +12,19 @@ #ifndef __pah_platform_functions_h__ #define __pah_platform_functions_h__ -#include "stdint.h" + +#include <stdint.h> +#include <stdbool.h> + -uint8_t i2c_write_reg(uint8_t addr, uint8_t data); -uint8_t i2c_read_reg(uint8_t addr, uint8_t *data); -uint8_t i2c_burst_read_reg(uint8_t addr, uint8_t *data, uint32_t rx_size); -void delay_ms(uint64_t ms); +bool i2c_write_reg(uint8_t addr, uint8_t data); +bool i2c_read_reg(uint8_t addr, uint8_t *data); +bool i2c_burst_read_reg(uint8_t addr, uint8_t *data, uint32_t rx_size); +void delay_ms(uint64_t ms); -void debug_printf(const char *fmt, ...) ; +typedef void (*DEBUG_PRINT_HANDLE)(const char *fmt, ...); +extern DEBUG_PRINT_HANDLE debug_printf; + #define debug_printf_1 debug_printf #define debug_printf_2 debug_printf #define debug_printf_3 debug_printf