lp5562_reg.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #pragma once
  2. #if BITS_BIG_ENDIAN == 1
  3. #error Bit structures defined in this file is not portable to BE
  4. #endif
  5. #define LP5562_ADDRESS 0x60
  6. typedef enum {
  7. EngExecHold=0b00,
  8. EngExecStep=0b01,
  9. EngExecRun=0b10,
  10. EngExecPC=0b11,
  11. } EngExec;
  12. typedef struct {
  13. EngExec ENG3_EXEC:2;
  14. EngExec ENG2_EXEC:2;
  15. EngExec ENG1_EXEC:2;
  16. bool CHIP_EN:1;
  17. bool LOG_EN:1;
  18. } Reg00_Enable;
  19. typedef enum {
  20. EngModeDisable=0b00,
  21. EngModeLoad=0b01,
  22. EngModeRun=0b10,
  23. EngModeDirect=0b11,
  24. } EngMode;
  25. typedef struct {
  26. EngMode ENG3_MODE:2;
  27. EngMode ENG2_MODE:2;
  28. EngMode ENG1_MODE:2;
  29. uint8_t reserved:2;
  30. } Reg01_OpMode;
  31. typedef struct {
  32. bool INT_CLK_EN:1;
  33. bool CLK_DET_EN:1;
  34. uint8_t reserved0:3;
  35. bool PS_EN:1;
  36. bool PWM_HF:1;
  37. uint8_t reserved1:1;
  38. } Reg08_Config;
  39. typedef struct {
  40. uint8_t pc:3;
  41. uint8_t reserved:5;
  42. } Reg09_Engine1PC;
  43. typedef struct {
  44. uint8_t pc:3;
  45. uint8_t reserved:5;
  46. } Reg0A_Engine2PC;
  47. typedef struct {
  48. uint8_t pc:3;
  49. uint8_t reserved:5;
  50. } Reg0B_Engine3PC;
  51. typedef struct {
  52. bool ENG3_INT:1;
  53. bool ENG2_INT:1;
  54. bool ENG1_INT:1;
  55. bool EXT_CLK_USED:1;
  56. uint8_t reserved:5;
  57. } Reg0C_Status;
  58. typedef struct {
  59. uint8_t value;
  60. } Reg0D_Reset;
  61. typedef enum {
  62. EngSelectI2C=0b00,
  63. EngSelectEngine1=0b01,
  64. EngSelectEngine2=0b10,
  65. EngSelectEngine3=0b11,
  66. } EngSelect;
  67. typedef struct {
  68. EngSelect blue:2;
  69. EngSelect green:2;
  70. EngSelect red:2;
  71. EngSelect white:2;
  72. } Reg70_LedMap;