123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- /*
- * NessLab.c
- *
- * Created on: Aug 3, 2020
- * Author: parkyj
- */
- #include "main.h"
- #include "NessLab.h"
- #include "adc.h"
- #include "crc.h"
- //extern uint8_t NessLab_Checksum(uint8_t* data,uint8_t size);
- Nesslab_Prot Currstatus;
- uint8_t data_Tx[50] = {0,};
- void NessLab_Operate(uint8_t* data){
- uint8_t datatype = data[NessLab_MsgID0];
- switch(datatype){
- case NessLab_STATUS_REQ:
- ADC_Check();
- break;
- }
-
- Uart1_Data_Send(&Currstatus, 30);
- }
- void NessLab_Frame_Set(uint8_t* data,uint8_t size){
- data[NessLab_Header0] = 0x7E;
- data[NessLab_Header1] = 0x7E;
- data[NessLab_MsgID0] = NessLab_STATUS_RES;// ID
- data[NessLab_MsgSN0] = 0; // SEQ NUMBER
- data[NessLab_MsgSN1] = 0; // SEQ NUMBER
- data[NessLab_Reserve0] = 0; // NessLab_Reserve0
- data[NessLab_Reserve0] = size; // Nesslab Size
-
-
-
- /* Exception Header Tail Checksum */
- Currstatus.Checksum = NessLab_Checksum(0, 17);
-
- Currstatus.Tail0 = 0x7E;
- Currstatus.Tail1 = 0x7E;
- }
- void NessLab_Status_Check(){
- //HAL_GPIO_ReadPin(, GPIO_Pin)
- }
- void NessLab_PAU_Enable(){
- HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_EN_GPIO_Port, PAU_EN_Pin));
- //HAL_GPIO_WritePin(AMP_EN_GPIO_Port,AMP_EN_Pin, HAL_GPIO_ReadPin(PAU_RESET_GPIO_Port, PAU_RESET_Pin));
- }
- void NessLab_GPIO_Operate(){
- NessLab_PAU_Enable();
- }
|