hw_iic.h 765 B

123456789101112131415161718
  1. #ifndef __HW_IIC_H__
  2. #define __HW_IIC_H__
  3. #define EEPROM_SIZE 512
  4. void hw_iic_init(void);
  5. void hw_iic_write_byte(unsigned char value);
  6. unsigned char hw_iic_read_byte(void);
  7. unsigned short hw_iic_rw_addr(unsigned short addr);
  8. unsigned char hw_iic_device_id(unsigned short addr);
  9. void eeprom_write_byte(unsigned short addr, unsigned char dat);
  10. void eeprom_write_array(unsigned short addr,unsigned char *src, int size);
  11. void eeprom_write_word_array(unsigned short addr, unsigned short *src,int size);
  12. void eeprom_write_word(unsigned short addr, unsigned short dat);
  13. void eeprom_write_dword(unsigned short addr, unsigned int dat);
  14. unsigned char eeprom_read_byte(unsigned short addr);
  15. void eeprom_read_array(unsigned short addr,unsigned char *dst, int size);
  16. #endif