Loading...
Searching...
No Matches
dac.h File Reference

DAC peripheral driver interface definition. More...

Detailed Description

DAC peripheral driver interface definition.

Author
Simon Brummer simon.nosp@m..bru.nosp@m.mmer@.nosp@m.haw-.nosp@m.hambu.nosp@m.rg.d.nosp@m.e
Hauke Petersen hauke.nosp@m..pet.nosp@m.ersen.nosp@m.@fu-.nosp@m.berli.nosp@m.n.de

Definition in file dac.h.

#include <stddef.h>
#include <stdint.h>
#include <limits.h>
#include "periph_cpu.h"
#include "periph_conf.h"
+ Include dependency graph for dac.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define DAC_UNDEF   (UINT_FAST8_MAX)
 Default DAC undefined value.
 
#define DAC_LINE(x)
 Default DAC access macro.
 

Typedefs

typedef uint_fast8_t dac_t
 Define default DAC type identifier.
 
typedef void(* dma_cb_t) (void *arg)
 Signature of event callback functions triggered from interrupts.
 

Enumerations

enum  { DAC_OK = 0 , DAC_NOLINE = -1 }
 Return codes used by the DAC driver interface. More...
 

Functions

int8_t dac_init (dac_t line)
 Initialize the given DAC line.
 
void dac_set (dac_t line, uint16_t value)
 Write a value onto DAC Device on a given Channel.
 
void dac_poweron (dac_t line)
 Enable the given DAC line.
 
void dac_poweroff (dac_t line)
 Disable the given DAC line.
 
uint32_t dac_get_freq (void)
 Get the sample rate of the DAC in Hz.
 
int dac_play_setup (dac_t line, dma_cb_t cb, void *arg)
 Configure DAC line for playing sample buffer.
 
void dac_play (dac_t line, const uint16_t *buf, size_t len, uint8_t flags)
 Start playing sample buffer.
 
void dac_play_teardown (dac_t line)
 Release DAC line.
 
#define DAC_PLAY_LOOPED   (1 << 0)
 Options for dac_play.