Browse Source

Switch ssp.c to using CGU #defines instead of local #defines.

pull/174/head
Jared Boone 12 years ago
committed by Piotr Esden-Tempski
parent
commit
25d7853422
  1. 26
      lib/lpc43xx/ssp.c

26
lib/lpc43xx/ssp.c

@ -35,27 +35,6 @@ LGPL License Terms @ref lgpl_license
#include <libopencm3/lpc43xx/ssp.h>
#include <libopencm3/lpc43xx/cgu.h>
#define CGU_SRC_32K 0x00
#define CGU_SRC_IRC 0x01
#define CGU_SRC_ENET_RX 0x02
#define CGU_SRC_ENET_TX 0x03
#define CGU_SRC_GP_CLKIN 0x04
#define CGU_SRC_XTAL 0x06
#define CGU_SRC_PLL0USB 0x07
#define CGU_SRC_PLL0AUDIO 0x08
#define CGU_SRC_PLL1 0x09
#define CGU_SRC_IDIVA 0x0C
#define CGU_SRC_IDIVB 0x0D
#define CGU_SRC_IDIVC 0x0E
#define CGU_SRC_IDIVD 0x0F
#define CGU_SRC_IDIVE 0x10
#define CGU_AUTOBLOCK_CLOCK_BIT 11
#define CGU_BASE_CLK_SEL_SHIFT 24 /* clock source selection (5 bits) */
/* Local declarations. */
void ssp_wait_until_not_busy(ssp_num_t ssp_num);
/* Disable SSP */
void ssp_disable(ssp_num_t ssp_num)
{
@ -93,8 +72,9 @@ void ssp_init(ssp_num_t ssp_num,
}
/* use PLL1 as clock source for SSP1 */
CGU_BASE_SSP1_CLK = (CGU_SRC_PLL1<<CGU_BASE_CLK_SEL_SHIFT) |
(1<<CGU_AUTOBLOCK_CLOCK_BIT);
CGU_BASE_SSP1_CLK =
CGU_BASE_SSP1_CLK_CLK_SEL(CGU_SRC_PLL1)
| CGU_BASE_SSP1_CLK_AUTOBLOCK;
/* Disable SSP before to configure it */
SSP_CR1(ssp_port) = 0x0;

Loading…
Cancel
Save