Advertisement
TokioHotel

Untitled

Mar 21st, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.73 KB | None | 0 0
  1. uint8_t AD8555_SendPacket(uint8_t Mode,uint8_t Function,uint8_t Value)  
  2. {
  3.     // Do not accept Program Mode. It requires 5V supply and fuses cannot be changed if we make any mistake!!!
  4.     if(Mode != AD8555_READ && Mode != AD8555_CHANGE_SENSE_CURRENT && Mode != AD8555_SIMULATE)
  5.     {
  6.       return 0;
  7.     }
  8.     else if(Function != AD8555_SSG_CODE
  9.          && Function != AD8555_FSG_CODE
  10.          && Function != AD8555_OFS_CODE
  11.          && Function != AD8555_OTHER)
  12.     {
  13.       return 0;
  14.     }
  15.     AD8555_StartFrame();
  16.     AD8555_SendParameter(Mode);
  17.     AD8555_SendParameter(Function);
  18.     AD8555_BitSend(1); // Dummy
  19.     AD8555_BitSend(0); // Dummy
  20.     AD8555_ParameterValue(Value);
  21.     AD8555_StopFrame();
  22.     return 1;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement