acomp.h 1022 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * lpc8xx_acomp.h
  3. *
  4. * Created on: Apr 7, 2016
  5. * Author:
  6. */
  7. #ifndef LPC8XX_ACOMP_H_
  8. #define LPC8XX_ACOMP_H_
  9. // CTRL register shifters
  10. #define HYS 25
  11. #define INTENA 24
  12. #define COMPEDGE 23
  13. #define COMPSTAT 21
  14. #define EDGECLR 20
  15. #define COMP_VM_SEL 11
  16. #define COMP_VP_SEL 8
  17. #define COMPSA 6
  18. #define EDGESEL 3
  19. // HYS field descriptors
  20. #define _20mV 0x3
  21. #define _10mV 0x2
  22. #define _5mV 0x1
  23. #define NONE 0x0
  24. // COMP_VM_SEL and COMP_VP_SEL field descriptors
  25. #define DAC_OUT_0 0x7
  26. #define V_BANDGAP 0x6
  27. #define ACOMP_IN5 0x5
  28. #define ACOMP_IN4 0x4
  29. #define ACOMP_IN3 0x3
  30. #define ACOMP_IN2 0x2
  31. #define ACOMP_IN1 0x1
  32. #define V_LADDER_OUT 0x0
  33. // EDGESEL field descriptors
  34. #define BOTH 0x3
  35. #define RISING 0x1
  36. #define FALLING 0x0
  37. // LAD register shifters
  38. #define LADREF 6
  39. #define LADSEL 1
  40. #define LADEN 0
  41. // LADREF field descriptors
  42. #define VDDCMP_PIN 1
  43. #define SUPPLY_VDD 0
  44. #endif /* LPC8XX_ACOMP_H_ */