| | |
| | | |
| | | #define SCPI_THREAD_PRIO (tskIDLE_PRIORITY + 2) |
| | | |
| | | #define SCPI_MSG_TEST 1 |
| | | #define SCPI_MSG_IO_LISTEN 2 |
| | | #define SCPI_MSG_CONTROL_IO_LISTEN 3 |
| | | #define SCPI_MSG_IO 4 |
| | | #define SCPI_MSG_CONTROL_IO 5 |
| | | #define SCPI_MSG_SET_ESE_REQ 6 |
| | | |
| | | typedef struct { |
| | | struct netconn *io_listen; |
| | | struct netconn *control_io_listen; |
| | |
| | | .control_io = NULL, |
| | | .evtQueue = 0, |
| | | }; |
| | | |
| | | |
| | | size_t SCPI_Write(scpi_t * context, const char * data, size_t len) { |
| | | if (context->user_context != NULL) { |
| | |
| | | (void) context; |
| | | // BEEP |
| | | iprintf("**ERROR: %ld, \"%s\"\r\n", (int32_t) err, SCPI_ErrorTranslate(err)); |
| | | if (err != 0) { |
| | | /* New error */ |
| | | /* Beep */ |
| | | /* Error LED ON */ |
| | | } else { |
| | | /* No more errors in the queue */ |
| | | /* Error LED OFF */ |
| | | } |
| | | return 0; |
| | | } |
| | | |
| | | |
| | | scpi_result_t SCPI_Control(scpi_t * context, scpi_ctrl_name_t ctrl, scpi_reg_val_t val) { |
| | | char b[16]; |
| | |
| | | } |
| | | |
| | | |
| | | #define SCPI_MSG_TEST 1 |
| | | #define SCPI_MSG_IO_LISTEN 2 |
| | | #define SCPI_MSG_CONTROL_IO_LISTEN 3 |
| | | #define SCPI_MSG_IO 4 |
| | | #define SCPI_MSG_CONTROL_IO 5 |
| | | #define SCPI_MSG_SET_ESE_REQ 6 |
| | | |
| | | static void setEseReq(void) { |
| | | SCPI_RegSetBits(&scpi_context, SCPI_REG_ESR, ESR_REQ); |
| | | } |
| | | |
| | | void SCPI_RequestControl(void) { |
| | | uint32_t msg = SCPI_MSG_SET_ESE_REQ; |
| | | |
| | | /* Avoid sending evtQueue message if ESR_REQ is already set |
| | | if((SCPI_RegGet(&scpi_context, SCPI_REG_ESR) & ESR_REQ) == 0) { |
| | | xQueueSend(user_data.evtQueue, &msg, 1000); |
| | | } |
| | | */ |
| | | |
| | | xQueueSend(user_data.evtQueue, &msg, 1000); |
| | | } |
| | | |
| | |
| | | |
| | | return rc; |
| | | } |
| | | |
| | | |
| | | static int processIoListen(user_data_t * user_data) { |
| | | struct netconn *newconn; |