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

DGUS II LCD Driver Utility functions. More...

#include <stddef.h>
#include <stdint.h>
#include "dgus_reg.h"
#include "dgus.h"
Include dependency graph for dgus_control_curve.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CURVE_ADDRESS   0x0310
 
#define CURVE_HEADER   0x5AA5
 

Functions

struct __attribute__ ((packed)) realtime_curve
 SP Structure for realtime curve 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...
 
DGUS_RETURN dgus_curve_send_data (curve *cur)
 Send the data we have aggregated in the curve instance. 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_reset (curve *cur, uint8_t chan_id)
 Reset a curve on screen. This will not affect the buffer. More...
 
void dgus_curve_destroy (curve *cur)
 Destroy a curve buffer and all. More...
 

Variables

 realtime_curve
 

Detailed Description

DGUS II LCD Driver Utility functions.

Author
Barry Carter
Date
01 Jan 2021

Macro Definition Documentation

◆ CURVE_ADDRESS

#define CURVE_ADDRESS   0x0310

VAR address to write each datapoint to

◆ CURVE_HEADER

#define CURVE_HEADER   0x5AA5

CMD header to enable write mode

Function Documentation

◆ __attribute__()

struct __attribute__ ( (packed)  )

SP Structure for realtime curve control.

Returns
typedef struct

◆ 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

◆ realtime_curve

realtime_curve

Curve Data