]> git.karo-electronics.de Git - oswald.git/blobdiff - metawatch/oswald_hal.c
Power saving changes, add new fonts, bitmaps and screens
[oswald.git] / metawatch / oswald_hal.c
index d731b51fa75f24f38ab6717ddcc297f1eecfbc1f..16b1cd1e4a58c659720f29454972a5215e3ab7a0 100644 (file)
 #include "mw_bt.h"
 #include "bt_hci.h"
 #include "bt_l2cap.h"
+#include "bluetooth_init_cc256x.h"
+#include "mw_acc.h"
 
 #include "oswald.h"
 #include "oswald_hal.h"
 
 #include "calendar.h"
 
+
+const char *hal_get_version_string(void)
+{
+       return MW_MAIN_VERSION;
+}
+
+const char *hal_get_buildno_string(void)
+{
+       return BUILDNO;
+}
+
+const char *hal_get_radio_version_string(void)
+{
+       return cc256x_version;
+}
+
 void hal_lcd_set_pixel(uint8_t x, uint8_t y, uint8_t color)
 {
        x %= 96;
@@ -79,6 +97,7 @@ void hal_get_rtc(clock_state *rtc)
        rtc->day = RTCDAY;
        rtc->month = RTCMON;
        rtc->year = RTCYEAR;
+       rtc->wday = RTCDOW;
 }
 
 void hal_set_rtc(clock_state *rtc, boolean set_sec)
@@ -232,3 +251,21 @@ void hal_bluetooth_send_data(const void *mdat, uint16_t mlen)
        bt_l2cap_send_channel(0x40, mdat, mlen);
 }
 
+/*
+ * Control the accelerometer
+ */
+void hal_accelerometer_enable(void)
+{
+       mw_acc_enable();
+}
+
+void hal_accelerometer_disable(void)
+{
+       mw_acc_disable();
+}
+
+uint16_t hal_amblight_get_val(void)
+{
+       return mw_get_amblight_adc_val();
+}
+