NessLab(7138).c 761 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * NessLab.c
  3. *
  4. * Created on: Aug 3, 2020
  5. * Author: parkyj
  6. */
  7. #include "main.h"
  8. #include "NessLab.h"
  9. #include "adc.h"
  10. Nesslab_Prot Currstatus;
  11. uint8_t data_Tx[50] = {0,};
  12. void NessLab_Operate(uint8_t* data){
  13. uint8_t datatype = data[NessLab_MsgID0];
  14. switch(datatype){
  15. case NessLab_STATUS_REQ:
  16. case NessLab_STATUS_RES:
  17. ADC_Check();
  18. Uart1_Data_Send(&Currstatus, 30);
  19. break;
  20. }
  21. }
  22. void NessLab_Status_Check(){
  23. //HAL_GPIO_ReadPin(, GPIO_Pin)
  24. }
  25. void NessLab_PAU_Enable(){
  26. HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin));
  27. //HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_RESET_GPIO_Port, PAU_RESET_Pin));
  28. }
  29. void NessLab_GPIO_Operate(){
  30. NessLab_PAU_Enable();
  31. }