From: Nathael Pajani Date: Fri, 15 Jul 2022 01:48:59 +0000 (+0200) Subject: Add numbering to packet types for debugging X-Git-Url: http://git.techno-innov.fr/?a=commitdiff_plain;h=e27f5c0c97da2c9591adf5b15398bcda9bd60960;p=soft%2Flpc122x%2Fcore Add numbering to packet types for debugging --- diff --git a/include/lib/protocols/dtplug/defs.h b/include/lib/protocols/dtplug/defs.h index f0c8c20..55ca0ad 100644 --- a/include/lib/protocols/dtplug/defs.h +++ b/include/lib/protocols/dtplug/defs.h @@ -120,46 +120,46 @@ struct packet { enum packet_types { /* Common packet types, must be handled by all the slaves */ - PKT_TYPE_RESET = 0, /* Soft reset of board */ - PKT_TYPE_PING, /* Reply with no data or urgent data */ - PKT_TYPE_GET_BOARD_INFO, /* Return board name, version, module version, and programm version. */ - PKT_TYPE_SET_TIME, /* Set current time for events timestamping */ - PKT_TYPE_GET_NUM_PACKETS, /* Get the number of packets received since system start */ - PKT_TYPE_GET_ERRORS, /* Ask the slave to return any active error code in the data */ - PKT_TYPE_GET_NUM_ERRORS, /* Get the number of errors since system start */ - PKT_TYPE_SET_USER_INFO, /* Change the current board user information (and reset board) */ + PKT_TYPE_RESET = 0, /* 0 - Soft reset of board */ + PKT_TYPE_PING, /* 1 - Reply with no data or urgent data */ + PKT_TYPE_GET_BOARD_INFO, /* 2 - Return board name, version, module version, and programm version. */ + PKT_TYPE_SET_TIME, /* 3 - Set current time for events timestamping */ + PKT_TYPE_GET_NUM_PACKETS, /* 4 - Get the number of packets received since system start */ + PKT_TYPE_GET_ERRORS, /* 5 - Ask the slave to return any active error code in the data */ + PKT_TYPE_GET_NUM_ERRORS, /* 6 - Get the number of errors since system start */ + PKT_TYPE_SET_USER_INFO, /* 7 - Change the current board user information (and reset board) */ /* Config */ - PKT_TYPE_ADD_GPIO, /* Configure one of the IO as GPIO */ - PKT_TYPE_ADD_CS, /* Configure one of the IO as SPI Chip select */ + PKT_TYPE_ADD_GPIO, /* 8 - Configure one of the IO as GPIO */ + PKT_TYPE_ADD_CS, /* 9 - Configure one of the IO as SPI Chip select */ /* ADC config specifies : * the channel number, * periodicity of sample (from on request up to continuous), * and number of values for the continuous average computation */ - PKT_TYPE_ADD_ADC, /* Configure one of the ADC capable IO as ADC */ + PKT_TYPE_ADD_ADC, /* 10 - Configure one of the ADC capable IO as ADC */ /* PWM config specifies : * the channel number, * the PWM period, * the channel default duty cycle, */ - PKT_TYPE_ADD_PWM, /* Configure one of the PWM capable IO as PWM */ + PKT_TYPE_ADD_PWM, /* 11 - Configure one of the PWM capable IO as PWM */ /* Continued data. Use for protocols with data size that goes beyond PACKET_DATA_SIZE */ - PKT_TYPE_CONTINUED_DATA, + PKT_TYPE_CONTINUED_DATA, /* 12 */ /* Temperature packets */ - PKT_TYPE_START_TEMP_CONVERSION, /* Requiered to update the temperature value */ - PKT_TYPE_GET_TEMPERATURE, /* Get temprature values */ + PKT_TYPE_START_TEMP_CONVERSION, /* 13 - Requiered to update the temperature value */ + PKT_TYPE_GET_TEMPERATURE, /* 14 - Get temprature values */ /* ADC, PWM and GPIO packets */ - PKT_TYPE_START_ADC_CONVERSION, - PKT_TYPE_GET_ADC_VALUE, - PKT_TYPE_SET_GPIO, - PKT_TYPE_GET_GPIO, - PKT_TYPE_SET_PWM_CHAN, + PKT_TYPE_START_ADC_CONVERSION, /* 15 */ + PKT_TYPE_GET_ADC_VALUE, /* 16 */ + PKT_TYPE_SET_GPIO, /* 17 */ + PKT_TYPE_GET_GPIO, /* 18 */ + PKT_TYPE_SET_PWM_CHAN, /* 19 */ /* RGB Leds control */ /* Get and set have the following arguments : @@ -168,15 +168,15 @@ enum packet_types { * green value (uint8_t) * blue value (uint8_t) */ - PKT_TYPE_SET_RGB_LED, /* If in quick data packet, set the led to off (0,0,0) */ - PKT_TYPE_GET_RGB_LED, - PKT_TYPE_CLEAR_LEDS, /* No arguments */ + PKT_TYPE_SET_RGB_LED, /* 20 - If in quick data packet, set the led to off (0,0,0) */ + PKT_TYPE_GET_RGB_LED, /* 21 */ + PKT_TYPE_CLEAR_LEDS, /* 22 - No arguments */ /* Communication */ - PKT_TYPE_SEND_ON_BUS, + PKT_TYPE_SEND_ON_BUS, /* 23 - Send raw data on Bus (Bus - device specific) */ /* End of list, to be used as offset for user defined values */ - PKT_TYPE_LAST, + PKT_TYPE_LAST, /* 24 */ }; /* Error / status codes */