OpenCores
URL https://opencores.org/ocsvn/mips32r1/mips32r1/trunk

Subversion Repositories mips32r1

[/] [mips32r1/] [trunk/] [Software/] [demos/] [XD3_I2C/] [src/] [drivers/] [piezo.c] - Blame information for rev 2

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 ayersg
#include "piezo.h"
2
 
3
void Piezo_set(uint32_t count, int enable)
4
{
5
        volatile uint32_t *Piezo = (volatile uint32_t *)PIEZO_ADDRESS;
6
 
7
        if (enable) {
8
                *Piezo = count | 0x1000000;
9
        }
10
        else {
11
                *Piezo = count & ~0x1000000;
12
        }
13
}
14
 
15
void Piezo_play(uint32_t note)
16
{
17
        Piezo_set(note, 1);
18
}
19
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.