Missing files for SWo

git-svn-id: https://svn.vbchaos.nl/svn/hsb/trunk@236 05563f52-14a8-4384-a975-3d1654cca0fa
This commit is contained in:
mmi
2017-10-05 08:33:15 +00:00
parent c860b5b3b4
commit 3990c23a79
9 changed files with 481 additions and 19 deletions

View File

@@ -116,16 +116,21 @@
// Type definitions.
// -----------------------------------------------------------------------------
struct MAX5715;
struct MAX5715_DAC
{
struct MAX5715* parent;
uint8_t id;
uint16_t value;
bool initialized;
};
struct MAX5715
{
const struct IODevice* device;
struct MAX5715_DAC dac[MAX5715_NUMBER_OF_DACS];
bool initialized;
};
// -----------------------------------------------------------------------------
@@ -156,7 +161,7 @@ extern ErrorStatus MAX5715_construct(struct MAX5715* self, const struct IODevice
*
* @param self
*
* @return ErrorStatus SUCCESS if initialisation was successful
* @return ErrorStatus SUCCESS if destruction was successful
* ERROR otherwise
*
* @todo
@@ -171,7 +176,7 @@ extern void MAX5715_destruct(struct MAX5715* self);
*
* @param parameters SpiParameters struct to fill
*
* @return ErrorStatus SUCCESS if initialisation was successful
* @return ErrorStatus SUCCESS if function was successful
* ERROR otherwise
*
* @todo
@@ -187,7 +192,8 @@ extern ErrorStatus MAX5715_getSpiParameters(struct SpiParameters* parameters);
*
* @param self The MAX5715 instance
* @param command The command to be sent
* @return ErrorStatus SUCCESS if initialisation was successful
*
* @return ErrorStatus SUCCESS if function was successful
* ERROR otherwise
*
* @todo
@@ -195,19 +201,38 @@ extern ErrorStatus MAX5715_getSpiParameters(struct SpiParameters* parameters);
*/
extern ErrorStatus MAX5715_sendCommand(const struct MAX5715* self, uint8_t command, uint16_t data);
/** ----------------------------------------------------------------------------
* MAX5715DAC_setOutput
* Sets the output of the DAC in argument self to the value given in argument
* value
* MAX5715Channel_construct
* Constructor for one of the channels on the MAX5715 DAC
*
* @param self The DAC to use
* @param value The value to set
* @return ErrorStatus SUCCESS if initialisation was successful
* @param self The channel object to initialize
* @param parent The parent object that the channel belongs
* to
* @param id The channel number
*
* @return ErrorStatus SUCCESS if construction was successful
* ERROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus MAX5715DAC_setOutput(struct MAX5715_DAC self, uint16_t value);
extern ErrorStatus MAX5715Channel_construct(struct MAX5715_DAC* self, struct MAX5715* parent, size_t id);
/** ----------------------------------------------------------------------------
* MAX5715Channel_setValue
* Sends value to the DAC channel in self
*
* @param self The DAC object
* @param value Value to write
*
* @return ErrorStatus SUCCESS if setting value was successful
* ERROR otherwise
*
* @todo
* -----------------------------------------------------------------------------
*/
extern ErrorStatus MAX5715Channel_setValue(struct MAX5715_DAC* self, uint16_t value);
#endif /* INC_MAX5715_H_ */