AudioDAC/Drivers/CS43L22/CS43L22.h
2021-04-04 10:26:29 +02:00

35 lines
753 B
C

/*
* CS43L22.h
*
* Created on: Apr 3, 2021
* Author: Think
*/
#ifndef CS43L22_H
#define CS43L22_H
#include <inttypes.h>
#include "stm32f4xx_hal.h"
#include "MY_TYPES.h"
//CS43L22 register definition
#define ID 0x01
//CS43L22 Structure
typedef struct
{
I2C_HandleTypeDef *i2cHandler;
} CS43L22;
//Driver function declaration
bool CS43L22_Init(CS43L22 *device, I2C_HandleTypeDef *i2cHandler);
bool CS43L22_Reset(CS43L22 *device);
bool CS43L22_ApplyConfig(CS43L22 *device);
bool CS43L22_GetDeviceID(CS43L22 *device, uint8_t *chipID, uint8_t *chipREVID);
bool CS43L22_ReadRegister(CS43L22 *device, uint8_t registerAddr, uint8_t *data);
bool CS43L22_WriteRegister(CS43L22 *device, uint8_t registerAddr, uint8_t data);
#endif //CS43L22_H