fsl_codec_i2c.h
Go to the documentation of this file.
1 /*
2  * Copyright 2019 NXP
3  * All rights reserved.
4  *
5  *
6  * SPDX-License-Identifier: BSD-3-Clause
7  */
8 
9 #ifndef _FSL_CODEC_I2C_H_
10 #define _FSL_CODEC_I2C_H_
11 
12 #include "fsl_common.h"
13 #include "i2c.h"
14 
15 /*******************************************************************************
16  * Definitions
17  ******************************************************************************/
19 #ifndef CODEC_I2C_MASTER_HANDLER_SIZE
20 #define CODEC_I2C_MASTER_HANDLER_SIZE HAL_I2C_MASTER_HANDLE_SIZE
21 #endif
22 
24 typedef enum _codec_reg_addr
25 {
29 
31 typedef enum _codec_reg_width
32 {
37 
39 typedef struct _codec_i2c_config
40 {
41  uint32_t codecI2CInstance;
44 
45 /*******************************************************************************
46  * API
47  ******************************************************************************/
48 #if defined(__cplusplus)
49 extern "C" {
50 #endif
51 
61 status_t CODEC_I2C_Init(void *handle, uint32_t i2cInstance, uint32_t i2cBaudrate, uint32_t i2cSourceClockHz);
62 
69 status_t CODEC_I2C_Deinit(void *handle);
70 
82 status_t CODEC_I2C_Send(void *handle,
83  uint8_t deviceAddress,
84  uint32_t subAddress,
85  uint8_t subaddressSize,
86  uint8_t *txBuff,
87  uint8_t txBuffSize);
88 
100 status_t CODEC_I2C_Receive(void *handle,
101  uint8_t deviceAddress,
102  uint32_t subAddress,
103  uint8_t subaddressSize,
104  uint8_t *rxBuff,
105  uint8_t rxBuffSize);
106 
107 #if defined(__cplusplus)
108 }
109 #endif
110 
111 #endif /* _FSL_CODEC_I2C_H_ */
fsl_common.h
kCODEC_RegWidth32Bit
@ kCODEC_RegWidth32Bit
Definition: fsl_codec_i2c.h:35
_codec_i2c_config::codecI2CSourceClock
uint32_t codecI2CSourceClock
Definition: fsl_codec_i2c.h:42
CODEC_I2C_Deinit
status_t CODEC_I2C_Deinit(void *handle)
Codec i2c de-initilization.
Definition: fsl_codec_i2c.c:48
codec_i2c_config_t
struct _codec_i2c_config codec_i2c_config_t
CODEC I2C configurations structure.
kCODEC_RegAddr8Bit
@ kCODEC_RegAddr8Bit
Definition: fsl_codec_i2c.h:26
_codec_i2c_config
CODEC I2C configurations structure.
Definition: fsl_codec_i2c.h:39
codec_reg_addr_t
enum _codec_reg_addr codec_reg_addr_t
CODEC device register address type.
CODEC_I2C_Send
status_t CODEC_I2C_Send(void *handle, uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *txBuff, uint8_t txBuffSize)
codec i2c send function.
Definition: fsl_codec_i2c.c:64
_codec_reg_width
_codec_reg_width
CODEC device register width.
Definition: fsl_codec_i2c.h:31
_codec_reg_addr
_codec_reg_addr
CODEC device register address type.
Definition: fsl_codec_i2c.h:24
CODEC_I2C_Receive
status_t CODEC_I2C_Receive(void *handle, uint8_t deviceAddress, uint32_t subAddress, uint8_t subaddressSize, uint8_t *rxBuff, uint8_t rxBuffSize)
codec i2c receive function.
Definition: fsl_codec_i2c.c:95
kCODEC_RegAddr16Bit
@ kCODEC_RegAddr16Bit
Definition: fsl_codec_i2c.h:27
CODEC_I2C_Init
status_t CODEC_I2C_Init(void *handle, uint32_t i2cInstance, uint32_t i2cBaudrate, uint32_t i2cSourceClockHz)
Codec i2c bus initilization.
Definition: fsl_codec_i2c.c:30
_codec_i2c_config::codecI2CInstance
uint32_t codecI2CInstance
Definition: fsl_codec_i2c.h:41
codec_reg_width_t
enum _codec_reg_width codec_reg_width_t
CODEC device register width.
kCODEC_RegWidth16Bit
@ kCODEC_RegWidth16Bit
Definition: fsl_codec_i2c.h:34
kCODEC_RegWidth8Bit
@ kCODEC_RegWidth8Bit
Definition: fsl_codec_i2c.h:33
status_t
int32_t status_t
Type used for all status and error return values.
Definition: fsl_common.h:189
i2c.h


picovoice_driver
Author(s):
autogenerated on Fri Apr 1 2022 02:13:56