Add I2C communication. Start writing DMX TX. Break generation already implemented

This commit is contained in:
2022-08-08 22:30:19 +02:00
parent b118a010e3
commit 446a253936
7 changed files with 365 additions and 5 deletions

14
include/dmx.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef _DMX_H_
#define _DMX_H_
#include <stdint.h>
void dmx_init(uint8_t *data, uint32_t universe_length, GPIO_TypeDef *tx_port, uint8_t tx_pin,
uint16_t dmx_delay, uint16_t dmx_break_len, uint16_t break_pause);
void dmx_stream_start(void);
void dmx_stream_stop(void);
#endif /* _DMX_H_ */

14
include/i2c.h Normal file
View File

@@ -0,0 +1,14 @@
#ifndef _I2C_H_
#define _I2C_H_
#include <stdint.h>
void i2c_init(void);
void i2c_reset(void);
int i2c_write(uint8_t i2c_addr, const uint8_t *data, uint8_t len);
int i2c_read(uint8_t i2c_addr, uint8_t command, uint8_t *data, uint8_t len);
#endif /* _I2C_H_ */