Documentation ¶
Overview ¶
package servo_lib provides servo-related variables, such as dut-controls to be run before and after flashing, and a programmer argument.
Copyright 2022 The ChromiumOS Authors Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- type ServoConfig
- type ServoType
- func (s *ServoType) GetSerialNumberOption() string
- func (s *ServoType) IsC2D2() bool
- func (s *ServoType) IsCCD() bool
- func (s *ServoType) IsMicro() bool
- func (s *ServoType) IsMultipleServos() bool
- func (s *ServoType) IsV2() bool
- func (s *ServoType) IsV4() bool
- func (s *ServoType) PickServoSubtype(preferCCD bool) string
- type UnsupportedServoError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ServoConfig ¶
type ServoConfig struct { // dut-controls to run before flashing. DutOn [][]string // dut-controls to run after flashing. DutOff [][]string // programmer (-p) argument for futility. Programmer string // extra arguments to provide to futility, such as --fast or --force. ExtraArgs []string // servo_type in use. ServoType ServoType }
ServoConfig structure holds the servo-related variables that are necessary for provisioning firmware over Servo.
func GetServoConfig ¶
func GetServoConfig(board, servoSerial string, servoType ServoType) (*ServoConfig, error)
GetServoConfig returns ServoConfig, that depends on the |board| and |servoType|, and contains variables, necessary to flash that setup over Servo. One of those variables is a programmer argument, which needs to include |servoSerial| - serial number of the given DUT. Returns an error if a given |board| cannot be flashed using given |servoType|.
type ServoType ¶
type ServoType struct {
// contains filtered or unexported fields
}
ServoType is the used servo type, as reported by `dut-control servo_type`. ServoType determines arguments to use with futility when flashing.
func NewServoType ¶
func (*ServoType) GetSerialNumberOption ¶
func (*ServoType) IsMultipleServos ¶
func (*ServoType) PickServoSubtype ¶
PickServoSubtype allows to pick a single servo from dual servo types, such as "servo_v4p1_with_servo_micro_and_ccd_cr50". PickServoSubtype assumes that the servo is dual, use IsMultipleServos() function to check for that. |preferCCD| tells the function to pick the CCD servo, otherwise other servo type (likely servo_micro) will be chosen. Example:
If preferCCD is true, string above will return "servo_v4p1_with_ccd_cr50". If preferCCD is false, it will return "servo_v4p1_with_servo_micro".
type UnsupportedServoError ¶
func (*UnsupportedServoError) Error ¶
func (m *UnsupportedServoError) Error() string