ds4510.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright 2008 Extreme Engineering Solutions, Inc.
  4. */
  5. #ifndef __DS4510_H_
  6. #define __DS4510_H_
  7. /* General defines */
  8. #define DS4510_NUM_IO 0x04
  9. #define DS4510_IO_MASK ((1 << DS4510_NUM_IO) - 1)
  10. #define DS4510_EEPROM_PAGE_WRITE_DELAY_MS 20
  11. /* EEPROM from 0x00 - 0x39 */
  12. #define DS4510_EEPROM 0x00
  13. #define DS4510_EEPROM_SIZE 0x40
  14. #define DS4510_EEPROM_PAGE_SIZE 0x08
  15. #define DS4510_EEPROM_PAGE_OFFSET(x) ((x) & (DS4510_EEPROM_PAGE_SIZE - 1))
  16. /* SEEPROM from 0xf0 - 0xf7 */
  17. #define DS4510_SEEPROM 0xf0
  18. #define DS4510_SEEPROM_SIZE 0x08
  19. /* Registers overlapping SEEPROM from 0xf0 - 0xf7 */
  20. #define DS4510_PULLUP 0xF0
  21. #define DS4510_PULLUP_DIS 0x00
  22. #define DS4510_PULLUP_EN 0x01
  23. #define DS4510_RSTDELAY 0xF1
  24. #define DS4510_RSTDELAY_MASK 0x03
  25. #define DS4510_RSTDELAY_125 0x00
  26. #define DS4510_RSTDELAY_250 0x01
  27. #define DS4510_RSTDELAY_500 0x02
  28. #define DS4510_RSTDELAY_1000 0x03
  29. #define DS4510_IO3 0xF4
  30. #define DS4510_IO2 0xF5
  31. #define DS4510_IO1 0xF6
  32. #define DS4510_IO0 0xF7
  33. /* Status configuration registers from 0xf8 - 0xf9*/
  34. #define DS4510_IO_STATUS 0xF8
  35. #define DS4510_CFG 0xF9
  36. #define DS4510_CFG_READY 0x80
  37. #define DS4510_CFG_TRIP_POINT 0x40
  38. #define DS4510_CFG_RESET 0x20
  39. #define DS4510_CFG_SEE 0x10
  40. #define DS4510_CFG_SWRST 0x08
  41. /* SRAM from 0xfa - 0xff */
  42. #define DS4510_SRAM 0xfa
  43. #define DS4510_SRAM_SIZE 0x06
  44. #endif /* __DS4510_H_ */