Sync inav to Gitea
Make sure docs are updated / settings_md (push) Canceled after 0s
Build firmware / test (push) Canceled after 0s
Build firmware / build-SITL-Windows (push) Canceled after 0s
Build firmware / build-SITL-Mac (push) Canceled after 0s
Build firmware / build-SITL-Linux (push) Canceled after 0s
Build firmware / build-SITL-Linux-arm64 (push) Canceled after 0s
Build firmware / upload-artifacts (push) Canceled after 0s
Build firmware / build-single-target (push) Canceled after 0s
Build firmware / build (9) (push) Canceled after 0s
Build firmware / build (8) (push) Canceled after 0s
Build firmware / build (7) (push) Canceled after 0s
Build firmware / build (6) (push) Canceled after 0s
Build firmware / build (5) (push) Canceled after 0s
Build firmware / build (4) (push) Canceled after 0s
Build firmware / build (3) (push) Canceled after 0s
Build firmware / build (2) (push) Canceled after 0s
Build firmware / build (14) (push) Canceled after 0s
Build firmware / build (13) (push) Canceled after 0s
Build firmware / build (12) (push) Canceled after 0s
Build firmware / build (11) (push) Canceled after 0s
Build firmware / build (10) (push) Canceled after 0s
Build firmware / build (1) (push) Canceled after 0s
Build firmware / build (0) (push) Canceled after 0s
Build firmware / detect (push) Canceled after 0s
Build pre-release / build (push) Canceled after 0s
Build pre-release / Release (push) Canceled after 0s
Make sure docs are updated / settings_md (push) Canceled after 0s
Build firmware / test (push) Canceled after 0s
Build firmware / build-SITL-Windows (push) Canceled after 0s
Build firmware / build-SITL-Mac (push) Canceled after 0s
Build firmware / build-SITL-Linux (push) Canceled after 0s
Build firmware / build-SITL-Linux-arm64 (push) Canceled after 0s
Build firmware / upload-artifacts (push) Canceled after 0s
Build firmware / build-single-target (push) Canceled after 0s
Build firmware / build (9) (push) Canceled after 0s
Build firmware / build (8) (push) Canceled after 0s
Build firmware / build (7) (push) Canceled after 0s
Build firmware / build (6) (push) Canceled after 0s
Build firmware / build (5) (push) Canceled after 0s
Build firmware / build (4) (push) Canceled after 0s
Build firmware / build (3) (push) Canceled after 0s
Build firmware / build (2) (push) Canceled after 0s
Build firmware / build (14) (push) Canceled after 0s
Build firmware / build (13) (push) Canceled after 0s
Build firmware / build (12) (push) Canceled after 0s
Build firmware / build (11) (push) Canceled after 0s
Build firmware / build (10) (push) Canceled after 0s
Build firmware / build (1) (push) Canceled after 0s
Build firmware / build (0) (push) Canceled after 0s
Build firmware / detect (push) Canceled after 0s
Build pre-release / build (push) Canceled after 0s
Build pre-release / Release (push) Canceled after 0s
This commit is contained in:
@@ -0,0 +1,87 @@
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="generator" content="pandoc" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
|
||||
<title>Release Notes for S5K5CAG Component Driver</title>
|
||||
<style type="text/css">
|
||||
code{white-space: pre-wrap;}
|
||||
span.smallcaps{font-variant: small-caps;}
|
||||
span.underline{text-decoration: underline;}
|
||||
div.column{display: inline-block; vertical-align: top; width: 50%;}
|
||||
</style>
|
||||
<link rel="stylesheet" href="_htmresc/mini-st.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv-printshiv.min.js"></script>
|
||||
<![endif]-->
|
||||
</head>
|
||||
<body>
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-lg-4">
|
||||
<div class="card fluid">
|
||||
<div class="sectione dark">
|
||||
<center>
|
||||
<h1 id="release-notes-for-s5k5cag-component-driver"><strong>Release Notes for S5K5CAG Component Driver</strong></h1>
|
||||
<p>Copyright © 2019 STMicroelectronics<br />
|
||||
</p>
|
||||
<a href="https://www.st.com" class="logo"><img src="_htmresc/st_logo.png" alt="ST logo" /></a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
<h1 id="license">License</h1>
|
||||
This software component is licensed by ST under BSD 3-Clause license, the “License”; You may not use this component except in compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
<a href="https://opensource.org/licenses/BSD-3-Clause">https://opensource.org/licenses/BSD-3-Clause</a>
|
||||
</center>
|
||||
<h1 id="purpose">Purpose</h1>
|
||||
<p>This driver provides a set of camera functions offered by S5K5CAG component</p>
|
||||
</div>
|
||||
<div class="col-sm-12 col-lg-8">
|
||||
<h1 id="update-history">Update History</h1>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true"> <label for="collapse-section3" aria-hidden="true"><strong>V2.0.0 / 30-October-2019</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First Official Release version of S5K5CAG Camera sensor Component in line with STM32Cube BSP drivers development guidelines (UM2298)</li>
|
||||
<li>The component drivers are composed of
|
||||
<ul>
|
||||
<li>component core drivers files: s5k5cag.h/.c</li>
|
||||
<li>component register drivers files: s5k5cag_regs.h/.c</li>
|
||||
</ul></li>
|
||||
</ul>
|
||||
<h2 id="backward-compatibility">Backward Compatibility</h2>
|
||||
<p>This version breaks the compatibility with previous versions</p>
|
||||
<h2 id="dependencies">Dependencies</h2>
|
||||
<p>This software release is compatible with:</p>
|
||||
<ul>
|
||||
<li>BSP Common v6.0.0 or above</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true"> <label for="collapse-section2" aria-hidden="true"><strong>V1.0.1 / 05-June-2017</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-1">Main Changes</h2>
|
||||
<ul>
|
||||
<li>Update comments to be used for PDSC generation</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="collapse">
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true"> <label for="collapse-section1" aria-hidden="true"><strong>V1.0.0 / 05-March-2015</strong></label>
|
||||
<div>
|
||||
<h2 id="main-changes-2">Main Changes</h2>
|
||||
<ul>
|
||||
<li>First official release of <strong>S5K5CAG</strong> Camera sensor driver</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> , visit: <span style="font-color: blue;"><a href="http://www.st.com/STM32">www.st.com</a></span>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,92 @@
|
||||
---
|
||||
pagetitle: Release Notes for S5K5CAG Component Driver
|
||||
lang: en
|
||||
---
|
||||
::: {.row}
|
||||
::: {.col-sm-12 .col-lg-4}
|
||||
|
||||
::: {.card .fluid}
|
||||
::: {.sectione .dark}
|
||||
<center>
|
||||
# **Release Notes for S5K5CAG Component Driver**
|
||||
Copyright © 2019 STMicroelectronics\
|
||||
|
||||
[](https://www.st.com){.logo}
|
||||
</center>
|
||||
:::
|
||||
:::
|
||||
|
||||
# License
|
||||
|
||||
This software component is licensed by ST under BSD 3-Clause license, the "License"; You may not use this component except in
|
||||
compliance with the License. You may obtain a copy of the License at:
|
||||
<center>
|
||||
[https://opensource.org/licenses/BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause)
|
||||
</center>
|
||||
|
||||
# Purpose
|
||||
|
||||
This driver provides a set of camera functions offered by S5K5CAG component
|
||||
|
||||
:::
|
||||
|
||||
::: {.col-sm-12 .col-lg-8}
|
||||
|
||||
# Update History
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section3" checked aria-hidden="true">
|
||||
<label for="collapse-section3" aria-hidden="true">__V2.0.0 / 30-October-2019__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First Official Release version of S5K5CAG Camera sensor Component in line with STM32Cube BSP drivers development guidelines (UM2298)
|
||||
- The component drivers are composed of
|
||||
- component core drivers files: s5k5cag.h/.c
|
||||
- component register drivers files: s5k5cag_regs.h/.c
|
||||
|
||||
## Backward Compatibility
|
||||
|
||||
This version breaks the compatibility with previous versions
|
||||
|
||||
## Dependencies
|
||||
|
||||
This software release is compatible with:
|
||||
|
||||
- BSP Common v6.0.0 or above
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section2" checked aria-hidden="true">
|
||||
<label for="collapse-section2" aria-hidden="true">__V1.0.1 / 05-June-2017__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- Update comments to be used for PDSC generation
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
::: {.collapse}
|
||||
<input type="checkbox" id="collapse-section1" checked aria-hidden="true">
|
||||
<label for="collapse-section1" aria-hidden="true">__V1.0.0 / 05-March-2015__</label>
|
||||
<div>
|
||||
|
||||
## Main Changes
|
||||
|
||||
- First official release of **S5K5CAG** Camera sensor driver
|
||||
|
||||
</div>
|
||||
:::
|
||||
|
||||
:::
|
||||
:::
|
||||
|
||||
<footer class="sticky">
|
||||
For complete documentation on <mark>STM32 Microcontrollers</mark> ,
|
||||
visit: [[www.st.com](http://www.st.com/STM32)]{style="font-color: blue;"}
|
||||
</footer>
|
||||
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
After Width: | Height: | Size: 18 KiB |
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,193 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file s5k5cag.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the s5k5cag.c
|
||||
* driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef S5K5CAG_H
|
||||
#define S5K5CAG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "s5k5cag_reg.h"
|
||||
#include <stddef.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup S5K5CAG
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup S5K5CAG_Exported_Types Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*S5K5CAG_Init_Func) (void);
|
||||
typedef int32_t (*S5K5CAG_DeInit_Func) (void);
|
||||
typedef int32_t (*S5K5CAG_GetTick_Func) (void);
|
||||
typedef int32_t (*S5K5CAG_Delay_Func) (uint32_t);
|
||||
typedef int32_t (*S5K5CAG_WriteReg_Func)(uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*S5K5CAG_ReadReg_Func) (uint16_t, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
S5K5CAG_Init_Func Init;
|
||||
S5K5CAG_DeInit_Func DeInit;
|
||||
uint16_t Address;
|
||||
S5K5CAG_WriteReg_Func WriteReg;
|
||||
S5K5CAG_ReadReg_Func ReadReg;
|
||||
S5K5CAG_GetTick_Func GetTick;
|
||||
} S5K5CAG_IO_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
S5K5CAG_IO_t IO;
|
||||
s5k5cag_ctx_t Ctx;
|
||||
uint32_t IsInitialized;
|
||||
} S5K5CAG_Object_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t Config_Resolution;
|
||||
uint32_t Config_LightMode;
|
||||
uint32_t Config_SpecialEffect;
|
||||
uint32_t Config_Brightness;
|
||||
uint32_t Config_Saturation;
|
||||
uint32_t Config_Contrast;
|
||||
uint32_t Config_HueDegree;
|
||||
uint32_t Config_MirrorFlip;
|
||||
uint32_t Config_Zoom;
|
||||
uint32_t Config_NightMode;
|
||||
} S5K5CAG_Capabilities_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int32_t (*Init )(S5K5CAG_Object_t*, uint32_t, uint32_t);
|
||||
int32_t (*DeInit )(S5K5CAG_Object_t*);
|
||||
int32_t (*ReadID )(S5K5CAG_Object_t*, uint32_t*);
|
||||
int32_t (*GetCapabilities )(S5K5CAG_Object_t*, S5K5CAG_Capabilities_t*);
|
||||
int32_t (*SetLightMode )(S5K5CAG_Object_t*, uint32_t);
|
||||
int32_t (*SetEffect )(S5K5CAG_Object_t*, uint32_t);
|
||||
int32_t (*SetBrightness )(S5K5CAG_Object_t*, int32_t);
|
||||
int32_t (*SetSaturation )(S5K5CAG_Object_t*, int32_t);
|
||||
int32_t (*SetContrast )(S5K5CAG_Object_t*, int32_t);
|
||||
int32_t (*SetHueDegree )(S5K5CAG_Object_t*, int32_t);
|
||||
int32_t (*MirrorFlipConfig )(S5K5CAG_Object_t*, uint32_t);
|
||||
int32_t (*ZoomConfig )(S5K5CAG_Object_t*, uint32_t);
|
||||
int32_t (*SetResolution )(S5K5CAG_Object_t*, uint32_t);
|
||||
int32_t (*GetResolution )(S5K5CAG_Object_t*, uint32_t*);
|
||||
int32_t (*SetPixelFormat )(S5K5CAG_Object_t*, uint32_t);
|
||||
int32_t (*GetPixelFormat )(S5K5CAG_Object_t*, uint32_t*);
|
||||
int32_t (*NightModeConfig )(S5K5CAG_Object_t*, uint32_t);
|
||||
}S5K5CAG_CAMERA_Drv_t;
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup S5K5CAG_Exported_Constants Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define S5K5CAG_OK (0)
|
||||
#define S5K5CAG_ERROR (-1)
|
||||
|
||||
/**
|
||||
* @brief S5K5CAG Features Parameters
|
||||
*/
|
||||
/* Camera resolutions */
|
||||
#define S5K5CAG_R160x120 0x00U /* QQVGA Resolution */
|
||||
#define S5K5CAG_R320x240 0x01U /* QVGA Resolution */
|
||||
#define S5K5CAG_R480x272 0x02U /* 480x272 Resolution */
|
||||
#define S5K5CAG_R640x480 0x03U /* VGA Resolution */
|
||||
#define S5K5CAG_R800x480 0x04U /* WVGA Resolution */
|
||||
|
||||
/* Camera Pixel Format */
|
||||
#define S5K5CAG_RGB565 0x00U /* Pixel Format RGB565 */
|
||||
#define S5K5CAG_RGB888 0x01U /* Pixel Format RGB888 */
|
||||
#define S5K5CAG_YUV422 0x02U /* Pixel Format YUV422 */
|
||||
|
||||
|
||||
/* Special Effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_NONE 0x00U /* No effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_BLUE 0x01U /* Blue effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_RED 0x02U /* Red effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_GREEN 0x04U /* Green effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_BW 0x08U /* Black and White effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_SEPIA 0x10U /* Sepia effect */
|
||||
#define S5K5CAG_COLOR_EFFECT_NEGATIVE 0x20U /* Negative effect */
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
|
||||
/** @addtogroup S5K5CAG_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t S5K5CAG_RegisterBusIO (S5K5CAG_Object_t *pObj, S5K5CAG_IO_t *pIO);
|
||||
int32_t S5K5CAG_Init(S5K5CAG_Object_t *pObj, uint32_t Resolution, uint32_t PixelFormat);
|
||||
int32_t S5K5CAG_DeInit(S5K5CAG_Object_t *pObj);
|
||||
int32_t S5K5CAG_ReadID(S5K5CAG_Object_t *pObj, uint32_t *Id);
|
||||
int32_t S5K5CAG_GetCapabilities(S5K5CAG_Object_t *pObj, S5K5CAG_Capabilities_t *Capabilities);
|
||||
int32_t S5K5CAG_SetLightMode(S5K5CAG_Object_t *pObj, uint32_t LightMode);
|
||||
int32_t S5K5CAG_SetColorEffect(S5K5CAG_Object_t *pObj, uint32_t Effect);
|
||||
int32_t S5K5CAG_SetBrightness(S5K5CAG_Object_t *pObj, int32_t Level);
|
||||
int32_t S5K5CAG_SetSaturation(S5K5CAG_Object_t *pObj, int32_t Level);
|
||||
int32_t S5K5CAG_SetContrast(S5K5CAG_Object_t *pObj, int32_t Level);
|
||||
int32_t S5K5CAG_SetHueDegree(S5K5CAG_Object_t *pObj, int32_t Degree);
|
||||
int32_t S5K5CAG_MirrorFlipConfig(S5K5CAG_Object_t *pObj, uint32_t Config);
|
||||
int32_t S5K5CAG_ZoomConfig(S5K5CAG_Object_t *pObj, uint32_t Zoom);
|
||||
int32_t S5K5CAG_SetPixelFormat(S5K5CAG_Object_t *pObj, uint32_t PixelFormat);
|
||||
int32_t S5K5CAG_GetPixelFormat(S5K5CAG_Object_t *pObj, uint32_t *PixelFormat);
|
||||
int32_t S5K5CAG_SetResolution(S5K5CAG_Object_t *pObj, uint32_t Resolution);
|
||||
int32_t S5K5CAG_GetResolution(S5K5CAG_Object_t *pObj, uint32_t *Resolution);
|
||||
int32_t S5K5CAG_NightModeConfig(S5K5CAG_Object_t *pObj, uint32_t Cmd);
|
||||
|
||||
/* CAMERA driver structure */
|
||||
extern S5K5CAG_CAMERA_Drv_t S5K5CAG_CAMERA_Driver;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* S5K5CAG_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file s5k5cag_reg.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides unitary register function to control the S5K5CAG
|
||||
* Camera driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "s5k5cag_reg.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup S5K5CAG
|
||||
* @brief This file provides a set of functions needed to drive the
|
||||
* S5K5CAG Camera.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup S5K5CAG_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
/*******************************************************************************
|
||||
* Function Name : s5k5cag_read_reg
|
||||
* Description : Generic Reading function. It must be full-filled with either
|
||||
* I2C or SPI reading functions
|
||||
* Input : Register Address, length of buffer
|
||||
* Output : Data Read
|
||||
*******************************************************************************/
|
||||
int32_t s5k5cag_read_reg(s5k5cag_ctx_t *ctx, uint16_t reg, uint16_t* data, uint16_t length)
|
||||
{
|
||||
int32_t ret;
|
||||
|
||||
ret = ctx->ReadReg(ctx->handle, reg, (uint8_t *)data, length);
|
||||
|
||||
if(ret >= 0)
|
||||
{
|
||||
*data = (uint16_t)__REV16(*data);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
* Function Name : s5k5cag_write_reg
|
||||
* Description : Generic Writing function. It must be full-filled with either
|
||||
* I2C or SPI writing function
|
||||
* Input : Register Address, Data to be written, length of buffer
|
||||
* Output : None
|
||||
*******************************************************************************/
|
||||
int32_t s5k5cag_write_reg(s5k5cag_ctx_t *ctx, uint16_t reg, uint16_t *data, uint16_t length)
|
||||
{
|
||||
uint16_t tmp = (uint16_t)__REV16(*data);
|
||||
|
||||
return ctx->WriteReg(ctx->handle, reg, (uint8_t *)&tmp, length);
|
||||
}
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
@@ -0,0 +1,106 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file s5k5cag_reg.h
|
||||
* @author MCD Application Team
|
||||
* @brief Header of s5k5cag_reg.c
|
||||
*
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2015 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef S5K5CAG_REG_H
|
||||
#define S5K5CAG_REG_H
|
||||
|
||||
#include <cmsis_compiler.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup S5K5CAG
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup S5K5CAG_Exported_Constants S5K5CAG Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief S5K5CAG ID
|
||||
*/
|
||||
#define S5K5CAG_ID 0x05CAU
|
||||
/**
|
||||
* @brief S5K5CAG Registers
|
||||
*/
|
||||
#define S5K5CAG_INFO_CHIPID1 0x0040U
|
||||
#define S5K5CAG_INFO_CHIPID2 0x0042U
|
||||
#define S5K5CAG_INFO_SVNVERSION 0x0048U
|
||||
#define S5K5CAG_INFO_DATE 0x004EU
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup S5K5CAG_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*S5K5CAG_Write_Func)(void *, uint16_t, uint8_t*, uint16_t);
|
||||
typedef int32_t (*S5K5CAG_Read_Func) (void *, uint16_t, uint8_t*, uint16_t);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
S5K5CAG_Write_Func WriteReg;
|
||||
S5K5CAG_Read_Func ReadReg;
|
||||
void *handle;
|
||||
} s5k5cag_ctx_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @addtogroup S5K5CAG_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t s5k5cag_write_reg(s5k5cag_ctx_t *ctx, uint16_t reg, uint16_t *data, uint16_t length);
|
||||
int32_t s5k5cag_read_reg(s5k5cag_ctx_t *ctx, uint16_t reg, uint16_t* data, uint16_t length);
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* S5K5CAG_REG_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
Reference in New Issue
Block a user