2010-10-22 01:38:54 +03:00
|
|
|
/*
|
|
|
|
* f32x/c2-ben.c - Basic C2 messages, driver for Openmoko GTA01/GTA02+DebugV3
|
|
|
|
*
|
|
|
|
* Written 2010 by Werner Almesberger
|
|
|
|
* Copyright 2010 Werner Almesberger
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "gpio-xburst.h"
|
|
|
|
#include "c2-drv.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define POWER_OFF 3, 2 /* PD02, drive low to enable power */
|
|
|
|
#define C2CK 3, 8 /* PD08 */
|
|
|
|
#define C2D 3, 12 /* PD12 */
|
|
|
|
|
|
|
|
|
|
|
|
#include "c2-bitbang.c"
|
|
|
|
|
|
|
|
|
2010-10-22 20:09:35 +03:00
|
|
|
static void ben_init(int power)
|
2010-10-22 01:38:54 +03:00
|
|
|
{
|
|
|
|
gpio_init();
|
2010-10-22 20:09:35 +03:00
|
|
|
if (power)
|
|
|
|
gpio_low(POWER_OFF);
|
|
|
|
else
|
|
|
|
gpio_high(POWER_OFF);
|
2010-10-22 01:38:54 +03:00
|
|
|
c2_init();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
struct c2_ops c2_ben = {
|
|
|
|
.init = ben_init,
|
|
|
|
.reset = c2_reset,
|
|
|
|
.addr_write = c2_addr_write,
|
|
|
|
.addr_read = c2_addr_read,
|
|
|
|
.data_write = c2_data_write,
|
|
|
|
.data_read = c2_data_read,
|
|
|
|
};
|