59 #define UCCONFIG_KEY_LENGTH 4 63 #define UCCONFIG_KEY_1 2 67 #define UCCONFIG_KEY_2 4 71 #define UCCONFIG_KEY_3 6 75 #define UCCONFIG_KEY_4 8 79 #define UCCONFIG_FIFO_SIZE 32 84 #define UCCONFIG_FRAME_END 22 88 #define UCCONFIG_SET_MEMORY_ADDRESS 12 92 #define UCCONFIG_SET_WRITE_FRAME 13 96 #define UCCONFIG_READ_FRAME 14 100 #define UCCONFIG_TERMINATE 15 104 #define UCCONFIG_AT_ADDRESS 16 108 #define UCCONFIG_ACK 17 112 #define UCCONFIG_NACK 18 116 #define UCCONFIG_NULL 19 120 #define UCCONFIG_NOT_USED 20 125 #define UCCONFIG_NEWLINE 10 129 #define UCCONFIG_LENGTH_ZERO 21 133 #define UCCONFIG_TYPE_NONE 11 137 #define UCCONFIG_TYPE_UINT8_T 12 141 #define UCCONFIG_TYPE_INT8_T 13 145 #define UCCONFIG_TYPE_UINT16_T 14 149 #define UCCONFIG_TYPE_INT16_T 15 153 #define UCCONFIG_TYPE_UINT32_T 16 157 #define UCCONFIG_TYPE_INT32_T 17 161 #define UCCONFIG_TYPE_FLOAT 18 165 #define UCCONFIG_TYPE_CHAR 19 169 #define UCCONFIG_ACTIVE_MODE_TIMEOUT 0xFFFF 183 #define UCCONFIG_get(X,Y) _Generic((X), \ 184 char*: ucconfig_get_c, \ 185 uint8_t*: ucconfig_get_u8, \ 186 int8_t*: ucconfig_get_8, \ 187 uint16_t*: ucconfig_get_u16, \ 188 int16_t*: ucconfig_get_16, \ 189 uint32_t*: ucconfig_get_u32, \ 190 int32_t*: ucconfig_get_32, \ 191 float*: ucconfig_get_float, \ 192 default: ucconfig_get_u8 \ 206 uint8_t (*flash_read)(uint16_t address),
207 void (*flash_write)(uint8_t byte,uint16_t adrress),
208 void (*serial_write)(uint8_t byte));
void ucconfig_get_u32(uint32_t *data, uint16_t address)
Get a uint32 from the given memory address.
void UCCONFIG_setAddressOffset(uint16_t address)
Set the memory address offset of the flash memory pointer (optional)
void UCCONFIG_loop(void)
Runs config mode if the key has been received.
void ucconfig_get_u16(uint16_t *data, uint16_t address)
Get a uint16 from the given memory address.
void UCCONFIG_setOnExit(void(*on_exit)(void))
Sets the function which is called when config mode is exited (optional)
void ucconfig_get_u8(uint8_t *data, uint16_t address)
Get a uint8 from the given memory address.
void ucconfig_get_16(int16_t *data, uint16_t address)
Get a int16 from the given memory address.
void UCCONFIG_setOnEnter(void(*on_enter)(void))
Sets the function which is called when config mode is entered (optional)
Header file for flashWrite library.
Header file for 8-bit circular FIFO software buffer.
void UCCONFIG_setOnFirstWrite(void(*on_first)(void))
Sets the function which is called when the first byte is written to the UC from PC.
Header file for C11 string library.
void ucconfig_get_8(int8_t *data, uint16_t address)
Get a int8 from the given memory address.
void ucconfig_get_c(char *data, uint16_t address)
Get a character from the given memory address.
void ucconfig_get_32(int32_t *data, uint16_t address)
Get a int32 from the given memory address.
void ucconfig_get_float(float *data, uint16_t address)
Get a float from the given memory address.
void UCCONFIG_listen(uint8_t receivedByte)
Listens to serial communication and sets module in config mode if correct key is sent.
void UCCONFIG_setup(uint8_t(*flash_read)(uint16_t address), void(*flash_write)(uint8_t byte, uint16_t adrress), void(*serial_write)(uint8_t byte))
Set up the module, this should be called before any other module function will work.