Kestrel Interface
Loading...
Searching...
No Matches
kest_sgtl5000.c File Reference
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include "esp_err.h"
#include "esp_check.h"
#include "esp_log.h"
#include "kest_error_codes.h"
#include "kest_printf.h"
#include "driver/spi_master.h"
#include "driver/i2c_master.h"
#include "driver/pulse_cnt.h"
#include "driver/gpio.h"
#include "kest_sgtl5000.h"

Go to the source code of this file.

Data Structures

struct  sgtl5000_i2c_cfg_t
struct  sgtl_reg_desc_t

Macros

#define SGTL5000_SDA   15
#define SGTL5000_SCL   16

Functions

int sgtl5000_i2c_init (const sgtl5000_i2c_cfg_t *cfg)
int sgtl5000_set_address_level (int cs_level_high)
int sgtl5000_read_reg (uint16_t reg, uint16_t *out_val)
int sgtl5000_write_reg (uint16_t reg, uint16_t val)
int sgtl5000_modify_reg (uint16_t reg, uint16_t val, uint16_t mask, uint16_t *out_newval)
int sgtl5000_enable (void)
int sgtl5000_line_in_level (uint8_t n)
int sgtl5000_line_out_level (uint8_t n)
void sgtl_power_gpio_init (void)
void sgtl5000_readout_registers ()
void kest_sgtl5000_init (void *param)

Variables

int sgtl5000_status = 0

Macro Definition Documentation

◆ SGTL5000_SCL

#define SGTL5000_SCL   16

Definition at line 19 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

◆ SGTL5000_SDA

#define SGTL5000_SDA   15

Definition at line 18 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

Function Documentation

◆ kest_sgtl5000_init()

void kest_sgtl5000_init ( void * param)

Definition at line 267 of file kest_sgtl5000.c.

Referenced by app_main().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgtl5000_enable()

int sgtl5000_enable ( void )

Definition at line 142 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgtl5000_i2c_init()

int sgtl5000_i2c_init ( const sgtl5000_i2c_cfg_t * cfg)

Definition at line 41 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

Here is the caller graph for this function:

◆ sgtl5000_line_in_level()

int sgtl5000_line_in_level ( uint8_t n)

Definition at line 189 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgtl5000_line_out_level()

int sgtl5000_line_out_level ( uint8_t n)

Definition at line 195 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgtl5000_modify_reg()

int sgtl5000_modify_reg ( uint16_t reg,
uint16_t val,
uint16_t mask,
uint16_t * out_newval )

Definition at line 128 of file kest_sgtl5000.c.

Referenced by sgtl5000_enable(), and sgtl5000_line_out_level().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sgtl5000_read_reg()

int sgtl5000_read_reg ( uint16_t reg,
uint16_t * out_val )

Definition at line 93 of file kest_sgtl5000.c.

Referenced by sgtl5000_modify_reg().

Here is the caller graph for this function:

◆ sgtl5000_readout_registers()

void sgtl5000_readout_registers ( )

Definition at line 232 of file kest_sgtl5000.c.

Here is the call graph for this function:

◆ sgtl5000_set_address_level()

int sgtl5000_set_address_level ( int cs_level_high)

Definition at line 70 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

Here is the caller graph for this function:

◆ sgtl5000_write_reg()

int sgtl5000_write_reg ( uint16_t reg,
uint16_t val )

Definition at line 109 of file kest_sgtl5000.c.

Referenced by sgtl5000_enable(), sgtl5000_line_in_level(), and sgtl5000_modify_reg().

Here is the caller graph for this function:

◆ sgtl_power_gpio_init()

void sgtl_power_gpio_init ( void )

Definition at line 202 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().

Here is the caller graph for this function:

Variable Documentation

◆ sgtl5000_status

int sgtl5000_status = 0

Definition at line 23 of file kest_sgtl5000.c.

Referenced by kest_sgtl5000_init().