Add OV2640 camera support to test the SAMA5 ISI peripheral
This commit is contained in:
parent
8f11a14535
commit
fe2f4aff1f
@ -268,12 +268,12 @@
|
||||
/* PMC Programmable Clock Register (0,1,2) */
|
||||
|
||||
#define PMC_PCK_CSS_SHIFT (0) /* Bits 0-2: Master Clock Source Selection */
|
||||
#define PMC_PCK_CSS_MASK (7 << PMC_PCK_CSS_MASK)
|
||||
# define PMC_PCK_CSS_SLOW (0 << PMC_PCK_CSS_MASK) /* Slow Clock */
|
||||
# define PMC_PCK_CSS_MAIN (1 << PMC_PCK_CSS_MASK) /* Main Clock */
|
||||
# define PMC_PCK_CSS_PLLA (2 << PMC_PCK_CSS_MASK) /* PLLA Clock */
|
||||
# define PMC_PCK_CSS_UPLL (3 << PMC_PCK_CSS_MASK) /* UPLL Clock */
|
||||
# define PMC_PCK_CSS_MCK (4 << PMC_PCK_CSS_MASK) /* Master Clock */
|
||||
#define PMC_PCK_CSS_MASK (7 << PMC_PCK_CSS_SHIFT)
|
||||
# define PMC_PCK_CSS_SLOW (0 << PMC_PCK_CSS_SHIFT) /* Slow Clock */
|
||||
# define PMC_PCK_CSS_MAIN (1 << PMC_PCK_CSS_SHIFT) /* Main Clock */
|
||||
# define PMC_PCK_CSS_PLLA (2 << PMC_PCK_CSS_SHIFT) /* PLLA Clock */
|
||||
# define PMC_PCK_CSS_UPLL (3 << PMC_PCK_CSS_SHIFT) /* UPLL Clock */
|
||||
# define PMC_PCK_CSS_MCK (4 << PMC_PCK_CSS_SHIFT) /* Master Clock */
|
||||
#define PMC_PCK_PRES_SHIFT (4) /* Bits 4-6: Programmable Clock Prescaler */
|
||||
#define PMC_PCK_PRES_MASK (7 << PMC_PCK_PRES_SHIFT)
|
||||
# define PMC_PCK_PRES_DIV1 (0 << PMC_PCK_PRES_SHIFT) /* Selected clock */
|
||||
|
@ -39,12 +39,20 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <debug.h>
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
#include "chip/sam_pinmap.h"
|
||||
|
||||
#include "up_arch.h"
|
||||
#include "sam_pio.h"
|
||||
#include "sam_isi.h"
|
||||
|
||||
#include "sam_pck.h"
|
||||
|
||||
#ifdef CONFIG_SAMA5_ISI
|
||||
|
||||
/****************************************************************************
|
||||
@ -96,12 +104,13 @@ uint32_t sam_pck_configure(enum pckid_e pckid, uint32_t frequency)
|
||||
{
|
||||
uint32_t regval;
|
||||
uint32_t clkin;
|
||||
uint32_t actual;
|
||||
|
||||
/* Pick a clock source. Several are possible but only MCK or PLLA is
|
||||
* chosen here.
|
||||
*/
|
||||
|
||||
DEBUGASSERT(BOARD_MCK_FREQUENCY < BOARD_PLLA_FREQUENCY)
|
||||
DEBUGASSERT(BOARD_MCK_FREQUENCY < BOARD_PLLA_FREQUENCY);
|
||||
if (frequency <= BOARD_MCK_FREQUENCY ||
|
||||
frequency < BOARD_PLLA_FREQUENCY / 64)
|
||||
{
|
||||
@ -158,7 +167,7 @@ uint32_t sam_pck_configure(enum pckid_e pckid, uint32_t frequency)
|
||||
sdbg("ERROR: frequency cannot be realized.\n");
|
||||
sdbg(" frequency=%d MCK=%d\n",
|
||||
frequency, clkin);
|
||||
return -ERANGE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Disable the programmable clock, configure the PCK output pin, then set
|
||||
|
Loading…
Reference in New Issue
Block a user