-
Notifications
You must be signed in to change notification settings - Fork 10
/
rgbled.h
37 lines (28 loc) · 1.05 KB
/
rgbled.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* VFD Deluxe - Firmware for VFD Modular Clock mk2
* (C) 2011-13 Akafugu Corporation
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
*/
#ifndef RGBLED_H_
#define RGBLED_H_
#include <stdbool.h>
#include <avr/io.h>
#define PCA9685_SLAVE_ADDR 0x40
void pca9685_wake(void);
void pca9685_PWM_precale(uint8_t prescale);
void pca9685_set_channel(uint8_t channel, uint16_t value);
void set_rgb_all(uint16_t r, uint16_t g, uint16_t b);
void set_rgb_ch(uint8_t channel, uint16_t r, uint16_t g, uint16_t b);
// sets backlight mode based preset
void set_rgb_mode(uint8_t mode);
void rgb_tick(void);
#endif // RGBLED_H_