DGUS LCD Library  1
/github/workspace/dgus_control_curve.c File Reference

DGUS II LCD Driver Utility functions. More...

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <stddef.h>
#include <time.h>
#include "dgus.h"
#include "dgus_control_curve.h"
Include dependency graph for dgus_control_curve.c:

Typedefs

typedef struct curve_data_t curve_data
 

Functions

struct __attribute__ ((packed))
 position and size of the control More...
 
curve * dgus_curve_buffer_create (uint8_t num_curves, uint8_t datapoint_buffer_len)
 Initialise a new curve buffer, allocating the memory required. More...
 
void dgus_curve_init_channel (curve *cur, uint8_t channel_id)
 Initialise a channel. More...
 
void dgus_curve_destroy (curve *cur)
 Destroy a curve buffer and all. More...
 
DGUS_RETURN dgus_curve_add_data (curve *cur, uint8_t chan_id, uint16_t data)
 Append some data to the curve buffer for batch sending. More...
 
DGUS_RETURN dgus_curve_send_data (curve *cur)
 Send the data we have aggregated in the curve instance. More...
 
DGUS_RETURN dgus_curve_reset (curve *cur, uint8_t chan_id)
 Reset a curve on screen. This will not affect the buffer. More...
 

Variables

 dgus_curve_data
 

Detailed Description

DGUS II LCD Driver Utility functions.

Author
Barry Carter
Date
01 Jan 2021

Typedef Documentation

◆ curve_data

typedef struct curve_data_t curve_data

local app Storage for the curve data

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

position and size of the control

System configuration information.

Brightnedd LED configuration.

Returns
typedef struct

< Brightness while not in idle (0x0- 0x64)

< Brightness while in idle (0x0- 0x64)

< Time before we idle /5ms

◆ dgus_curve_add_data()

DGUS_RETURN dgus_curve_add_data ( curve *  cur,
uint8_t  chan_id,
uint16_t  data 
)

Append some data to the curve buffer for batch sending.

Parameters
curcurve handle
chan_idchannel id
datadata to append
Returns
DGUS_RETURN buffer full etc

◆ dgus_curve_buffer_create()

curve* dgus_curve_buffer_create ( uint8_t  num_curves,
uint8_t  datapoint_buffer_len 
)

Initialise a new curve buffer, allocating the memory required.

Warning
See datasheet regarding memory ranges. If you enable a channel, it will consume VP memory. You cannot re-use this memory for other controls. For example, channel 0: 0x1000-0x17FF channel 1: 0x1800-0x1FFF .. channel 7: 0x4800-0x4FFF
Note
if a channel is not in use, you may re-use the memory. If you use the channel at all, anywhere, you cannot use this memory. i.e. using a different page and reusing curve memory will not work
Parameters
num_curvesHow many channels are enabled on the DGUS
datapoint_buffer_lenHow much data should be send at once
Returns
curve* Opaque reference to the curve

◆ dgus_curve_destroy()

void dgus_curve_destroy ( curve *  cur)

Destroy a curve buffer and all.

Parameters
curcurve

◆ dgus_curve_init_channel()

void dgus_curve_init_channel ( curve *  cur,
uint8_t  channel_id 
)

Initialise a channel.

Parameters
curcurve handle
channel_idchannel id we want to send data to

◆ dgus_curve_reset()

DGUS_RETURN dgus_curve_reset ( curve *  cur,
uint8_t  chan_id 
)

Reset a curve on screen. This will not affect the buffer.

Parameters
curcurve handle
chan_idchannel id
Returns
DGUS_RETURN

◆ dgus_curve_send_data()

DGUS_RETURN dgus_curve_send_data ( curve *  cur)

Send the data we have aggregated in the curve instance.

Parameters
curthe curve handle
Returns
DGUS_RETURN

Variable Documentation

◆ dgus_curve_data

dgus_curve_data

Curve packet format data