#include "effect.h"
void effect_through(
- UZUME *p,
+ UZURA *p,
const int32_t *src, int32_t *des, int32_t count)
{
int i;
- UZUME_VOLUME_INPUT(p).left = 0;
- UZUME_VOLUME_INPUT(p).right = 0;
- UZUME_VOLUME_OUTPUT(p).left = 0;
- UZUME_VOLUME_OUTPUT(p).right = 0;
+ UZURA_VOLUME_INPUT(p).left = 0;
+ UZURA_VOLUME_INPUT(p).right = 0;
+ UZURA_VOLUME_OUTPUT(p).left = 0;
+ UZURA_VOLUME_OUTPUT(p).right = 0;
for (i = 0; i < count; i+=2) {
*(des + i + 0) = *(src + i + 0);
*(des + i + 1) = *(src + i + 1);
- UZUME_VOLUME_INPUT(p).left += abs(*(src + i + 0)) >> 1;
- UZUME_VOLUME_INPUT(p).right += abs(*(src + i + 1)) >> 1;
- UZUME_VOLUME_OUTPUT(p).left += abs(*(des + i + 0)) >> 1;
- UZUME_VOLUME_OUTPUT(p).right += abs(*(des + i + 1)) >> 1;
+ UZURA_VOLUME_INPUT(p).left += abs(*(src + i + 0)) >> 1;
+ UZURA_VOLUME_INPUT(p).right += abs(*(src + i + 1)) >> 1;
+ UZURA_VOLUME_OUTPUT(p).left += abs(*(des + i + 0)) >> 1;
+ UZURA_VOLUME_OUTPUT(p).right += abs(*(des + i + 1)) >> 1;
}
}
void effect_karaoke(
- UZUME *p,
+ UZURA *p,
const int32_t *src, int32_t *des, int32_t count)
{
int i;
- UZUME_VOLUME_INPUT(p).left = 0;
- UZUME_VOLUME_INPUT(p).right = 0;
- UZUME_VOLUME_OUTPUT(p).left = 0;
- UZUME_VOLUME_OUTPUT(p).right = 0;
+ UZURA_VOLUME_INPUT(p).left = 0;
+ UZURA_VOLUME_INPUT(p).right = 0;
+ UZURA_VOLUME_OUTPUT(p).left = 0;
+ UZURA_VOLUME_OUTPUT(p).right = 0;
for (i = 0; i < count; i+=2) {
*(des + i + 0) = *(src + i + 0) - *(src + i + 1);
*(des + i + 1) = *(src + i + 0) - *(src + i + 1);
- UZUME_VOLUME_INPUT(p).left += abs(*(src + i + 0)) >> 1;
- UZUME_VOLUME_INPUT(p).right += abs(*(src + i + 1)) >> 1;
- UZUME_VOLUME_OUTPUT(p).left += abs(*(des + i + 0)) >> 1;
- UZUME_VOLUME_OUTPUT(p).right += abs(*(des + i + 1)) >> 1;
+ UZURA_VOLUME_INPUT(p).left += abs(*(src + i + 0)) >> 1;
+ UZURA_VOLUME_INPUT(p).right += abs(*(src + i + 1)) >> 1;
+ UZURA_VOLUME_OUTPUT(p).left += abs(*(des + i + 0)) >> 1;
+ UZURA_VOLUME_OUTPUT(p).right += abs(*(des + i + 1)) >> 1;
}
}
#define EFFECT_H
#include <stdint.h>
-#include "uzume.h"
+#include "uzura.h"
void effect_through(
- UZUME *p,
+ UZURA *p,
const int32_t *src, int32_t *des, int32_t count);
void effect_karaoke(
- UZUME *p,
+ UZURA *p,
const int32_t *src, int32_t *des, int32_t count);
#endif
#include "system.h"
#include "lcd.h"
-void system_default(UZUME *p)
+void system_default(UZURA *p)
{
lcd_goto(0, 0);
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).right >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).right >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).right >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).right >> 29));
}
#ifndef SYSTEM_H
#define SYSTEM_H
-#include "uzume.h"
+#include "uzura.h"
-void system_default(UZUME *p);
+void system_default(UZURA *p);
#endif
/**
- * @file uzume.c
+ * @file uzura.c
* @author Copyright(C) 2012 Shinichiro Nakamura
* @brief BlueTank ACB-BF592 Application Sample Codes.
*/
#include "pff.h"
#include "ssm2603.h"
#include "at24c.h"
-#include "uzume.h"
+#include "uzura.h"
#include "mmc.h"
#include "uart.h"
sti(mask);
}
-void uzume_init(UZUME *p, void *user_data)
+void uzura_init(UZURA *p, void *user_data)
{
FATFS fatfs;
#if 0
lcd_goto(0, 0);
lcd_puts("BlueTank");
lcd_goto(0, 1);
- lcd_puts(" UZUME! ");
+ lcd_puts(" UZURA! ");
/*
* オーディオコーデックを初期化する。
at24c_init();
}
-void uzume_set_effect(UZUME *p, UZUME_EFFECT_FUNC effect)
+void uzura_set_effect(UZURA *p, UZURA_EFFECT_FUNC effect)
{
p->effect = effect;
}
-void uzume_set_system(UZUME *p, UZUME_SYSTEM_FUNC system)
+void uzura_set_system(UZURA *p, UZURA_SYSTEM_FUNC system)
{
p->system = system;
}
-void uzume_execute(UZUME *p)
+void uzura_execute(UZURA *p)
{
int i, j;
char lcdbuf[16];
/**
- * @file uzume.h
+ * @file uzura.h
* @author Copyright(C) 2012 Shinichiro Nakamura
* @brief BlueTank ACB-BF592 Application Sample Codes.
*/
* ===============================================================
*/
-#ifndef UZUME_H
-#define UZUME_H
+#ifndef UZURA_H
+#define UZURA_H
#include <stdint.h>
-typedef struct UZUME UZUME;
-typedef void (*UZUME_EFFECT_FUNC)(UZUME *p,
+typedef struct UZURA UZURA;
+typedef void (*UZURA_EFFECT_FUNC)(UZURA *p,
const int32_t *src, int32_t *des, int32_t count);
-typedef void (*UZUME_SYSTEM_FUNC)(UZUME *p);
+typedef void (*UZURA_SYSTEM_FUNC)(UZURA *p);
-#define UZUME_VOLUME_INPUT(P) ((P)->input)
-#define UZUME_VOLUME_OUTPUT(P) ((P)->input)
-#define UZUME_USER_DATA(P) ((P)->user_data)
+#define UZURA_VOLUME_INPUT(P) ((P)->input)
+#define UZURA_VOLUME_OUTPUT(P) ((P)->input)
+#define UZURA_USER_DATA(P) ((P)->user_data)
/**
* @brief Volume Memory.
uint32_t right; /**< Right. */
} volume_t;
-struct UZUME {
- UZUME_EFFECT_FUNC effect; /**< Effect callback. */
- UZUME_SYSTEM_FUNC system; /**< System callback. */
+struct UZURA {
+ UZURA_EFFECT_FUNC effect; /**< Effect callback. */
+ UZURA_SYSTEM_FUNC system; /**< System callback. */
volume_t input; /**< Input volume. */
volume_t output; /**< Output volume. */
void *user_data; /**< User external object. */
};
-void uzume_init(UZUME *p, void *user_data);
-void uzume_set_effect(UZUME *p, UZUME_EFFECT_FUNC effect);
-void uzume_set_system(UZUME *p, UZUME_SYSTEM_FUNC system);
-void uzume_execute(UZUME *p);
+void uzura_init(UZURA *p, void *user_data);
+void uzura_set_effect(UZURA *p, UZURA_EFFECT_FUNC effect);
+void uzura_set_system(UZURA *p, UZURA_SYSTEM_FUNC system);
+void uzura_execute(UZURA *p);
#endif
CSRC += mmc.c pff.c
CSRC += twi.c uart.c
CSRC += ssm2603.c at24c.c
-CSRC += bfin_util.c uzume.c
+CSRC += bfin_util.c uzura.c
CSRC += effect.c system.c main.c
ASRC +=
VPATH = ../common/
*/
#include <stddef.h>
-#include "uzume.h"
+#include "uzura.h"
#include "lcd.h"
#include "led.h"
#include "effect.h"
#include "rotenc.h"
typedef struct {
- UZUME uzume;
+ UZURA uzura;
uint8_t effect;
int8_t locate_target;
int8_t locate_current;
if (RotencActionPush == action) {
w->effect = !w->effect;
if (w->effect) {
- uzume_set_effect(&(w->uzume), effect_karaoke);
+ uzura_set_effect(&(w->uzura), effect_karaoke);
led_write(LedTargetR, 0);
led_write(LedTargetG, 1);
} else {
- uzume_set_effect(&(w->uzume), effect_through);
+ uzura_set_effect(&(w->uzura), effect_through);
led_write(LedTargetR, 1);
led_write(LedTargetG, 0);
}
}
}
-static void system_dynamic_menu(UZUME *p)
+static void system_dynamic_menu(UZURA *p)
{
- work_t *w = (work_t *)UZUME_USER_DATA(p);
+ work_t *w = (work_t *)UZURA_USER_DATA(p);
lcd_goto(0, 0);
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).right >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).right >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_INPUT(p).right >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).left >> 29));
- lcd_putc(0x08 + (UZUME_VOLUME_OUTPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_INPUT(p).right >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).left >> 29));
+ lcd_putc(0x08 + (UZURA_VOLUME_OUTPUT(p).right >> 29));
#define SCROLL_SPEED (16)
static uint8_t divcnt = 0;
w.locate_target = 0;
w.locate_current = 0;
- uzume_init(&w.uzume, &w);
- uzume_set_effect(&w.uzume, effect_through);
- uzume_set_system(&w.uzume, system_dynamic_menu);
+ uzura_init(&w.uzura, &w);
+ uzura_set_effect(&w.uzura, effect_through);
+ uzura_set_system(&w.uzura, system_dynamic_menu);
led_write(LedTargetR, 1);
led_write(LedTargetG, 0);
rotenc_init(rotenc_callback, &w);
- uzume_execute(&w.uzume);
+ uzura_execute(&w.uzura);
return 0;
}
CSRC += mmc.c pff.c
CSRC += twi.c uart.c
CSRC += ssm2603.c at24c.c
-CSRC += bfin_util.c uzume.c
+CSRC += bfin_util.c uzura.c
CSRC += effect.c system.c main.c
ASRC +=
VPATH = ../common/
*/
#include <stddef.h>
-#include "uzume.h"
+#include "uzura.h"
#include "led.h"
#include "effect.h"
#include "system.h"
#include "rotenc.h"
typedef struct {
- UZUME uzume;
+ UZURA uzura;
uint8_t effect;
} work_t;
if (RotencActionPush == action) {
w->effect = !w->effect;
if (w->effect) {
- uzume_set_effect(&(w->uzume), effect_karaoke);
+ uzura_set_effect(&(w->uzura), effect_karaoke);
led_write(LedTargetR, 0);
led_write(LedTargetG, 1);
} else {
- uzume_set_effect(&(w->uzume), effect_through);
+ uzura_set_effect(&(w->uzura), effect_through);
led_write(LedTargetR, 1);
led_write(LedTargetG, 1);
}
w.effect = 0;
- uzume_init(&w.uzume, &w);
- uzume_set_effect(&w.uzume, effect_through);
- uzume_set_system(&w.uzume, system_default);
+ uzura_init(&w.uzura, &w);
+ uzura_set_effect(&w.uzura, effect_through);
+ uzura_set_system(&w.uzura, system_default);
led_write(LedTargetR, 1);
led_write(LedTargetG, 1);
rotenc_init(rotenc_callback, &w);
- uzume_execute(&w.uzume);
+ uzura_execute(&w.uzura);
return 0;
}
CSRC += mmc.c pff.c
CSRC += twi.c uart.c
CSRC += ssm2603.c at24c.c
-CSRC += bfin_util.c uzume.c
+CSRC += bfin_util.c uzura.c
CSRC += effect.c system.c main.c
ASRC +=
VPATH = ../common/
* ===============================================================
*/
-#include "uzume.h"
+#include "uzura.h"
#include "effect.h"
#include "system.h"
typedef struct {
- UZUME uzume;
+ UZURA uzura;
} work_t;
int main(void)
{
work_t w;
- uzume_init(&w.uzume, &w);
- uzume_set_effect(&w.uzume, effect_through);
- uzume_set_system(&w.uzume, system_default);
- uzume_execute(&w.uzume);
+ uzura_init(&w.uzura, &w);
+ uzura_set_effect(&w.uzura, effect_through);
+ uzura_set_system(&w.uzura, system_default);
+ uzura_execute(&w.uzura);
return 0;
}