mirror of
https://github.com/clockworkpi/PicoCalc.git
synced 2026-03-19 18:42:38 +01:00
This version has the following changes: * return the bios version with REG_ID_VER * Improved backlight setting for LCD and Keyboard * Replaced delay() with a non-blocking delay nbDelay() * Implements monitoring of receive and request events * I2C reset if no events were recorded in previous 2.5 seconds indicating a possible I2C malfunction.
35 lines
697 B
C
35 lines
697 B
C
#ifndef CONF_APP_H
|
|
#define CONF_APP_H
|
|
|
|
#define BIOSVERSION 0x16
|
|
|
|
#define SLAVE_ADDRESS 0x1F
|
|
#define FIFO_SIZE 31
|
|
|
|
#define INT_DURATION_MS 1
|
|
|
|
#ifndef CONFIG_PMU_SDA
|
|
#define CONFIG_PMU_SDA PB11
|
|
#endif
|
|
|
|
#ifndef CONFIG_PMU_SCL
|
|
#define CONFIG_PMU_SCL PB10
|
|
#endif
|
|
|
|
#ifndef CONFIG_PMU_IRQ
|
|
#define CONFIG_PMU_IRQ PC9
|
|
#endif
|
|
|
|
|
|
#define LOW_BAT_VAL 20
|
|
#define LCD_BACKLIGHT_STEP 16
|
|
#define KBD_BACKLIGHT_STEP 32
|
|
|
|
|
|
#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
|
|
#define bitSet(value, bit) ((value) |= (1 << (bit)))
|
|
#define bitClear(value, bit) ((value) &= ~(1 << (bit)))
|
|
#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet((value), (bit)) : bitClear((value), (bit) ))
|
|
|
|
#endif
|