|
@@ -7,6 +7,48 @@
|
|
|
#include "main.h"
|
|
|
#include "gpio.h"
|
|
|
|
|
|
+/* Type Defs */
|
|
|
+typedef enum {
|
|
|
+ Tube_A = 3,
|
|
|
+ Tube_B = 2,
|
|
|
+ Tube_D = 1,
|
|
|
+ Tube_E = 0
|
|
|
+} tube_pos_t;
|
|
|
+
|
|
|
+typedef enum {
|
|
|
+ Lvl_Off = 0,
|
|
|
+ Lvl_Min = 1,
|
|
|
+ Lvl_2 = 2,
|
|
|
+ Lvl_3 = 3,
|
|
|
+ Lvl_Mdl = 4,
|
|
|
+ Lvl_5 = 5,
|
|
|
+ Lvl_Max = 6,
|
|
|
+ Lvl_On = 7
|
|
|
+} brigh_level_t;
|
|
|
+
|
|
|
+typedef struct {
|
|
|
+ uint8_t r;
|
|
|
+ uint8_t g;
|
|
|
+ uint8_t b;
|
|
|
+} RGB_t;
|
|
|
+
|
|
|
+typedef struct {
|
|
|
+ uint8_t h;
|
|
|
+ uint8_t s;
|
|
|
+ uint8_t v;
|
|
|
+} HSV_t;
|
|
|
+
|
|
|
+typedef union {
|
|
|
+ uint32_t u32; /* element specifier for accessing whole u32 */
|
|
|
+ uint8_t ar[4]; /* element specifier for accessing as array */
|
|
|
+ struct {
|
|
|
+ uint8_t tE; /* element specifier for accessing Tube_E(4) */
|
|
|
+ uint8_t tD; /* element specifier for accessing Tube_D(3) */
|
|
|
+ uint8_t tB; /* element specifier for accessing Tube_B(2) */
|
|
|
+ uint8_t tA; /* element specifier for accessing Tube_A(1) */
|
|
|
+ } s8; /* element spec. for acc. struct with tubes */
|
|
|
+} tube4_t;
|
|
|
+
|
|
|
/* Exported macros */
|
|
|
#define LATCH_DOWN GPIOC->BRR = 0x40
|
|
|
#define LATCH_UP GPIOC->BSRR = 0x40
|
|
@@ -124,37 +166,7 @@
|
|
|
#define BTNS_STATE (BTNS1_STATE | BTNS2_STATE)
|
|
|
|
|
|
/* Variables */
|
|
|
-
|
|
|
-/* Type Defs */
|
|
|
-typedef enum {
|
|
|
- Tube_A = 3,
|
|
|
- Tube_B = 2,
|
|
|
- Tube_D = 1,
|
|
|
- Tube_E = 0
|
|
|
-} tube_pos_t;
|
|
|
-
|
|
|
-typedef struct {
|
|
|
- uint8_t r;
|
|
|
- uint8_t g;
|
|
|
- uint8_t b;
|
|
|
-} RGB_t;
|
|
|
-
|
|
|
-typedef struct {
|
|
|
- uint8_t h;
|
|
|
- uint8_t s;
|
|
|
- uint8_t v;
|
|
|
-} HSV_t;
|
|
|
-
|
|
|
-typedef union {
|
|
|
- uint32_t u32; /* element specifier for accessing whole u32 */
|
|
|
- uint8_t ar[4]; /* element specifier for accessing as array */
|
|
|
- struct {
|
|
|
- uint8_t tE; /* element specifier for accessing Tube_E(4) */
|
|
|
- uint8_t tD; /* element specifier for accessing Tube_D(3) */
|
|
|
- uint8_t tB; /* element specifier for accessing Tube_B(2) */
|
|
|
- uint8_t tA; /* element specifier for accessing Tube_A(1) */
|
|
|
- } s8; /* element spec. for acc. struct with tubes */
|
|
|
-} tube4_t;
|
|
|
+extern const uint8_t cie[];
|
|
|
|
|
|
/* Exported funcions */
|
|
|
void SystemClock_Config(void);
|