binary Clock
Macros | Enumerations
global_defines.h File Reference

Definitions and types used in all files. Should be included in all project files. More...

Go to the source code of this file.

Macros

#define UART_CMD_INVALID   0xFF
 code if the UART command received is invalid More...
 
#define UART_CMD_WRONG_STATE   0xFE
 code to send if the state is incorrect for the given command More...
 
#define UART_CMD_VALID   0x42
 valid command & successful More...
 
#define UART_CMD_START_BYTE   0xAA
 byte that starts each transaction More...
 
#define UART_CMD_SET_LED   0x10
 command to set an LED to a certain color (must be in manual control mode) More...
 
#define UART_CMD_CLEAR_LED   0x11
 command to set an LED to a certain color (must be in manual control mode) More...
 
#define UART_CMD_CLEAR_ALL_LED   0x12
 command to clear an led (must be in manual control mode) More...
 
#define UART_CMD_SET_ALL_LED   0x13
 command to clear all leds (must be in manual control mode) More...
 
#define UART_CMD_SET_TIME   0x14
 command to set all leds to a certain color (must be in manual control mode) More...
 
#define UART_CMD_SET_COLOR   0x15
 command to set the time (must be in time control mode) More...
 
#define UART_CMD_CHANGE_STATE   0x16
 command to set the color during time mode (must be in time control mode) More...
 

Enumerations

enum  retval_t {
  GEN_PASS = 0, GEN_FAIL, BUFF_FAIL_OVERFLOW = 0x11, BUFF_FAIL_UNDERFLOW,
  BUFF_FAIL_FULL, UART_RX_EMPTY = 0x21, UART_FRAME_ERROR, UART_DATA_OVERRUN_ERROR,
  UART_PARITY_ERROR, I2C_ACK = 0x30, I2C_NACK, I2C_ERROR,
  I2C_START_TIMEOUT, I2C_INIT_TIMEOUT, I2C_CLK_LOW_BEFORE_START, I2C_START_COND_NOT_DETECTED,
  RTC_OSCILLATOR_STOPPED = 0x41
}
 definition of the types of return values possible More...
 
enum  bool_t { FALSE = 0, TRUE }
 command to change states More...
 

Detailed Description

Definitions and types used in all files. Should be included in all project files.

Macro Definition Documentation

◆ UART_CMD_CHANGE_STATE

#define UART_CMD_CHANGE_STATE   0x16

command to set the color during time mode (must be in time control mode)

◆ UART_CMD_CLEAR_ALL_LED

#define UART_CMD_CLEAR_ALL_LED   0x12

command to clear an led (must be in manual control mode)

◆ UART_CMD_CLEAR_LED

#define UART_CMD_CLEAR_LED   0x11

command to set an LED to a certain color (must be in manual control mode)

◆ UART_CMD_INVALID

#define UART_CMD_INVALID   0xFF

code if the UART command received is invalid

◆ UART_CMD_SET_ALL_LED

#define UART_CMD_SET_ALL_LED   0x13

command to clear all leds (must be in manual control mode)

◆ UART_CMD_SET_COLOR

#define UART_CMD_SET_COLOR   0x15

command to set the time (must be in time control mode)

◆ UART_CMD_SET_LED

#define UART_CMD_SET_LED   0x10

command to set an LED to a certain color (must be in manual control mode)

◆ UART_CMD_SET_TIME

#define UART_CMD_SET_TIME   0x14

command to set all leds to a certain color (must be in manual control mode)

◆ UART_CMD_START_BYTE

#define UART_CMD_START_BYTE   0xAA

byte that starts each transaction

◆ UART_CMD_VALID

#define UART_CMD_VALID   0x42

valid command & successful

◆ UART_CMD_WRONG_STATE

#define UART_CMD_WRONG_STATE   0xFE

code to send if the state is incorrect for the given command

Enumeration Type Documentation

◆ bool_t

enum bool_t

command to change states

definition of a custom boolean type

Enumerator
FALSE 

False boolian value.

TRUE 

True boolian value.

◆ retval_t

enum retval_t

definition of the types of return values possible

Enumerator
GEN_PASS 

Value to return if everything went well.

GEN_FAIL 

General failure message.

BUFF_FAIL_OVERFLOW 

return if buffer overflow

BUFF_FAIL_UNDERFLOW 

return if buffer underflow

BUFF_FAIL_FULL 

return if buffer is already full

UART_RX_EMPTY 

return if there is nothing to receive

UART_FRAME_ERROR 

return if UART framing error

UART_DATA_OVERRUN_ERROR 

return if UART overrun error

UART_PARITY_ERROR 

return if UART parity error

I2C_ACK 

return if the device acknowledges the message

I2C_NACK 

return is the device does not acknowledge the message

I2C_ERROR 

return if there is a general I2C error

I2C_START_TIMEOUT 

return if the device does not respond in time

I2C_INIT_TIMEOUT 

return if the I2C module does not initialize in time

I2C_CLK_LOW_BEFORE_START 

return if the SCL line is low when it shouldn't be

I2C_START_COND_NOT_DETECTED 

return if the start condition was not detected

RTC_OSCILLATOR_STOPPED 

return if the oscillator stopped while on battery backup