mirror of
git://projects.qi-hardware.com/f32xbase.git
synced 2024-11-04 23:21:53 +02:00
bb600dada5
- f32x/c2-ben.c: bitbang wrapper for the c2ben board - f32x/Makefile: added "ben" target - f32x/gpio-xburst.h, f32x/gpio-xburst.c: GPIO access primitives for XBurst CPUs
44 lines
905 B
C
44 lines
905 B
C
/*
|
|
* 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 <stdio.h>
|
|
|
|
|
|
#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"
|
|
|
|
|
|
static void ben_init(void)
|
|
{
|
|
gpio_init();
|
|
gpio_low(POWER_OFF);
|
|
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,
|
|
};
|