Appiko
Functions
MCP4012 Driver

This file contains the declarations required to drive MCP4012 pot. These simple funtion helps user to set wiper value for MCP4012 easily. More...

Functions

void mcp4012_init (uint32_t CS_bar_pin_no, uint32_t UD_bar_pin_no, uint32_t SCK_pin_no)
 This function is used to initialize MCP4012 in our program. This will set wiper value of MCP4012 to zero. Which will be then increased to desired value. More...
 
void mcp4012_set_value (uint32_t value_sent_by_user)
 This function is used to set the value of MCP4012 wiper value. More...
 

Detailed Description

Function Documentation

◆ mcp4012_init()

void mcp4012_init ( uint32_t  CS_bar_pin_no,
uint32_t  UD_bar_pin_no,
uint32_t  SCK_pin_no 
)
Parameters
CS_bar_pin_noThis parameter is used to configure that pin number as CS_bar
UD_bar_pin_noThis parameter is used to configure that pin number as UD_bar
SCK_pin_noThis parameter is used to configure that pin number as SCK pin
Note
SCK pin is not required in our application, but we cannot use SPI without clock pulses. Make sure to use pin which is not been used or will be used in future.

Definition at line 69 of file mcp4012_x.c.

Referenced by sensepi_cam_trigger_init().

◆ mcp4012_set_value()

void mcp4012_set_value ( uint32_t  value_sent_by_user)
Parameters
value_sent_by_userThis parameter is used to set wiper value This value is transfered to MCP4012 using simple SPI which is used as Two Wire Protocol over here.

Definition at line 79 of file mcp4012_x.c.

References ASSERT.

Referenced by pot_test(), and rc_test().