firmware  v0.1.2
Chromation Spectrometer Dev-Kit
StatusCode.h
Go to the documentation of this file.
1 
35 #ifndef _STATUSCODE_H
36 #define _STATUSCODE_H
37 #include "stdint.h"
38 #include "stdbool.h"
39 
41 typedef uint8_t const status_code;
42 
43 extern status_code OK;
44 extern status_code ERROR;
45 extern status_code INVALID_CMD;
46 
48 typedef uint8_t const led_state;
49 extern led_state OFF;
50 extern led_state GREEN;
51 extern led_state RED;
52 
53 inline bool led_setting_is_valid(led_state setting)
54 {
61  return ( (setting==OFF) || (setting==GREEN) || (setting==RED) );
62 }
63 
65 extern uint8_t PADDING;
66 
67 #endif // _STATUSCODE_H
bool led_setting_is_valid(led_state setting)
Definition: StatusCode.h:53
uint8_t const led_state
Indicator LEDs have three possible states: OFF, GREEN, and RED.
Definition: StatusCode.h:48
uint8_t const status_code
Status codes are type status_code.
Definition: StatusCode.h:41
uint8_t PADDING
When status_code is ERROR, pad responses to send expected number of bytes.
Definition: StatusCodes.h:21