ata6571 2.0.0.0
ATA6571 Click Driver

API for configuring and manipulating ATA6571 Click driver. More...

Topics

 ATA6571 Device Settings
 Settings for ATA6571 Click driver.
 
 ATA6571 MikroBUS Map
 MikroBUS pin mapping of ATA6571 Click driver.
 

Functions

void ata6571_cfg_setup (ata6571_cfg_t *cfg)
 ATA6571 configuration object setup function.
 
err_t ata6571_init (ata6571_t *ctx, ata6571_cfg_t *cfg)
 ATA6571 initialization function.
 
err_t ata6571_generic_write (ata6571_t *ctx, char *data_buf, uint16_t len)
 ATA6571 data writing function.
 
err_t ata6571_generic_read (ata6571_t *ctx, char *data_buf, uint16_t max_len)
 ATA6571 data reading function.
 
void ata6571_set_nstb_pin (ata6571_t *ctx, uint8_t state)
 ATA6571 set standby mode control function.
 
void ata6571_set_en_pin (ata6571_t *ctx, uint8_t state)
 ATA6571 set power control function.
 
uint8_t ata6571_get_nerr_pin (ata6571_t *ctx)
 ATA6571 get error and power-on indication output function.
 
void ata6571_set_operating_mode (ata6571_t *ctx, uint8_t op_mode)
 ATA6571 set operating mode function.
 

Detailed Description

API for configuring and manipulating ATA6571 Click driver.

Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.

Function Documentation

◆ ata6571_cfg_setup()

void ata6571_cfg_setup ( ata6571_cfg_t * cfg)

ATA6571 configuration object setup function.

This function initializes click configuration structure to initial values.

Parameters
[out]cfg: Click configuration structure. See ata6571_cfg_t object definition for detailed explanation.
Returns
Nothing.
Note
The all used pins will be set to unconnected state.

◆ ata6571_generic_read()

err_t ata6571_generic_read ( ata6571_t * ctx,
char * data_buf,
uint16_t max_len )

ATA6571 data reading function.

This function reads a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See ata6571_t object definition for detailed explanation.
[out]data_buf: Output read data.
[in]max_len: Number of bytes to be read.
Returns
  • >0 - Number of data bytes read,
  • <=0 - Error/Empty Ring buffer.
See #err_t definition for detailed explanation.
Note
None.

◆ ata6571_generic_write()

err_t ata6571_generic_write ( ata6571_t * ctx,
char * data_buf,
uint16_t len )

ATA6571 data writing function.

This function writes a desired number of data bytes by using UART serial interface.

Parameters
[in]ctx: Click context object. See ata6571_t object definition for detailed explanation.
[in]data_buf: Data buffer for sending.
[in]len: Number of bytes for sending.
Returns
  • >=0 - Success,
  • <0 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ata6571_get_nerr_pin()

uint8_t ata6571_get_nerr_pin ( ata6571_t * ctx)

ATA6571 get error and power-on indication output function.

This function returns the NERR pin state which is an error and power-on indicator.

Parameters
[in]ctx: Click context object. See ata6571_t object definition for detailed explanation.
Returns
Pin logic state.
Note
None.

◆ ata6571_init()

err_t ata6571_init ( ata6571_t * ctx,
ata6571_cfg_t * cfg )

ATA6571 initialization function.

This function initializes all necessary pins and peripherals used for this click board.

Parameters
[out]ctx: Click context object. See ata6571_t object definition for detailed explanation.
[in]cfg: Click configuration structure. See ata6571_cfg_t object definition for detailed explanation.
Returns
  • 0 - Success,
  • -1 - Error.
See #err_t definition for detailed explanation.
Note
None.

◆ ata6571_set_en_pin()

void ata6571_set_en_pin ( ata6571_t * ctx,
uint8_t state )

ATA6571 set power control function.

This function sets power control by setting the EN pin.

Parameters
[in]ctx: Click context object. See ata6571_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ata6571_set_nstb_pin()

void ata6571_set_nstb_pin ( ata6571_t * ctx,
uint8_t state )

ATA6571 set standby mode control function.

This function sets standby mode by setting the NSTB pin.

Parameters
[in]ctx: Click context object. See ata6571_t object definition for detailed explanation.
[in]state: Pin logic state.
Returns
None.
Note
None.

◆ ata6571_set_operating_mode()

void ata6571_set_operating_mode ( ata6571_t * ctx,
uint8_t op_mode )

ATA6571 set operating mode function.

This function sets the device operating mode by controlling the EN and NSTB pins.

Parameters
[in]ctx: Click context object. See ata6571_t object definition for detailed explanation.
[in]op_mode- 0x00 ( ATA6571_OPERATING_MODE_SLEEP ) : Sleep mode.
  • 0x01 ( ATA6571_OPERATING_MODE_STANDBY ): Standby mode.
  • 0x00 ( ATA6571_OPERATING_MODE_SILENT ) : Silent mode.
  • 0x01 ( ATA6571_OPERATING_MODE_NORMAL ) : Normal mode.
Returns
None.
Note
None.