kzdev.h File Reference

KOBANZAME SDK Device Driver. More...

#include "kernel.h"
#include "cdefBF533.h"
Include dependency graph for kzdev.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define KZ_GPIO_SET_DIR_OUT(no)   do { *pFIO_DIR |= (1<<no ); *pFIO_INEN &= ~(1<<no); }while(0)
#define KZ_GPIO_SET_DIR_IN(no)   do { *pFIO_DIR &= ~(1<<no ); *pFIO_INEN |= (1<<no); }while(0)
#define KZ_GPIO_SET_HI(no)   do { *pFIO_FLAG_S = (1<<no); }while(0)
#define KZ_GPIO_SET_LO(no)   do { *pFIO_FLAG_C = (1<<no); }while(0)
#define KZ_GPIO_SET_TGL(no)   do { *pFIO_FLAG_T = (1<<no); }while(0)
#define KZ_GPIO_GET(no)   *pFIO_FLAG_D & ( 1 << no )

Enumerations

enum  KZDEV_SPI_BITLEN_t { KZDEV_SPI_8BIT, KZDEV_SPI_16BIT }

Functions

int kzdev_spi_regist (KZDEV_SPI_BITLEN_t nBitLen, UW dwBps, int nCS, BOOL bCPOL, BOOL bCPHA)
 SPI Registration.
UW kzdev_spi_chgbps (int nID, UW dwBps)
 Change bit ratio.
void kzdev_spi_open (void)
 Open SPI ( SPI Semaphore Lock ).
void kzdev_spi_close (void)
 Close SPI ( Release SPI Semaphore ).
int kzdev_spi_readwrite (int nID, const void *pTx, int nTx, void *pRx, int nRx)
 SPI Read and write.
int kzdev_spi_read (int nID, void *pRx, int nRx)
 SPI Read.
int kzdev_spi_write (int nID, const void *pTx, int nTx)
 SPI write.
int kzdev_spi_dma_read (int nID, void *pRx, int nRx)
 SPI DMA Read.
int kzdev_spi_dma_write (int nID, const void *pTx, int nTx)
 SPI DMA write.
void kzdev_mems_att_ini (void)
 Initialize MEMS called from uITRON ATT_INI.
BOOL kzdev_mems_start (void)
 Start MEMS.
void kzdev_mems_stop (void)
 Stop MEMS.
BOOL kzdev_mems_isReady (void)
 Check MEMS data are ready.
void kzdev_mems_getVal (int *x, int *y, int *z)
 Get MEMS Value.
void kzdev_mmc_att_ini (void)
void disk_timerproc (void)
BOOL kzdev_audio_start (void *fnCbk, long lSampleRate, int nBlocks, int nChannels)
void kzdev_audio_stop (void)
void kzdev_codec_att_ini (void)
void kzdev_codec_start_DSPMODE (long lSampleRate)
void kzdev_codec_start_I2CMODE (long lSampleRate)
void kzdev_codec_stop (void)

Detailed Description

KOBANZAME SDK Device Driver.

KOBANZAME SDK Software Developers Kit for Blackfin DSP Evaluation Board(KOBANZAME).

Copyright (C) 2010, KOBANZAME SDK Project, all right reserved

LICENSE: The software is a free and you can use and redistribute it for personal, non-profit or commercial products. Redistributions of source code must retain the above copyright notice. There is no warranty in this software, if you suffer any damages by using the software.


Function Documentation

void kzdev_mems_att_ini ( void   ) 

Initialize MEMS called from uITRON ATT_INI.

Note:
KOBANZAME SDK private function
void kzdev_mems_getVal ( int *  x,
int *  y,
int *  z 
)

Get MEMS Value.

Parameters:
x MEMS X value
y MEMS Y value
z MEMS Z value
Note:
KOBANZAME SDK private function
BOOL kzdev_mems_isReady ( void   ) 

Check MEMS data are ready.

Returns:
TRUE ... Data ready
Note:
KOBANZAME SDK private function
BOOL kzdev_mems_start ( void   ) 

Start MEMS.

Returns:
TRUE ... Success /
FALSE ... Fail to start (MEMS is broken?)
Note:
KOBANZAME SDK private function
void kzdev_mems_stop ( void   ) 

Stop MEMS.

Note:
KOBANZAME SDK private function
UW kzdev_spi_chgbps ( int  nID,
UW  dwBps 
)

Change bit ratio.

Parameters:
nID a SPI ID
dwBps bit per second
Returns:
Old value
Note:
KOBANZAME SDK private function
void kzdev_spi_close ( void   ) 

Close SPI ( Release SPI Semaphore ).

Note:
KOBANZAME SDK private function
int kzdev_spi_dma_read ( int  nID,
void *  pRx,
int  nRx 
)

SPI DMA Read.

Parameters:
nID a SPI ID
pRx Rx Buffer pointer
nRx number of the receive units
Note:
KOBANZAME SDK private function
int kzdev_spi_dma_write ( int  nID,
const void *  pTx,
int  nTx 
)

SPI DMA write.

Parameters:
nID a SPI ID
pTx Tx Buffer pointer
nTx number of the send units
Note:
KOBANZAME SDK private function
void kzdev_spi_open ( void   ) 

Open SPI ( SPI Semaphore Lock ).

Note:
KOBANZAME SDK private function
int kzdev_spi_read ( int  nID,
void *  pRx,
int  nRx 
)

SPI Read.

Parameters:
nID a SPI ID
pRx Rx Buffer pointer
nRx number of the receive units
Note:
KOBANZAME SDK private function
int kzdev_spi_readwrite ( int  nID,
const void *  pTx,
int  nTx,
void *  pRx,
int  nRx 
)

SPI Read and write.

Parameters:
nID a SPI ID
pTx Tx Buffer pointer
nTx number of the send units
pRx Rx Buffer pointer
nRx number of the receive units
Note:
KOBANZAME SDK private function
int kzdev_spi_regist ( KZDEV_SPI_BITLEN_t  nBitLen,
UW  dwBps,
int  nCS,
BOOL  bCPOL,
BOOL  bCPHA 
)

SPI Registration.

Parameters:
nBitLen 16bit or 8bit
dwBps bit per second (BPS can be changed by calling kzdev_spi_chgbps even after this function is done )
nCS a chip select number , -1 is indicate no chip select work.
bCPOL SPI CPOL is set or not
bCPHA SPI CPHA is set or not
Returns:
SPI ID
Note:
KOBANZAME SDK private function
int kzdev_spi_write ( int  nID,
const void *  pTx,
int  nTx 
)

SPI write.

Parameters:
nID a SPI ID
pTx Tx Buffer pointer
nTx number of the send units
Note:
KOBANZAME SDK private function
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated by  doxygen 1.6.2