From: asterix Date: Fri, 15 Jul 2011 16:28:08 +0000 (+0000) Subject: Add board implentation of the codec hw. X-Git-Url: https://codewiz.org/gitweb?p=bertos.git;a=commitdiff_plain;h=cb47d483a93edb33de1bc176982549e8d198b76a Add board implentation of the codec hw. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@4971 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/boards/sam3x-ek/hw/hw_wm8731.h b/boards/sam3x-ek/hw/hw_wm8731.h new file mode 100644 index 00000000..e6e1628a --- /dev/null +++ b/boards/sam3x-ek/hw/hw_wm8731.h @@ -0,0 +1,65 @@ +/** + * \file + * + * + * \brief HW pin handling for WM8731 audio codec. + * + * + * \author Daniele Basile + */ + +#ifndef HW_WM8731_H +#define HW_WM8731_H + +#include +#include + +#define WM8731_PIN_INIT() \ + do { \ + /* implement me */ \ + } while (0) + +#define WM8731_MCLK_INIT() \ + do { \ + /* Disable PIO on PB22 connected to mclk of the wm8731 codec */ \ + PIOB_PDR = BV(22); \ + /* Select the output clock on same pin */ \ + PIO_PERIPH_SEL(PIOB_BASE, BV(22), PIO_PERIPH_B); \ + /* Prescale the cpu clock to the frequenzy that we want. */\ + /* (multiply value of audio sample rate) */\ + PMC_PCK0 = PMC_PCK_CSS_PLL | PMC_PCK_PRES_CLK_4; \ + /* Enable the clock and wait until it starts correctly */ \ + PMC_SCER = BV(PMC_PCK0_ID); \ + while ((PMC_SR & BV(PMC_PCKRDY0)) == 0); \ + } while(0) + + +#endif /* HW_WM8731_H */