Fixed comments
git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@409 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
@@ -61,6 +61,8 @@ struct ADCDevice
|
|||||||
*
|
*
|
||||||
* @param self ADC object
|
* @param self ADC object
|
||||||
* @param read Pointer to read function
|
* @param read Pointer to read function
|
||||||
|
* @param resolutionsInBits The resolution of this ADC device in
|
||||||
|
* number of bits
|
||||||
*
|
*
|
||||||
* @return ErrorStatus SUCCESS if construction was successful
|
* @return ErrorStatus SUCCESS if construction was successful
|
||||||
* ERROR otherwise
|
* ERROR otherwise
|
||||||
@@ -89,9 +91,8 @@ extern void ADCDevice_destruct(struct ADCDevice* self);
|
|||||||
* Reads a value from the ADC device input
|
* Reads a value from the ADC device input
|
||||||
*
|
*
|
||||||
* @param self ADC object
|
* @param self ADC object
|
||||||
* @param voltage value in volt (signed) to write to output
|
|
||||||
*
|
*
|
||||||
* @return ErrorStatus
|
* @return uint32_t The current value read from the ADC
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -83,14 +83,16 @@ struct Buzzer
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* Buzzer_construct
|
* Buzzer_construct
|
||||||
* Description of function
|
* Constructor for a new buzzer instance
|
||||||
*
|
*
|
||||||
* @param self
|
* @param self The buzzer object that gets created
|
||||||
* @param gpio
|
* @param gpio The GPIO to use
|
||||||
* @param taskPriority
|
* @param taskPriority FreeRTOS task priority
|
||||||
* @param stackSize
|
* @param stackSize FreeRTOS stack size
|
||||||
*
|
*
|
||||||
* @return ErrorStatus
|
* @return ErrorStatus SUCCESS if constructor was successful,
|
||||||
|
* including generation/start of task
|
||||||
|
* ERROR otherwise
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
@@ -100,9 +102,9 @@ extern ErrorStatus Buzzer_construct(struct Buzzer* self, struct Gpio* gpio, int
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* Buzzer_destruct
|
* Buzzer_destruct
|
||||||
* Description of function
|
* Destructor for buzzer instance. Also removes the buzzer task
|
||||||
*
|
*
|
||||||
* @param self
|
* @param self The buzzer instance to destruct
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
@@ -114,10 +116,13 @@ extern void Buzzer_destruct(struct Buzzer* self);
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* Buzzer_start
|
* Buzzer_start
|
||||||
* Description of function
|
* Starts the buzzer with a repeating tone.
|
||||||
|
* Tone length is given with argument pulseWidth
|
||||||
*
|
*
|
||||||
* @param self
|
* @param self The buzzer instance to use
|
||||||
* @param pulseWidth
|
* @param pulseWidth The length of the tone in ms. Also defines
|
||||||
|
* the length of the pause between two
|
||||||
|
* tones
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
@@ -129,10 +134,10 @@ extern void Buzzer_start(struct Buzzer* self, unsigned int pulseWidth);
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* Buzzer_stop
|
* Buzzer_stop
|
||||||
* Description of function
|
* Stops the repeating buzzer tone
|
||||||
|
*
|
||||||
|
* @param self THe buzzer instance to stop
|
||||||
*
|
*
|
||||||
* @param self
|
|
||||||
* @param
|
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
@@ -143,10 +148,11 @@ extern void Buzzer_stop(struct Buzzer* self);
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* Buzzer_singleTone
|
* Buzzer_singleTone
|
||||||
* Description of function
|
* Creates a single tone with the length given in pulseWidth
|
||||||
|
*
|
||||||
|
* @param self The buzzer instance to use
|
||||||
|
* @param pulseWidth The length of the tone in ms
|
||||||
*
|
*
|
||||||
* @param self
|
|
||||||
* @param pulseWidth
|
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
/// @file CachedStorage.h
|
/// @file CachedStorage.h
|
||||||
/// @brief EEPROM driver including local caching (for one page)
|
/// @brief Generic memory cache
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
// Micro-Key bv
|
// Micro-Key bv
|
||||||
// Industrieweg 28, 9804 TG Noordhorn
|
// Industrieweg 28, 9804 TG Noordhorn
|
||||||
@@ -20,7 +20,7 @@
|
|||||||
/// @defgroup {group_name} {group_description}
|
/// @defgroup {group_name} {group_description}
|
||||||
/// Description
|
/// Description
|
||||||
|
|
||||||
/// @file adc.h
|
/// @file CachedStorage.h
|
||||||
/// @ingroup {group_name}
|
/// @ingroup {group_name}
|
||||||
|
|
||||||
#ifndef _CACHEDEEPROM_H_
|
#ifndef _CACHEDEEPROM_H_
|
||||||
@@ -65,40 +65,135 @@ struct CachedStorage
|
|||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
/**
|
/** ----------------------------------------------------------------------------
|
||||||
* Initializes the EEPROM hardware and reads the flash page
|
* CachedStorage_construct
|
||||||
*/
|
* Constructor for a new cached storage instance
|
||||||
|
* Function makes use of MALLOC
|
||||||
|
*
|
||||||
|
* @param self The cache instance
|
||||||
|
* @param memoryDevice The memory device to use on which the
|
||||||
|
* cache is located
|
||||||
|
* @param pageNumber The pageNumber of the memory section on
|
||||||
|
* which the cache is located.
|
||||||
|
* This is usually for FLASH or EEPROM
|
||||||
|
* devices and required for PAGE-ERASE
|
||||||
|
* functionality. Can be set to any random
|
||||||
|
* value if PAGE-ERASE is not necessary
|
||||||
|
* @param cacheSize The size of the cache.
|
||||||
|
* This value is 32bit oriented and
|
||||||
|
* NOT BYTE-WISE.
|
||||||
|
* The memory allocation will internally
|
||||||
|
* re-calculate to bytes
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if constructor was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
ErrorStatus CachedStorage_construct(struct CachedStorage* self, struct MemoryDevice* memoryDevice, unsigned int pageNumber, size_t cacheSize);
|
ErrorStatus CachedStorage_construct(struct CachedStorage* self, struct MemoryDevice* memoryDevice, unsigned int pageNumber, size_t cacheSize);
|
||||||
|
|
||||||
/**
|
|
||||||
* Terminates the EEPROM hardware. SPI port is available again
|
/** ----------------------------------------------------------------------------
|
||||||
*/
|
* CachedStorage_destruct
|
||||||
|
* Destructor for a cached storage instance
|
||||||
|
* Function makes use of FREE
|
||||||
|
*
|
||||||
|
* @param self The cache instance to destruct
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
void CachedStorage_destruct(struct CachedStorage* self);
|
void CachedStorage_destruct(struct CachedStorage* self);
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes four bytes to the storage buffer
|
/** ----------------------------------------------------------------------------
|
||||||
*/
|
* CachedStorage_writeWord
|
||||||
|
* Function to write a word (32bit) to cache
|
||||||
|
*
|
||||||
|
* @param self The cache instance
|
||||||
|
* @param offset Offset within the cache to put the data
|
||||||
|
* @param value The value/data to write
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
void CachedStorage_writeWord(struct CachedStorage* self, int offset, uint32_t value);
|
void CachedStorage_writeWord(struct CachedStorage* self, int offset, uint32_t value);
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes binary data to the storage buffer
|
/** ----------------------------------------------------------------------------
|
||||||
*/
|
* CachedStorage_writeBlob
|
||||||
|
* Function to write a blob (any given format/amount of data) to cache; hence
|
||||||
|
* the void pointer.
|
||||||
|
* The function verifies cache boundaries using the offset and blob size
|
||||||
|
* blobsize is 32bit oriented, NOT BYTE
|
||||||
|
*
|
||||||
|
* @param self The cache instance
|
||||||
|
* @param offset Offset within the cache to put the data
|
||||||
|
* @param blob Void pointer to the data to be written
|
||||||
|
* @param blobSize sizeof the blob structure. Give in 32bit,
|
||||||
|
* NOT IN BYTES
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
void CachedStorage_writeBlob(struct CachedStorage* self, int offset, const void* blob, size_t blobSize);
|
void CachedStorage_writeBlob(struct CachedStorage* self, int offset, const void* blob, size_t blobSize);
|
||||||
|
|
||||||
|
|
||||||
/**
|
/** ----------------------------------------------------------------------------
|
||||||
* Reads four bytes from the storage buffer
|
* CachedStorage_readWord
|
||||||
*/
|
* Function to read a word (32bit) from cache
|
||||||
|
*
|
||||||
|
* @param self The cache instance
|
||||||
|
* @param offset Offset within the cache to put the data
|
||||||
|
*
|
||||||
|
* @return uint32_t The read data
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
uint32_t CachedStorage_readWord(struct CachedStorage* self, int offset);
|
uint32_t CachedStorage_readWord(struct CachedStorage* self, int offset);
|
||||||
|
|
||||||
/**
|
|
||||||
* Reads binary data from the storage buffer
|
/** ----------------------------------------------------------------------------
|
||||||
*/
|
* CachedStorage_readBlob
|
||||||
|
* Function to read a blob (any given format/amount of data) from cache; hence
|
||||||
|
* the void pointer.
|
||||||
|
* The function verifies cache boundaries using the offset
|
||||||
|
*
|
||||||
|
* @param self The cache instance
|
||||||
|
* @param offset Offset within the cache to put the data
|
||||||
|
*
|
||||||
|
* @return void* Void pointer to the blob structure
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
const void* CachedStorage_readBlob(struct CachedStorage* self, int offset);
|
const void* CachedStorage_readBlob(struct CachedStorage* self, int offset);
|
||||||
|
|
||||||
/**
|
|
||||||
* Writes the storage buffer to EEPROM (only if the contents differ)
|
/** ----------------------------------------------------------------------------
|
||||||
*/
|
* CachedStorage_commit
|
||||||
|
* Function that puts the data from cache to the memory device.
|
||||||
|
* This function will verify that the content of the cache is actually different
|
||||||
|
* from the conent of the memory location. If data is equal, not write action
|
||||||
|
* will be performed
|
||||||
|
* In case of memory that needs PAGE-ERASE prior to write, the erase function
|
||||||
|
* will be called automatically.
|
||||||
|
*
|
||||||
|
* @param self The cache instance
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
void CachedStorage_commit(struct CachedStorage* self);
|
void CachedStorage_commit(struct CachedStorage* self);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -55,10 +55,9 @@
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* CoverSolenoid_construct
|
* CoverSolenoid_construct
|
||||||
* Constructor for a CoverSolenoid
|
* Constructor for the CoverSolenoid
|
||||||
*
|
*
|
||||||
* @param self
|
* @param solenoidGpio The GPIO to use
|
||||||
* @param solenoidGpio
|
|
||||||
|
|
||||||
* @return ErrorStatus
|
* @return ErrorStatus
|
||||||
*
|
*
|
||||||
@@ -71,10 +70,8 @@ extern ErrorStatus CoverSolenoid_construct(struct Gpio* solenoidGpio);
|
|||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* CoverSolenoid_destruct
|
* CoverSolenoid_destruct
|
||||||
* Destructor for a CoverSolenoid
|
* Destructor for a CoverSolenoid
|
||||||
*
|
|
||||||
* @param self
|
|
||||||
|
|
||||||
* @return ErrorStatus
|
* @return void
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
* -----------------------------------------------------------------------------
|
* -----------------------------------------------------------------------------
|
||||||
@@ -86,8 +83,6 @@ extern void CoverSolenoid_destruct(void);
|
|||||||
* CoverSolenoid_unlock
|
* CoverSolenoid_unlock
|
||||||
* Opens the CoverSolenoid
|
* Opens the CoverSolenoid
|
||||||
*
|
*
|
||||||
* @param self
|
|
||||||
*
|
|
||||||
* @return ErrorStatus
|
* @return ErrorStatus
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
@@ -100,8 +95,6 @@ extern ErrorStatus CoverSolenoid_unlock(void);
|
|||||||
* CoverSolenoid_lock
|
* CoverSolenoid_lock
|
||||||
* Closes the CoverSolenoid
|
* Closes the CoverSolenoid
|
||||||
*
|
*
|
||||||
* @param self
|
|
||||||
*
|
|
||||||
* @return ErrorStatus
|
* @return ErrorStatus
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
@@ -112,10 +105,8 @@ extern ErrorStatus CoverSolenoid_lock(void);
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* CoverSolenoid_getGpio
|
* CoverSolenoid_getGpio
|
||||||
* Description of function
|
* returns the GPIO that is used as CoverSolenoid
|
||||||
*
|
*
|
||||||
* @param
|
|
||||||
* @param
|
|
||||||
* @return struct Gpio*
|
* @return struct Gpio*
|
||||||
*
|
*
|
||||||
* @todo
|
* @todo
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ struct DACDevice
|
|||||||
*
|
*
|
||||||
* @param self DAC object
|
* @param self DAC object
|
||||||
* @param write Pointer to write function
|
* @param write Pointer to write function
|
||||||
|
* @param readback Pointer to value readback function
|
||||||
|
* @param resolutionsInBits The resolution of this ADC device in
|
||||||
|
* number of bits
|
||||||
*
|
*
|
||||||
* @return ErrorStatus SUCCESS if construction was successful
|
* @return ErrorStatus SUCCESS if construction was successful
|
||||||
* ERROR otherwise
|
* ERROR otherwise
|
||||||
@@ -99,7 +102,7 @@ extern void DACDevice_destruct(struct DACDevice* self);
|
|||||||
* Writes a value to the DAC device output
|
* Writes a value to the DAC device output
|
||||||
*
|
*
|
||||||
* @param self DAC object
|
* @param self DAC object
|
||||||
* @param voltage value in volt (signed) to write to output
|
* @param voltage value to write to output
|
||||||
*
|
*
|
||||||
* @return ErrorStatus
|
* @return ErrorStatus
|
||||||
*
|
*
|
||||||
@@ -109,6 +112,18 @@ extern void DACDevice_destruct(struct DACDevice* self);
|
|||||||
extern ErrorStatus DACDevice_write(const struct DACDevice* self, uint32_t voltage);
|
extern ErrorStatus DACDevice_write(const struct DACDevice* self, uint32_t voltage);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DACDevice_getCurrentValue
|
||||||
|
* returns the currently applied value from the DAC
|
||||||
|
*
|
||||||
|
* @param self DAC object
|
||||||
|
*
|
||||||
|
* @return uint32_t The value that is currently applied to
|
||||||
|
* the DAC device
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern uint32_t DACDevice_getCurrentValue(const struct DACDevice* self);
|
extern uint32_t DACDevice_getCurrentValue(const struct DACDevice* self);
|
||||||
|
|
||||||
#endif /* INC_DACDEVICE_H_ */
|
#endif /* INC_DACDEVICE_H_ */
|
||||||
|
|||||||
@@ -99,6 +99,38 @@ struct DisplayDevice
|
|||||||
// Function declarations
|
// Function declarations
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_construct
|
||||||
|
* Constructor for a new Display Device
|
||||||
|
* If a specific function is not implemented at the display device it is valid
|
||||||
|
* to use NULL pointer instead
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param parameters Parameters for the display device
|
||||||
|
* @param reset Pointer to DISPLAY RESET function
|
||||||
|
* @param setState Pointer to DISPLAY SETSTATE function
|
||||||
|
* @param backspace Pointer to DISPLAY BACKSPACE function
|
||||||
|
* @param setCursorToPosition Pointer to DISPLAY SETCURSORTO POSITION
|
||||||
|
* function
|
||||||
|
* @param writeCharacter Pointer to DISPLAY WRITECHARACTER function
|
||||||
|
* this function writes on single character
|
||||||
|
* @param write Pointer to DIAPLAY WRITE function
|
||||||
|
* @param clear Pointer to DISPLAY CLEARALL function
|
||||||
|
* @param clearLine Pointer to DISPLAY CLEARLINE function
|
||||||
|
* @param setBrightness Pointer to DISPLAY SETBRIGHTNESS function
|
||||||
|
* @param setContrast Pointer to DISPLAY SETCONTRAST function
|
||||||
|
* @param invert Pointer to DISPLAY INVERT function
|
||||||
|
* @param setBlinkingCursor Pointer to DISPLAY SETBLINKINGCURSOR
|
||||||
|
* function
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if constructor was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct DisplayDeviceParameters* parameters,
|
extern ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct DisplayDeviceParameters* parameters,
|
||||||
DisplayResetFunction reset,
|
DisplayResetFunction reset,
|
||||||
DisplaySetStateFunction setState,
|
DisplaySetStateFunction setState,
|
||||||
@@ -113,17 +145,237 @@ extern ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct D
|
|||||||
DisplayInvertFunction invert,
|
DisplayInvertFunction invert,
|
||||||
DisplaySetBlinkingCursor setBlinkingCursor);
|
DisplaySetBlinkingCursor setBlinkingCursor);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_destruct
|
||||||
|
* Destructor for Display Device
|
||||||
|
*
|
||||||
|
* @param self The device instance to destruct
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
extern void DisplayDevice_destruct (struct DisplayDevice* self);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_reset
|
||||||
|
* RESET the complete display device
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_reset(const struct DisplayDevice* self);
|
extern ErrorStatus DisplayDevice_reset(const struct DisplayDevice* self);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_setState
|
||||||
|
* Sets the display to new state
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param state Can be either ON or OFF
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
extern ErrorStatus DisplayDevice_setState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_backspace
|
||||||
|
* Display backspace function. Set cursor one position back and delete character
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_backspace(const struct DisplayDevice* self);
|
extern ErrorStatus DisplayDevice_backspace(const struct DisplayDevice* self);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_setCursorToPosition
|
||||||
|
* Sets the cursor to the position given in arguments row/column
|
||||||
|
* DisplayDevice function in behind verifies the position
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param row Row to use (starts with 1, not 0)
|
||||||
|
* @param column Column to use (Starts with 1, not 0)
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
* Especially when position was not valid
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
extern ErrorStatus DisplayDevice_setCursorToPosition(const struct DisplayDevice* self, unsigned int row, unsigned int column);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_writeCharacter
|
||||||
|
* Write a single character given in argument buffer to position given in
|
||||||
|
* arguments row/column
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param buffer Pointer to the character to write
|
||||||
|
* @param row Row to use (starts with 1, not 0)
|
||||||
|
* @param column Column to use (Starts with 1, not 0)
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
* Especially when position was not valid
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column);
|
extern ErrorStatus DisplayDevice_writeCharacter(const struct DisplayDevice* self, const char* buffer, unsigned int row, unsigned int column);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_write
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param buffer Pointer to the string to write
|
||||||
|
* @param length The length (number in characters) of the
|
||||||
|
* message to write
|
||||||
|
* @param row Row to use (starts with 1, not 0)
|
||||||
|
* @param column Column to use (Starts with 1, not 0)
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
* Especially when position or string length
|
||||||
|
* are not valid
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column);
|
extern ErrorStatus DisplayDevice_write(const struct DisplayDevice* self, const char* buffer, unsigned int length, unsigned int row, unsigned int column);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_clear
|
||||||
|
* Function to clear the complete display
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_clear(const struct DisplayDevice* self);
|
extern ErrorStatus DisplayDevice_clear(const struct DisplayDevice* self);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_clearLine
|
||||||
|
* Function to clear the line given in argument row
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param row Row to use (starts with 1, not 0)
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
* Especially when position was not valid
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, unsigned int row);
|
extern ErrorStatus DisplayDevice_clearLine(const struct DisplayDevice* self, unsigned int row);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_setBrightness
|
||||||
|
* Sets the display brightness
|
||||||
|
* Must be a value between the min and max brightness given in the display device
|
||||||
|
* parameters in the constructor
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param brightness The brightness value
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
* Especially when brightness value is
|
||||||
|
* outside boundaries
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, unsigned int brightness);
|
extern ErrorStatus DisplayDevice_setBrightness(const struct DisplayDevice* self, unsigned int brightness);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_setContrast
|
||||||
|
* Sets the display contrast
|
||||||
|
* Must be a value between the min and max contrast given in the display device
|
||||||
|
* parameters in the constructor
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param contrast The contrast value
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
* Especially when contrast value is
|
||||||
|
* outside boundaries
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, unsigned int contrast);
|
extern ErrorStatus DisplayDevice_setContrast(const struct DisplayDevice* self, unsigned int contrast);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_invert
|
||||||
|
* Function to invert the display representation
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_invert(const struct DisplayDevice* self);
|
extern ErrorStatus DisplayDevice_invert(const struct DisplayDevice* self);
|
||||||
|
|
||||||
|
|
||||||
|
/** ----------------------------------------------------------------------------
|
||||||
|
* DisplayDevice_setBlinkingCursorState
|
||||||
|
* Sets the state for a blinking cursor
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @param self The device instance
|
||||||
|
* @param state Can either be ON or OFF
|
||||||
|
*
|
||||||
|
* @return ErrorStatus SUCCESS if function was successful
|
||||||
|
* ERROR otherwise
|
||||||
|
*
|
||||||
|
* @todo
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
extern ErrorStatus DisplayDevice_setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
extern ErrorStatus DisplayDevice_setBlinkingCursorState(const struct DisplayDevice* self, DisplayDevice_functionalState state);
|
||||||
|
|
||||||
#endif /* INC_DISPLAYDEVICE_H_ */
|
#endif /* INC_DISPLAYDEVICE_H_ */
|
||||||
|
|||||||
@@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* HighVoltageDetection_construct
|
* HighVoltageDetection_construct
|
||||||
* Constructs a HighVoltage detection
|
* Constructs the HighVoltage detection
|
||||||
*
|
*
|
||||||
* @param HV0_gpio
|
* @param HV0_gpio
|
||||||
* @param HV1_gpio
|
* @param HV1_gpio
|
||||||
|
|||||||
@@ -81,9 +81,10 @@ struct Interlock
|
|||||||
|
|
||||||
/** ----------------------------------------------------------------------------
|
/** ----------------------------------------------------------------------------
|
||||||
* Interlock_construct
|
* Interlock_construct
|
||||||
* Description of function
|
* Constructor for an Interlock
|
||||||
|
* Also creates and starts a FreeRTOS task for IO debouncing
|
||||||
*
|
*
|
||||||
* @param self
|
* @param self The object to create
|
||||||
* @param NO
|
* @param NO
|
||||||
* @param NOEXTI
|
* @param NOEXTI
|
||||||
* @param NC
|
* @param NC
|
||||||
|
|||||||
@@ -100,6 +100,28 @@ ErrorStatus DisplayDevice_construct (struct DisplayDevice* self, struct DisplayD
|
|||||||
return returnValue;
|
return returnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void DisplayDevice_destruct (struct DisplayDevice* self)
|
||||||
|
{
|
||||||
|
if (self->initialized)
|
||||||
|
{
|
||||||
|
self->_reset = NULL;
|
||||||
|
self->_setState = NULL;
|
||||||
|
self->_backspace = NULL;
|
||||||
|
self->_setCursorToPosition = NULL;
|
||||||
|
self->_writeCharacter = NULL;
|
||||||
|
self->_write = NULL;
|
||||||
|
self->_clear = NULL;
|
||||||
|
self->_clearLine = NULL,
|
||||||
|
self->_setBrightness = NULL;
|
||||||
|
self->_setContrast = NULL;
|
||||||
|
self->_invert = NULL;
|
||||||
|
self->_setBlinkingCursor = NULL;
|
||||||
|
|
||||||
|
self->initialized = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ErrorStatus DisplayDevice_reset(const struct DisplayDevice* self)
|
ErrorStatus DisplayDevice_reset(const struct DisplayDevice* self)
|
||||||
{
|
{
|
||||||
ErrorStatus returnValue = SUCCESS;
|
ErrorStatus returnValue = SUCCESS;
|
||||||
|
|||||||
@@ -283,7 +283,7 @@ static void loggerTask(void* parameters)
|
|||||||
|
|
||||||
#if defined(ENABLE_SERIAL_LOGGING)
|
#if defined(ENABLE_SERIAL_LOGGING)
|
||||||
// Formatted print
|
// Formatted print
|
||||||
snprintf(str, sizeof(str) / sizeof(str[0]), "%s[%s] %09d %s, %s, %d: %s%s\n",
|
snprintf(str, sizeof(str) / sizeof(str[0]), "%s[%s] %09d %s, %s, %d: %s%s\n\r",
|
||||||
vt100Prefix,
|
vt100Prefix,
|
||||||
(logQueueItem.logType == LOGTYPE_DEBUG) ? "DBG" :
|
(logQueueItem.logType == LOGTYPE_DEBUG) ? "DBG" :
|
||||||
(logQueueItem.logType == LOGTYPE_INFO) ? "INF" :
|
(logQueueItem.logType == LOGTYPE_INFO) ? "INF" :
|
||||||
|
|||||||
@@ -86,6 +86,10 @@
|
|||||||
#define SPI_LCD_RX_QUEUE (32)
|
#define SPI_LCD_RX_QUEUE (32)
|
||||||
#define SPI_LCD_TX_QUEUE (32)
|
#define SPI_LCD_TX_QUEUE (32)
|
||||||
|
|
||||||
|
// Logger Settings
|
||||||
|
#define LOGGER_STACK_SIZE (512)
|
||||||
|
#define LOGGER_TASK_PRIORITY (3)
|
||||||
|
|
||||||
// Buzzer Settings
|
// Buzzer Settings
|
||||||
#define BUZZER_STACK_SIZE (128)
|
#define BUZZER_STACK_SIZE (128)
|
||||||
#define BUZZER_TASK_PRIORITY (3)
|
#define BUZZER_TASK_PRIORITY (3)
|
||||||
@@ -709,7 +713,9 @@ static ErrorStatus initPlatformDevices (void)
|
|||||||
returnValue = Led_construct(ledInternGreen, ledInternOrange, ledBicolourGreen, ledBicolourRed);
|
returnValue = Led_construct(ledInternGreen, ledInternOrange, ledBicolourGreen, ledBicolourRed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* --------------------------------------------------------------------*/
|
||||||
|
/* High Voltage Detection */
|
||||||
|
/* --------------------------------------------------------------------*/
|
||||||
if (returnValue == SUCCESS)
|
if (returnValue == SUCCESS)
|
||||||
{
|
{
|
||||||
returnValue = HighVoltageDetection_construct(hv0Present, hv1Present, hv2Present);
|
returnValue = HighVoltageDetection_construct(hv0Present, hv1Present, hv2Present);
|
||||||
@@ -758,7 +764,7 @@ static ErrorStatus initPlatformDevices (void)
|
|||||||
/* --------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------*/
|
||||||
if (returnValue == SUCCESS)
|
if (returnValue == SUCCESS)
|
||||||
{
|
{
|
||||||
returnValue = Logger_construct(mainLog, &uart1->device, 1, 512);
|
returnValue = Logger_construct(mainLog, &uart1->device, LOGGER_TASK_PRIORITY, LOGGER_STACK_SIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* --------------------------------------------------------------------*/
|
/* --------------------------------------------------------------------*/
|
||||||
|
|||||||
Reference in New Issue
Block a user