1 /* (CC-BY-NC-SA) ROBIN KRENS - ROBIN @ ROBINKRENS.NL
4 * 2019/7/25 - ROBIN KRENS
8 * Basic driver for the TM1637. The TM1637 is 7 segment
9 * ledclock peripheral. Communication is over I2C.
18 #include <sys/robsys.h>
20 #include <lib/regfunc.h>
21 #include <lib/string.h>
23 #include <drivers/tm1637.h>
28 /* Program the peripheral input clock in I2C_CR2 Register in order to generate correct timings
29 Configure the clock control registers
30 Configure the rise time register
31 Program the I2C_CR1 register to enable the peripheral
32 Set the START bit in the I2C_CR1 register to generate a Start condition
34 ENABLE GPIOB6 and B7*/
36 //regw_u8(RCC_APB1ENR, 0x1, 21, SETBIT);
37 //regw_u32(RCC_APB2ENR, 0x1, 3, SETBIT);
38 // //regw_u8(AFIO_EVCR, 0x89, 0, SETBIT);// set event control register, output on ?
40 // regw_u32(GPIOB_CRL, 0xEE444444, 0, OWRITE);