GlobLib
HAL and API libraries for MCUs and hardware.
ucconfig.h File Reference

Header file for UCConfig module. More...

#include <string11.h>
#include <flashWrite.h>
#include <fifo8.h>
#include <stdio.h>

Go to the source code of this file.

Macros

#define UCCONFIG_KEY_LENGTH   4
 The length of the key which the PC needs to send to enter Config mode.
 
#define UCCONFIG_KEY_1   2
 Key character 1.
 
#define UCCONFIG_KEY_2   4
 Key character 2.
 
#define UCCONFIG_KEY_3   6
 Key character 3.
 
#define UCCONFIG_KEY_4   8
 Key character 4.
 
#define UCCONFIG_FIFO_SIZE   32
 The size of the FIFO used by the module, don't change this.
 
#define UCCONFIG_FRAME_END   22
 The frame and character.
 
#define UCCONFIG_SET_MEMORY_ADDRESS   12
 Command used to initiate setting the memory address pointer.
 
#define UCCONFIG_SET_WRITE_FRAME   13
 Command used to initial writing data.
 
#define UCCONFIG_READ_FRAME   14
 Command used to initial reading data.
 
#define UCCONFIG_TERMINATE   15
 Command used to exit from commmand mode.
 
#define UCCONFIG_AT_ADDRESS   16
 Command used get the current memory addresss pointer.
 
#define UCCONFIG_ACK   17
 Command used to acknowledge a command.
 
#define UCCONFIG_NACK   18
 Command used to not acknowledge a command.
 
#define UCCONFIG_NULL   19
 ASCII character used for NULL.
 
#define UCCONFIG_NOT_USED   20
 ASCII character used for Not used.
 
#define UCCONFIG_NEWLINE   10
 ASCII character used for new line, UC needs to send this so python module can easly pick end of command.
 
#define UCCONFIG_LENGTH_ZERO   21
 ASCII character used for zero length data frames.
 
#define UCCONFIG_TYPE_NONE   11
 ASCII character used for none types.
 
#define UCCONFIG_TYPE_UINT8_T   12
 ASCII character used for uint8_t types.
 
#define UCCONFIG_TYPE_INT8_T   13
 ASCII character used for int8_t types.
 
#define UCCONFIG_TYPE_UINT16_T   14
 ASCII character used for uint16_t types.
 
#define UCCONFIG_TYPE_INT16_T   15
 ASCII character used for int16_t types.
 
#define UCCONFIG_TYPE_UINT32_T   16
 ASCII character used for uint32_t types.
 
#define UCCONFIG_TYPE_INT32_T   17
 ASCII character used for int32_t types.
 
#define UCCONFIG_TYPE_FLOAT   18
 ASCII character used for float types.
 
#define UCCONFIG_TYPE_CHAR   19
 ASCII character used for char types.
 
#define UCCONFIG_ACTIVE_MODE_TIMEOUT   0xFFFF
 Number of loop iterratios before automattically exits from active mode.
 
#define UCCONFIG_get(X, Y)
 UCCONFIG_GET() is the function macro used to get the value of any variable type in flash. More...
 

Functions

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. More...
 
void UCCONFIG_listen (uint8_t receivedByte)
 Listens to serial communication and sets module in config mode if correct key is sent. More...
 
void UCCONFIG_loop (void)
 Runs config mode if the key has been received. More...
 
void UCCONFIG_setAddressOffset (uint16_t address)
 Set the memory address offset of the flash memory pointer (optional) More...
 
void UCCONFIG_setOnEnter (void(*on_enter)(void))
 Sets the function which is called when config mode is entered (optional) More...
 
void UCCONFIG_setOnExit (void(*on_exit)(void))
 Sets the function which is called when config mode is exited (optional) More...
 
void UCCONFIG_setOnFirstWrite (void(*on_first)(void))
 Sets the function which is called when the first byte is written to the UC from PC. More...
 
void ucconfig_get_c (char *data, uint16_t address)
 Get a character from the given memory address. More...
 
void ucconfig_get_u8 (uint8_t *data, uint16_t address)
 Get a uint8 from the given memory address. More...
 
void ucconfig_get_8 (int8_t *data, uint16_t address)
 Get a int8 from the given memory address. More...
 
void ucconfig_get_u16 (uint16_t *data, uint16_t address)
 Get a uint16 from the given memory address. More...
 
void ucconfig_get_16 (int16_t *data, uint16_t address)
 Get a int16 from the given memory address. More...
 
void ucconfig_get_u32 (uint32_t *data, uint16_t address)
 Get a uint32 from the given memory address. More...
 
void ucconfig_get_32 (int32_t *data, uint16_t address)
 Get a int32 from the given memory address. More...
 
void ucconfig_get_float (float *data, uint16_t address)
 Get a float from the given memory address. More...
 

Detailed Description

Header file for UCConfig module.

Definition in file ucconfig.h.